Files
hhrs/common/http.api.js
T

92 lines
3.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// xuchao: 怀化人社 H5 接口清单,与 docs/hhrs-api-doc.md 一一对应
// 基址由 common/http.interceptor.js 统一注入(common/config.js.baseUrl)
// 登录 / 云闪付入口
// xuchao: hhrs 专属登录端点(旧地址 open-api/pingXiang/* 由后端兼容层转发,已弃用)
const LoginUrl = 'open-api/hhService/login'
const SendVerifyCodeUrl = 'open-api/hhService/sendLoginVerifyCode'
const TokenDecodeUrl = 'open-api/hhService/tokenDecode'
// 门店(文旅场馆 typeId=1 / 商户折扣 typeId=2)
const StoreListUrl = 'mp-api/hhrsStore/list'
const StoreDetailUrl = 'mp-api/hhrsStore/detail'
// 权益包
const RightsListUrl = 'mp-api/hhrsRights/list'
const RightsDetailUrl = 'mp-api/hhrsRights/detail'
const EligibilityUrl = 'mp-api/hhrsRights/eligibility'
const AppointmentListUrl = 'mp-api/hhrsRights/appointment/list'
const CheckListUrl = 'mp-api/hhrsRights/check/list'
// 实名人脸认证(阿里云)
const InitFaceVerifyUrl = 'open-api/aliyun/face/initFaceVerify'
const DescribeFaceVerifyUrl = 'open-api/aliyun/face/describeFaceVerify'
// 中奖公示
const WinnerDatesUrl = 'mp-api/hhrsWinner/dates'
const WinnerListUrl = 'mp-api/hhrsWinner/list'
// 预约下单(智慧游卡包)
const AppointUrl = 'zhy-api/cardBag/appoint'
// xuchao: 怀化石油汽油券(下单/预支付/最新订单查询,后端 HhVoucherController)
const VoucherCreateUrl = 'open-api/hhService/voucher/create'
const VoucherPrepayUrl = 'open-api/hhService/voucher/prepay'
const VoucherLatestUrl = 'open-api/hhService/voucher/latest'
const VoucherCheckCodeUrl = 'open-api/hhService/voucher/checkCode'
// 此处第二个参数vm,就是我们在页面使用的this
const install = (Vue, vm) => {
// 登录与凭证
const checkerLogin = (params = {}) => vm.$u.post(LoginUrl, params)
const sendLoginVerifyCode = (params = {}) => vm.$u.post(SendVerifyCodeUrl, params)
// xuchao: 云闪付入口 token 解码
const tokenDecode = (params = {}) => vm.$u.post(TokenDecodeUrl, params)
// 门店列表/详情
const getStoreList = (params = {}) => vm.$u.post(StoreListUrl, params)
const getStoreDetail = (params = {}) => vm.$u.post(StoreDetailUrl, params)
// 权益包
const getRightsList = (params = {}) => vm.$u.post(RightsListUrl, params)
const getRightsDetail = (params = {}) => vm.$u.post(RightsDetailUrl, params)
// xuchao: 注意 identityNo 会触发后端“被动认证”回写,仅在认证流程中传
const getEligibility = (params = {}) => vm.$u.post(EligibilityUrl, params)
const getAppointmentList = (params = {}) => vm.$u.post(AppointmentListUrl, params)
const getCheckList = (params = {}) => vm.$u.post(CheckListUrl, params)
const doAppoint = (params = {}) => vm.$u.post(AppointUrl, params)
// 人脸核身
const initFaceVerify = (params = {}) => vm.$u.post(InitFaceVerifyUrl, params)
const describeFaceVerify = (params = {}) => vm.$u.post(DescribeFaceVerifyUrl, params)
// 中奖名单
const getWinnerDates = (params = {}) => vm.$u.get(WinnerDatesUrl, params)
const getWinnerList = (params = {}) => vm.$u.post(WinnerListUrl, params)
// xuchao: 石油汽油券
const voucherCreate = (params = {}) => vm.$u.post(VoucherCreateUrl, params)
const voucherPrepay = (params = {}) => vm.$u.post(VoucherPrepayUrl, params)
const voucherLatest = (params = {}) => vm.$u.post(VoucherLatestUrl, params)
const voucherCheckCode = (params = {}) => vm.$u.post(VoucherCheckCodeUrl, params)
vm.$u.api = {
checkerLogin,
sendLoginVerifyCode,
tokenDecode,
getStoreList,
getStoreDetail,
getRightsList,
getRightsDetail,
getEligibility,
getAppointmentList,
getCheckList,
doAppoint,
initFaceVerify,
describeFaceVerify,
getWinnerDates,
getWinnerList,
voucherCreate,
voucherPrepay,
voucherLatest,
voucherCheckCode
}
}
export default {
install
}