|
|
@@ -14,8 +14,8 @@ export type RequestConfig = {
|
|
|
|
|
|
// 基础 URL
|
|
|
// const BASE_URL = "http://192.168.110.105:8080";
|
|
|
-const BASE_URL = "http://222.243.138.146:5095" //测试服务器;
|
|
|
- // const BASE_URL = "http://222.243.138.146:5097" //正式服务器;
|
|
|
+// const BASE_URL = "http://222.243.138.146:5095" //测试服务器;
|
|
|
+ const BASE_URL = "http://222.243.138.146:5097" //正式服务器;
|
|
|
// const BASE_URL = "http://10.170.129.135:8089";
|
|
|
// const BASE_URL = "http://222.243.138.146:5096/prod-api"
|
|
|
// const BASE_URL = "http://10.170.129.135/prod-api";
|
|
|
@@ -52,6 +52,9 @@ export const request = (config: RequestConfig): Promise<any> => {
|
|
|
for (const key in customHeader) {
|
|
|
header[key] = customHeader[key];
|
|
|
}
|
|
|
+ if(config.header['isToken'] == false){
|
|
|
+ header["Authorization"] = ""
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 发起请求
|
|
|
@@ -82,11 +85,7 @@ export const request = (config: RequestConfig): Promise<any> => {
|
|
|
}else if (code != null && (code == 403)) {
|
|
|
// 有些接口使用 code 字段
|
|
|
const errorMsg = msg != null ? msg : "请求失败";
|
|
|
- uni.showToast({
|
|
|
- title: config.url + errorMsg ,
|
|
|
- icon: 'success'
|
|
|
- })
|
|
|
- resolve(result as any);
|
|
|
+ reject(new Error(errorMsg));
|
|
|
} else {
|
|
|
const errorMsg = msg != null ? msg : "请求失败";
|
|
|
reject(new Error(errorMsg));
|