|
|
@@ -16,14 +16,15 @@ isDevelopment = e === "develop" || e === "trial";
|
|
|
const env: string = isDevelopment ? "dev" : "prd";
|
|
|
const apis = {
|
|
|
dev: {
|
|
|
- serverUrl: "https://dev.kuaiyuman.cn/api/",
|
|
|
+ serverUrl: "http://localhost:8088/api",
|
|
|
fileUrl: "https://zyp-1258963180.cos.ap-guangzhou.myqcloud.com/"
|
|
|
},
|
|
|
prd: {
|
|
|
- serverUrl: "https://npww.net.cn/cms/",
|
|
|
- fileUrl: "https://zyp-1258963180.cos.ap-guangzhou.myqcloud.com/",
|
|
|
+ serverUrl: "https://wash.kuaiyuman.cn/api/",
|
|
|
+ fileUrl: "https://wash.kuaiyuman.cn",
|
|
|
},
|
|
|
};
|
|
|
+// @ts-ignore
|
|
|
const cfg = {
|
|
|
key: {
|
|
|
token: 'wash.token'
|
|
|
@@ -52,8 +53,8 @@ const isEmptyOrNull = function (exp: any) {
|
|
|
const get = (url: string, param = {}) => {
|
|
|
let token = fetchToken() || ""
|
|
|
if (!isEmptyOrNull(param)) {
|
|
|
- var params = [];
|
|
|
- for (var key in param) {
|
|
|
+ let params = [];
|
|
|
+ for (let key in param) {
|
|
|
// @ts-ignore
|
|
|
params.push(encodeURIComponent(key) + "=" + encodeURIComponent(param[key]));
|
|
|
}
|
|
|
@@ -99,9 +100,9 @@ const request = (options: any) => {
|
|
|
method: options.method,
|
|
|
header: options.header,
|
|
|
dataType: options.dataType
|
|
|
- }).then(res => {
|
|
|
+ }).then((res:any) => {
|
|
|
// @ts-ignore
|
|
|
- let response = res[1].data;
|
|
|
+ let response = res.data;
|
|
|
if (response.code !== 200) {
|
|
|
if (response.code == 92213 || response.code == 92305) {
|
|
|
uni.showToast({
|