开始做充值和发票

This commit is contained in:
2024-03-20 11:10:52 +08:00
parent e5c9a96353
commit 7648ace524
59 changed files with 1091 additions and 199 deletions

View File

@@ -43,7 +43,8 @@ export function getConfigByEnv() {
switch (envVersion) {
// 开发版
case 'develop':
api = "http://localhost:8000"
// api = "http://localhost:8000"
api = "http://127.0.0.1:4523/m1/4143821-0-default"
break;
// 体验版
case 'trial':
@@ -195,4 +196,21 @@ export const wxLogin = () => {
}
})
})
}
export const wxModal = (data) => {
const { title = '提示', content } = data;
return new Promise((resolve, reject) => {
wx.showModal({
title,
content,
success (res) {
if (res.confirm) {
resolve()
} else if (res.cancel) {
reject()
}
}
})
})
}

View File

@@ -85,19 +85,18 @@ const parseResponse = function (response) {
wx.redirectTo({
url: '/pages/login/index',
})
return { code: 1, message: '未登录状态' }
return { code: 401, message: '未登录状态' }
}
if (statusCode === 404) {
return { code: 1, message: "服务故障" }
return { code: 404, message: "服务故障" }
}
if (500 <= statusCode < 600) {
return { code: 1, message: "服务错误" }
if (500 <= statusCode && statusCode < 600) {
return { code: 500, message: "服务错误" }
}
if (response.data.code !== 0) {
if (response.data.code !== 200) {
}
return response.data;
}