页面功能修改
This commit is contained in:
+18
-3
@@ -1,6 +1,6 @@
|
||||
// const baseUrl = "https://api.collect.hs.hnzhwlkj.club/"; //这里放置url域名32044
|
||||
// const baseUrl = "http://192.168.0.72:8083/api/v1/"; //这里放置url域名32044
|
||||
|
||||
const baseUrl = "http://219.157.255.213:9007/"; //这里放置url域名32044
|
||||
// const baseUrl = "http://api.crm.hnxinyouhe.com/"; //这里放置url域名32044
|
||||
// const baseUrl = "http://192.168.50.4:8787/"; //这里放置url域名32044
|
||||
// const baseUrl = "/api/"; //这里放置url域名32044
|
||||
export function request(options){//封装的requset
|
||||
@@ -17,9 +17,23 @@ export function request(options){//封装的requset
|
||||
header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')},
|
||||
method:method||"GET",//默认请求方式是get
|
||||
success: (res) => {
|
||||
resolve(res)
|
||||
if(res.data.code==401){
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/index',// 替换为你要跳转的页面路径
|
||||
});
|
||||
}, 1000);
|
||||
}else{
|
||||
resolve(res)
|
||||
}
|
||||
},
|
||||
complete: (data)=>{
|
||||
|
||||
console.log(data.code)
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
@@ -38,6 +52,7 @@ export function requestx(options){//封装的requset
|
||||
resolve(res)
|
||||
},
|
||||
complete: (data)=>{
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user