Commit 75610d8b by 张杰

增加测试地址

增加测试地址
1 parent 99a08d34
......@@ -9,11 +9,11 @@ function t(t, e, a, i, c, p, s, u) {
method: i,
dataType: c,
responseType: p,
success: function(t) {
success: function (t) {
n(t.header), 401 == t.statusCode ? wx.navigateTo({
url: "/pages/auth/login/login"
}) : 200 == t.statusCode ? s(t.data) : 412 == t.statusCode || 411 == t.statusCode ? wx.login({
success: function(t) {
success: function (t) {
l.globalData.code = t.code, wx.redirectTo({
url: "/pages/index/index"
});
......@@ -22,32 +22,39 @@ function t(t, e, a, i, c, p, s, u) {
url: "/pages/login/index/index"
}) : u && "function" == typeof u && u();
},
fail: function(t) {
fail: function (t) {
console.log("error:" + JSON.stringify(t)), u && "function" == typeof u && u();
},
complete: function(t) {
complete: function (t) {
wx.hideNavigationBarLoading();
}
});
}
function n(t) {
var n = wx.getStorageSync(e), o = t["Set-Cookie"];
var n = wx.getStorageSync(e),
o = t["Set-Cookie"];
if (o) {
var a = new RegExp(e + "=([^;]*)", "ig");
(n = o.match(a) ? o.match(a)[0].substr(e.length + 1) : null) && wx.setStorageSync(e, n);
}
return n && (t.Cookie = [ e, "=", n ].join("")), t;
return n && (t.Cookie = [e, "=", n].join("")), t;
}
var o = "https://gps.cgacar.com", e = "DJ_S_";
//测试环境
var o = "https://dj.test.glsx.com.cn";
// 正式环境
//var o = "https://gps.cgacar.com";
var e = "DJ_S_";
getApp();
module.exports = {
domain: o,
req: t,
uploadMedia: function(t, n, e) {
uploadMedia: function (t, n, e) {
wx.uploadFile({
url: o + "/web-dj-weapp-mp/" + t,
filePath: n,
......@@ -55,10 +62,10 @@ module.exports = {
formData: {
fileCategory: "AG"
},
success: function(t) {
success: function (t) {
e(JSON.parse(t.data));
},
fail: function(t) {
fail: function (t) {
console.log(t), wx.showToast({
title: t,
icon: "none"
......@@ -66,41 +73,41 @@ module.exports = {
}
});
},
getSessionId: function() {
getSessionId: function () {
return wx.getStorageSync(e);
},
jscodeLogin: function(n, o, e) {
jscodeLogin: function (n, o, e) {
t("/web-dj-weapp-mp/jscode/login", {
code: n,
appId: o
}, {}, "GET", "json", "text", e);
},
authUserInfo: function(n, o, e) {
authUserInfo: function (n, o, e) {
t("/web-dj-weapp-mp/auth/userinfo", JSON.stringify(n), {
"content-type": "application/json"
}, "POST", "json", "text", o, e);
},
authPhone: function(n, o) {
authPhone: function (n, o) {
t("/web-dj-weapp-mp/auth/phone", JSON.stringify(n), {
"content-type": "application/json"
}, "POST", "json", "text", o);
},
authAccount: function(n, o) {
authAccount: function (n, o) {
t("/web-dj-weapp-mp/auth/account", JSON.stringify(n), {
"content-type": "application/json"
}, "POST", "json", "text", o);
},
choiceAccountLogin: function(n, o) {
choiceAccountLogin: function (n, o) {
t("/web-dj-weapp-mp/choice/account/login", JSON.stringify(n), {
"content-type": "application/json"
}, "POST", "json", "text", o);
},
logout: function(n) {
logout: function (n) {
t("/web-dj-weapp-mp/logout", null, {
"content-type": "application/json"
}, "POST", "json", "text", n);
},
checkLogin: function(n) {
checkLogin: function (n) {
t("/web-dj-weapp-mp/login/check", null, {
"content-type": "application/json"
}, "POST", "json", "text", n);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!