首页修改

This commit is contained in:
魏啾
2024-05-08 19:37:19 +08:00
parent 56863dd624
commit 9d6e4bb57c
36 changed files with 1003 additions and 288 deletions

View File

@@ -4,6 +4,7 @@ const debug = process.env.NODE_ENV == 'development' ? true : false;
// #ifdef H5
// const baseUrl = debug ? proxyApi : "http://wxgzh.sxczgkj.cn"
const baseUrl = 'https://invoice.sxczgkj.cn/api/'//正式
// const baseUrl = 'http://192.168.2.23:8888/api/'//正式
// const baseUrl = 'http://test.invoice.sxczgkj.cn/api/'//测试
// #endif
// import VConsole from "./vConsole.js"

View File

@@ -43,15 +43,12 @@ async function request(options) {
'android': 1
}
options.header = {
type: platformInfo[system.platform],
userId: uni.getStorageSync('userId'),
token: uni.getStorageSync('token'),
myLoginName: uni.getStorageSync('myLoginName'),
version: uni.conf.version,
'content-type': 'application/json'
}
let res = await uni.pro.request(options)
if (res.code >= 400) {
console.log(res)
if (res.code != 1) {
if (options.toast) {
uni.showToast({
title: res.message || res.msg,
@@ -88,25 +85,19 @@ async function request(options) {
return Promise.reject(res.message)
}
} else {
console.log(res)
// if (options.toast) {
// uni.showToast({
// title: res.message || res.msg,
// icon: "none",
// success: () => {
// setTimeout(res => {
// if (options.toast) {
// // #ifdef MP-WEIXIN
// uni.hideLoading()
// // #endif
// // #ifndef MP-WEIXIN
// uni.pro.hideLoading()
// // #endif
// }
// },2000)
// }
// })
// }
if (!options.toast) {
uni.showToast({
title: res.message || res.msg,
icon: "none",
success() {
setTimeout(res => {
// if (options.toast) {
uni.hideLoading()
// }
}, 2000)
}
})
}
return res
}