测试支付功能

This commit is contained in:
gaoxs
2020-04-23 19:55:05 +08:00
parent 2171e9f7bd
commit c66a90ed50
9 changed files with 62 additions and 28 deletions

View File

@ -119,7 +119,7 @@ export const replaceLogin = (msg) => {
});
// 这里代表已经失去登录状态以及401强制推出登录了
store.commit('LOGOUT')
if (Vue.prototype.$deviceType == 'weixin') {
if (Vue.prototype.$deviceType == 'routine') {
// 如果是微信小程序,跳转到授权页
login({
fail: () => {
@ -196,7 +196,7 @@ export const login = (option) => {
uni.getUserInfo({
provider: provider,
success: function (user) {
if (Vue.prototype.$deviceType == 'weixin') {
if (Vue.prototype.$deviceType == 'routine') {
wxappAuth({
encryptedData: user.encryptedData,
iv: user.iv,

View File

@ -47,14 +47,15 @@ function baseRequest(options) {
// 提示错误信息
return Promise.reject({ msg: "未登录", toLogin: true });
}
console.log(options)
// 结构请求需要的参数
const { url, params, data, login, ...option } = options
// 发起请求
return fly.request(url, params || data, {
...option
}).then(res => {
}).then(res => {
console.log(res)
const data = res.data || {};
if (res.status !== 200) {