mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 21:03:17 +08:00
78 lines
1.2 KiB
JavaScript
78 lines
1.2 KiB
JavaScript
/**
|
||
* 建行生活 API 接口
|
||
*
|
||
* @author Billy
|
||
* @date 2025-01-17
|
||
*/
|
||
|
||
import request from '@/sheep/request';
|
||
|
||
const ccbApi = {
|
||
/**
|
||
* URL跳转登录
|
||
* 建行App会携带加密参数跳转到此地址
|
||
*/
|
||
login: (params) => {
|
||
return request({
|
||
url: '/ccblife/login',
|
||
method: 'GET',
|
||
params: params,
|
||
custom: {
|
||
showLoading: true,
|
||
auth: false
|
||
}
|
||
});
|
||
},
|
||
|
||
/**
|
||
* 自动登录(JSBridge方式)
|
||
* H5在建行App内打开时,通过JSBridge获取用户信息后调用
|
||
*/
|
||
autoLogin: (data) => {
|
||
return request({
|
||
url: '/ccblife/autoLogin',
|
||
method: 'POST',
|
||
data: data,
|
||
custom: {
|
||
showLoading: true,
|
||
auth: false
|
||
}
|
||
});
|
||
},
|
||
|
||
/**
|
||
* 生成支付串
|
||
* 用于调起建行收银台
|
||
*/
|
||
createPayment: (orderId) => {
|
||
return request({
|
||
url: '/ccbpayment/createPayment',
|
||
method: 'POST',
|
||
data: {
|
||
order_id: orderId
|
||
},
|
||
custom: {
|
||
showLoading: true,
|
||
auth: true
|
||
}
|
||
});
|
||
},
|
||
|
||
/**
|
||
* 支付回调
|
||
* 支付完成后通知后端
|
||
*/
|
||
paymentCallback: (data) => {
|
||
return request({
|
||
url: '/ccbpayment/callback',
|
||
method: 'POST',
|
||
data: data,
|
||
custom: {
|
||
showLoading: false,
|
||
auth: true
|
||
}
|
||
});
|
||
}
|
||
};
|
||
|
||
export default ccbApi; |