|
|
|
@ -1,13 +1,7 @@
|
|
|
|
// let ajaxUrl = "http://192.168.3.83:8001";
|
|
|
|
// let ajaxUrl = "http://192.168.3.83:8001";
|
|
|
|
let ajaxUrl = "https://daotian.matripe.com.cn";
|
|
|
|
let ajaxUrl = "https://daotian.matripe.com.cn";
|
|
|
|
let requestTask;
|
|
|
|
|
|
|
|
let data = {
|
|
|
|
let data = {
|
|
|
|
ajaxUrl: ajaxUrl,
|
|
|
|
ajaxUrl: ajaxUrl,
|
|
|
|
startAbort($bool = 0) {
|
|
|
|
|
|
|
|
if ($bool == 1) {
|
|
|
|
|
|
|
|
requestTask.abort();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Get ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) {
|
|
|
|
Get ($url = '', $parmas = {}, callback = () => { }, failback = () => { }) {
|
|
|
|
let that = this,
|
|
|
|
let that = this,
|
|
|
|
params = {};
|
|
|
|
params = {};
|
|
|
|
@ -113,11 +107,7 @@ let data = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log("公共参数,+++++", Object.assign($parmas, that.setPublicParams()));
|
|
|
|
console.log("公共参数,+++++", Object.assign($parmas, that.setPublicParams()));
|
|
|
|
uni.getNetworkType({
|
|
|
|
uni.request({
|
|
|
|
success: function(res) {
|
|
|
|
|
|
|
|
// console.log(res);
|
|
|
|
|
|
|
|
if (res.networkType != 'none') {
|
|
|
|
|
|
|
|
requestTask = uni.request({
|
|
|
|
|
|
|
|
url: ajaxUrl + $url,
|
|
|
|
url: ajaxUrl + $url,
|
|
|
|
data: Object.assign($parmas, that.setPublicParams()),
|
|
|
|
data: Object.assign($parmas, that.setPublicParams()),
|
|
|
|
header: Object.assign($header, that.setPublicParams()),
|
|
|
|
header: Object.assign($header, that.setPublicParams()),
|
|
|
|
@ -137,8 +127,7 @@ let data = {
|
|
|
|
failback(resData);
|
|
|
|
failback(resData);
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.reLaunch({
|
|
|
|
uni.reLaunch({
|
|
|
|
url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' +
|
|
|
|
url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' + that.getPathCopy().level
|
|
|
|
that.getPathCopy().level
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, 1500);
|
|
|
|
}, 1500);
|
|
|
|
} else if (resData.status == 500 || resData.status == 502) {// 某种原因导致接口提示该状态码
|
|
|
|
} else if (resData.status == 500 || resData.status == 502) {// 某种原因导致接口提示该状态码
|
|
|
|
@ -161,8 +150,7 @@ let data = {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.reLaunch({
|
|
|
|
uni.reLaunch({
|
|
|
|
url: '/root/person/loginIndex?path=/pages/home/index&level=' + that
|
|
|
|
url: '/root/person/loginIndex?path=/pages/home/index&level=' + that.getPathCopy().level
|
|
|
|
.getPathCopy().level
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, 1500);
|
|
|
|
}, 1500);
|
|
|
|
} else {// 其他异常
|
|
|
|
} else {// 其他异常
|
|
|
|
@ -188,14 +176,6 @@ let data = {
|
|
|
|
failback(error);
|
|
|
|
failback(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
|
|
|
|
uni.showToast({
|
|
|
|
|
|
|
|
title: '网络异常,请检查网络',
|
|
|
|
|
|
|
|
icon: "none"
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 头像上传
|
|
|
|
// 头像上传
|
|
|
|
@ -231,6 +211,17 @@ let data = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//监听用户的页面点击
|
|
|
|
|
|
|
|
watchUserPage (path) {
|
|
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (uni.getStorageSync("apply-userinfo")) {
|
|
|
|
|
|
|
|
that.Post("/common/user/browsing/history/addRecord", { browsingUrl: path }, (res) => { });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
console.log("error", error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default data;
|
|
|
|
export default data;
|