no message
This commit is contained in:
@@ -9,16 +9,16 @@ var e;
|
||||
url: "wxapp/home/nav",
|
||||
cachetime: "30",
|
||||
success: function (e) {
|
||||
e.data.message.errno ||
|
||||
e.data.message.code == 200 ||
|
||||
(console.log(e.data.message.message),
|
||||
a.setData({ navs: e.data.message.message }));
|
||||
a.setData({ navs: e.data.message.message }));
|
||||
},
|
||||
}),
|
||||
e.util.request({
|
||||
url: "wxapp/home/slide",
|
||||
cachetime: "30",
|
||||
success: function (e) {
|
||||
e.data.message.errno ||
|
||||
e.data.message.code == 200 ||
|
||||
a.setData({ slide: e.data.message.message });
|
||||
},
|
||||
}),
|
||||
@@ -26,7 +26,7 @@ var e;
|
||||
url: "wxapp/home/commend",
|
||||
cachetime: "30",
|
||||
success: function (e) {
|
||||
e.data.message.errno ||
|
||||
e.data.message.code == 200 ||
|
||||
a.setData({ commend: e.data.message.message });
|
||||
},
|
||||
});
|
||||
|
@@ -6,11 +6,11 @@
|
||||
return (
|
||||
t in e
|
||||
? Object.defineProperty(e, t, {
|
||||
value: n,
|
||||
enumerable: !0,
|
||||
configurable: !0,
|
||||
writable: !0,
|
||||
})
|
||||
value: n,
|
||||
enumerable: !0,
|
||||
configurable: !0,
|
||||
writable: !0,
|
||||
})
|
||||
: (e[t] = n),
|
||||
e
|
||||
);
|
||||
@@ -52,18 +52,18 @@
|
||||
return r(c + (n = n || getApp().siteInfo.token));
|
||||
}
|
||||
var _typeof =
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
},
|
||||
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
|
||||
? function (e) {
|
||||
return typeof e;
|
||||
}
|
||||
: function (e) {
|
||||
return e &&
|
||||
"function" == typeof Symbol &&
|
||||
e.constructor === Symbol &&
|
||||
e !== Symbol.prototype
|
||||
? "symbol"
|
||||
: typeof e;
|
||||
},
|
||||
_base = require("base64"),
|
||||
_md = require("md5"),
|
||||
_md2 = _interopRequireDefault(_md),
|
||||
@@ -80,20 +80,13 @@
|
||||
url: function (e, t) {
|
||||
var n = getApp(),
|
||||
a =
|
||||
n.siteInfo.siteroot +
|
||||
"?i=" +
|
||||
n.siteInfo.uniacid +
|
||||
"&t=" +
|
||||
n.siteInfo.multiid +
|
||||
"&v=" +
|
||||
n.siteInfo.version +
|
||||
"&from=wxapp&";
|
||||
n.siteInfo.siteroot + "?from=wxapp&";
|
||||
if (
|
||||
(e &&
|
||||
((e = e.split("/"))[0] && (a += "c=" + e[0] + "&"),
|
||||
e[1] && (a += "a=" + e[1] + "&"),
|
||||
e[2] && (a += "do=" + e[2] + "&")),
|
||||
t && "object" === (void 0 === t ? "undefined" : _typeof(t)))
|
||||
e[1] && (a += "a=" + e[1] + "&"),
|
||||
e[2] && (a += "do=" + e[2] + "&")),
|
||||
t && "object" === (void 0 === t ? "undefined" : _typeof(t)))
|
||||
)
|
||||
for (var r in t)
|
||||
r && t.hasOwnProperty(r) && t[r] && (a += r + "=" + t[r] + "&");
|
||||
@@ -115,11 +108,11 @@
|
||||
(-1 == i.indexOf("http://") &&
|
||||
-1 == i.indexOf("https://") &&
|
||||
(i = util.url(i)),
|
||||
getUrlParam(i, "state") ||
|
||||
getUrlParam(i, "state") ||
|
||||
(e.data && e.data.state) ||
|
||||
!r ||
|
||||
(i = i + "&state=we7sid-" + r),
|
||||
!e.data || !e.data.m)
|
||||
!e.data || !e.data.m)
|
||||
) {
|
||||
var o = getCurrentPages();
|
||||
o.length &&
|
||||
@@ -131,8 +124,8 @@
|
||||
if ((s && (i = i + "&sign=" + s), !i)) return !1;
|
||||
if (
|
||||
(wx.showNavigationBarLoading(),
|
||||
e.showLoading && util.showLoading(),
|
||||
e.cachetime)
|
||||
e.showLoading && util.showLoading(),
|
||||
e.cachetime)
|
||||
) {
|
||||
var u = n(i),
|
||||
c = wx.getStorageSync(u),
|
||||
@@ -159,50 +152,50 @@
|
||||
method: e.method ? e.method : "GET",
|
||||
}),
|
||||
"header",
|
||||
{ "content-type": "application/x-www-form-urlencoded" }
|
||||
{ "content-type": "application/json" }
|
||||
),
|
||||
_defineProperty(t, "success", function (t) {
|
||||
if (
|
||||
(wx.hideNavigationBarLoading(), wx.hideLoading(), t.data.errno)
|
||||
) {
|
||||
if ("41009" == t.data.errno)
|
||||
return (
|
||||
wx.setStorageSync("userInfo", ""),
|
||||
void util.getUserInfo(function () {
|
||||
util.request(e);
|
||||
})
|
||||
);
|
||||
if (e.fail && "function" == typeof e.fail) e.fail(t);
|
||||
else if (t.data.message) {
|
||||
if (null != t.data.data && t.data.data.redirect)
|
||||
n = t.data.data.redirect;
|
||||
else var n = "";
|
||||
a.util.message(t.data.message, n, "error");
|
||||
_defineProperty(t, "success", function (t) {
|
||||
if (
|
||||
(wx.hideNavigationBarLoading(), wx.hideLoading(), t.data.code)
|
||||
) {
|
||||
if ("401" == t.data.code)
|
||||
return (
|
||||
wx.setStorageSync("userInfo", ""),
|
||||
void util.getUserInfo(function () {
|
||||
util.request(e);
|
||||
})
|
||||
);
|
||||
if (e.fail && "function" == typeof e.fail) e.fail(t);
|
||||
else if (t.data.message) {
|
||||
if (null != t.data.data && t.data.data.redirect)
|
||||
n = t.data.data.redirect;
|
||||
else var n = "";
|
||||
a.util.message(t.data.message, n, "error");
|
||||
}
|
||||
} else if (
|
||||
(e.success && "function" == typeof e.success && e.success(t),
|
||||
e.cachetime)
|
||||
) {
|
||||
var r = { data: t.data, expire: f + 1e3 * e.cachetime };
|
||||
wx.setStorageSync(u, r);
|
||||
}
|
||||
} else if (
|
||||
(e.success && "function" == typeof e.success && e.success(t),
|
||||
e.cachetime)
|
||||
) {
|
||||
var r = { data: t.data, expire: f + 1e3 * e.cachetime };
|
||||
wx.setStorageSync(u, r);
|
||||
}
|
||||
}),
|
||||
_defineProperty(t, "fail", function (t) {
|
||||
wx.hideNavigationBarLoading(), wx.hideLoading();
|
||||
var n = require("md5.js")(i),
|
||||
a = wx.getStorageSync(n);
|
||||
if (a && a.data)
|
||||
return (
|
||||
e.success && "function" == typeof e.success && e.success(a),
|
||||
console.log("failreadcache:" + i),
|
||||
!0
|
||||
);
|
||||
e.fail && "function" == typeof e.fail && e.fail(t);
|
||||
}),
|
||||
_defineProperty(t, "complete", function (t) {
|
||||
e.complete && "function" == typeof e.complete && e.complete(t);
|
||||
}),
|
||||
t)
|
||||
}),
|
||||
_defineProperty(t, "fail", function (t) {
|
||||
wx.hideNavigationBarLoading(), wx.hideLoading();
|
||||
var n = require("md5.js")(i),
|
||||
a = wx.getStorageSync(n);
|
||||
if (a && a.data)
|
||||
return (
|
||||
e.success && "function" == typeof e.success && e.success(a),
|
||||
console.log("failreadcache:" + i),
|
||||
!0
|
||||
);
|
||||
e.fail && "function" == typeof e.fail && e.fail(t);
|
||||
}),
|
||||
_defineProperty(t, "complete", function (t) {
|
||||
e.complete && "function" == typeof e.complete && e.complete(t);
|
||||
}),
|
||||
t)
|
||||
);
|
||||
},
|
||||
getWe7User: function (e, t) {
|
||||
@@ -213,10 +206,7 @@
|
||||
cachetime: 0,
|
||||
showLoading: !1,
|
||||
success: function (t) {
|
||||
t.data.errno ||
|
||||
((n.sessionid = t.data.data.sessionid),
|
||||
(n.memberInfo = t.data.data.userinfo),
|
||||
wx.setStorageSync("userInfo", n)),
|
||||
t.data.code == 200 || ((n.sessionid = t.data.data.sessionid), (n.memberInfo = t.data.data.userinfo), wx.setStorageSync("userInfo", n)),
|
||||
"function" == typeof e && e(n);
|
||||
},
|
||||
});
|
||||
@@ -237,9 +227,9 @@
|
||||
header: { "content-type": "application/x-www-form-urlencoded" },
|
||||
cachetime: 0,
|
||||
success: function (e) {
|
||||
e.data.errno ||
|
||||
e.data.code == 200 ||
|
||||
((n.memberInfo = e.data.data),
|
||||
wx.setStorageSync("userInfo", n)),
|
||||
wx.setStorageSync("userInfo", n)),
|
||||
"function" == typeof t && t(n);
|
||||
},
|
||||
});
|
||||
@@ -251,9 +241,7 @@
|
||||
cachetime: 0,
|
||||
showLoading: !1,
|
||||
success: function (t) {
|
||||
t.data.errno
|
||||
? "function" == typeof e.fail && e.fail()
|
||||
: "function" == typeof e.success && e.success();
|
||||
t.data.code == 201 ? "function" == typeof e.fail && e.fail() : "function" == typeof e.success && e.success();
|
||||
},
|
||||
fail: function () {
|
||||
"function" == typeof e.fail && e.fail();
|
||||
@@ -262,47 +250,47 @@
|
||||
},
|
||||
getUserInfo: function (e, t) {
|
||||
var n = function () {
|
||||
console.log("start login"),
|
||||
wx.login({
|
||||
success: function (n) {
|
||||
util.getWe7User(function (n) {
|
||||
t
|
||||
? util.upadteUser(t, function (t) {
|
||||
"function" == typeof e && e(t);
|
||||
})
|
||||
: wx.canIUse("getUserInfo")
|
||||
console.log("start login"),
|
||||
wx.login({
|
||||
success: function (n) {
|
||||
util.getWe7User(function (n) {
|
||||
t
|
||||
? util.upadteUser(t, function (t) {
|
||||
"function" == typeof e && e(t);
|
||||
})
|
||||
: wx.canIUse("getUserInfo")
|
||||
? wx.getUserInfo({
|
||||
withCredentials: !0,
|
||||
success: function (t) {
|
||||
util.upadteUser(t, function (t) {
|
||||
"function" == typeof e && e(t);
|
||||
});
|
||||
},
|
||||
fail: function () {},
|
||||
})
|
||||
withCredentials: !0,
|
||||
success: function (t) {
|
||||
util.upadteUser(t, function (t) {
|
||||
"function" == typeof e && e(t);
|
||||
});
|
||||
},
|
||||
fail: function () { },
|
||||
})
|
||||
: "function" == typeof e && e(n);
|
||||
}, n.code);
|
||||
},
|
||||
fail: function () {},
|
||||
});
|
||||
},
|
||||
}, n.code);
|
||||
},
|
||||
fail: function () { },
|
||||
});
|
||||
},
|
||||
a = wx.getStorageSync("userInfo") || {};
|
||||
a.sessionid
|
||||
? util.checkSession({
|
||||
success: function () {
|
||||
t
|
||||
? util.upadteUser(t, function (t) {
|
||||
"function" == typeof e && e(t);
|
||||
})
|
||||
: "function" == typeof e && e(a);
|
||||
},
|
||||
fail: function () {
|
||||
(a.sessionid = ""),
|
||||
console.log("relogin"),
|
||||
wx.removeStorageSync("userInfo"),
|
||||
n();
|
||||
},
|
||||
})
|
||||
success: function () {
|
||||
t
|
||||
? util.upadteUser(t, function (t) {
|
||||
"function" == typeof e && e(t);
|
||||
})
|
||||
: "function" == typeof e && e(a);
|
||||
},
|
||||
fail: function () {
|
||||
(a.sessionid = ""),
|
||||
console.log("relogin"),
|
||||
wx.removeStorageSync("userInfo"),
|
||||
n();
|
||||
},
|
||||
})
|
||||
: n();
|
||||
},
|
||||
navigateBack: function (e) {
|
||||
@@ -337,7 +325,7 @@
|
||||
if (
|
||||
("object" == (void 0 === e ? "undefined" : _typeof(e)) &&
|
||||
((t = e.redirect), (n = e.type), (e = e.title)),
|
||||
t)
|
||||
t)
|
||||
) {
|
||||
var a = t.substring(0, 9),
|
||||
r = "",
|
||||
@@ -345,33 +333,33 @@
|
||||
"navigate:" == a
|
||||
? ((i = "navigateTo"), (r = t.substring(9)))
|
||||
: "redirect:" == a
|
||||
? ((i = "redirectTo"), (r = t.substring(9)))
|
||||
: ((r = t), (i = "redirectTo"));
|
||||
? ((i = "redirectTo"), (r = t.substring(9)))
|
||||
: ((r = t), (i = "redirectTo"));
|
||||
}
|
||||
console.log(r),
|
||||
n || (n = "success"),
|
||||
"success" == n
|
||||
? wx.showToast({
|
||||
title: e,
|
||||
icon: "success",
|
||||
duration: 2e3,
|
||||
mask: !!r,
|
||||
complete: function () {
|
||||
r &&
|
||||
setTimeout(function () {
|
||||
wx[i]({ url: r });
|
||||
}, 1800);
|
||||
},
|
||||
})
|
||||
title: e,
|
||||
icon: "success",
|
||||
duration: 2e3,
|
||||
mask: !!r,
|
||||
complete: function () {
|
||||
r &&
|
||||
setTimeout(function () {
|
||||
wx[i]({ url: r });
|
||||
}, 1800);
|
||||
},
|
||||
})
|
||||
: "error" == n &&
|
||||
wx.showModal({
|
||||
title: "温馨提醒",
|
||||
content: e,
|
||||
showCancel: !1,
|
||||
complete: function () {
|
||||
r && wx[i]({ url: r });
|
||||
},
|
||||
});
|
||||
wx.showModal({
|
||||
title: "温馨提醒",
|
||||
content: e,
|
||||
showCancel: !1,
|
||||
complete: function () {
|
||||
r && wx[i]({ url: r });
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
(util.user = util.getUserInfo),
|
||||
@@ -427,33 +415,33 @@
|
||||
a = ["日", "一", "二", "三", "四", "五", "六"];
|
||||
return (n = (n = (n = (n = (n = (n = (n = (n = (n = (n = (n = (n =
|
||||
n.replace(/yyyy|YYYY/, t.getFullYear())).replace(
|
||||
/yy|YY/,
|
||||
t.getYear() % 100 > 9
|
||||
? (t.getYear() % 100).toString()
|
||||
: "0" + (t.getYear() % 100)
|
||||
)).replace(
|
||||
/MM/,
|
||||
t.getMonth() > 9 ? t.getMonth() + 1 : "0" + (t.getMonth() + 1)
|
||||
)).replace(/M/g, t.getMonth())).replace(
|
||||
/w|W/g,
|
||||
a[t.getDay()]
|
||||
)).replace(
|
||||
/dd|DD/,
|
||||
t.getDate() > 9 ? t.getDate().toString() : "0" + t.getDate()
|
||||
)).replace(/d|D/g, t.getDate())).replace(
|
||||
/hh|HH/,
|
||||
t.getHours() > 9 ? t.getHours().toString() : "0" + t.getHours()
|
||||
)).replace(/h|H/g, t.getHours())).replace(
|
||||
/mm/,
|
||||
t.getMinutes() > 9
|
||||
? t.getMinutes().toString()
|
||||
: "0" + t.getMinutes()
|
||||
)).replace(/m/g, t.getMinutes())).replace(
|
||||
/ss|SS/,
|
||||
t.getSeconds() > 9
|
||||
? t.getSeconds().toString()
|
||||
: "0" + t.getSeconds()
|
||||
)).replace(/s|S/g, t.getSeconds());
|
||||
/yy|YY/,
|
||||
t.getYear() % 100 > 9
|
||||
? (t.getYear() % 100).toString()
|
||||
: "0" + (t.getYear() % 100)
|
||||
)).replace(
|
||||
/MM/,
|
||||
t.getMonth() > 9 ? t.getMonth() + 1 : "0" + (t.getMonth() + 1)
|
||||
)).replace(/M/g, t.getMonth())).replace(
|
||||
/w|W/g,
|
||||
a[t.getDay()]
|
||||
)).replace(
|
||||
/dd|DD/,
|
||||
t.getDate() > 9 ? t.getDate().toString() : "0" + t.getDate()
|
||||
)).replace(/d|D/g, t.getDate())).replace(
|
||||
/hh|HH/,
|
||||
t.getHours() > 9 ? t.getHours().toString() : "0" + t.getHours()
|
||||
)).replace(/h|H/g, t.getHours())).replace(
|
||||
/mm/,
|
||||
t.getMinutes() > 9
|
||||
? t.getMinutes().toString()
|
||||
: "0" + t.getMinutes()
|
||||
)).replace(/m/g, t.getMinutes())).replace(
|
||||
/ss|SS/,
|
||||
t.getSeconds() > 9
|
||||
? t.getSeconds().toString()
|
||||
: "0" + t.getSeconds()
|
||||
)).replace(/s|S/g, t.getSeconds());
|
||||
}),
|
||||
(this.dateAdd = function (e, t, n) {
|
||||
switch (((n = arguments[2] || new Date()), e)) {
|
||||
@@ -573,10 +561,10 @@
|
||||
return 4 == t || 6 == t || 9 == t || 11 == t
|
||||
? "30"
|
||||
: 2 == t
|
||||
? (e % 4 == 0 && e % 100 != 0) || e % 400 == 0
|
||||
? "29"
|
||||
: "28"
|
||||
: "31";
|
||||
? (e % 4 == 0 && e % 100 != 0) || e % 400 == 0
|
||||
? "29"
|
||||
: "28"
|
||||
: "31";
|
||||
}),
|
||||
(this.isNumber = function (e) {
|
||||
return /^\d+$/g.test(e);
|
||||
|
Reference in New Issue
Block a user