修改功能,现已测试注册登录忘记密码
This commit is contained in:
+12
-17
@@ -119,7 +119,6 @@
|
||||
let layerInstance = null;
|
||||
let currentCaptchaId = "";
|
||||
let currentVerifyType = "captcha";
|
||||
let currentSlideToken = "";
|
||||
let currentSlideUuid = "";
|
||||
let currentSlideX = 0;
|
||||
|
||||
@@ -149,7 +148,6 @@
|
||||
|
||||
function refreshCaptcha() {
|
||||
currentCaptchaId = "";
|
||||
currentSlideToken = "";
|
||||
currentSlideUuid = "";
|
||||
currentSlideX = 0;
|
||||
$("#captchaId").val("");
|
||||
@@ -193,9 +191,6 @@
|
||||
function completeSlideCaptcha(result) {
|
||||
const data = result || {};
|
||||
const nested = data.data || {};
|
||||
currentSlideToken =
|
||||
data.slideToken || data.token || data.verifyToken ||
|
||||
nested.slideToken || nested.token || nested.verifyToken || "";
|
||||
currentSlideUuid =
|
||||
data.slideUuid || data.uuid || nested.slideUuid || nested.uuid || "";
|
||||
currentSlideX =
|
||||
@@ -222,7 +217,6 @@
|
||||
onSuccess: completeSlideCaptcha,
|
||||
onCancel: function () {
|
||||
currentSlideUuid = "";
|
||||
currentSlideToken = "";
|
||||
currentSlideX = 0;
|
||||
},
|
||||
onError: function (error) {
|
||||
@@ -288,7 +282,6 @@
|
||||
}
|
||||
return {
|
||||
verifyType: "slide",
|
||||
slideToken: currentSlideToken,
|
||||
slideUuid: currentSlideUuid,
|
||||
slideX: currentSlideX,
|
||||
};
|
||||
@@ -316,10 +309,8 @@
|
||||
const payload = Object.assign(
|
||||
{
|
||||
grantType: "password",
|
||||
clientId: ApiClient.clientId,
|
||||
client_id: ApiClient.clientId,
|
||||
phoneNumber: $("#phoneInput").val().trim(),
|
||||
password: hex_md5($("#passwordInput").val()),
|
||||
password: hex_md5($("#passwordInput").val().trim()),
|
||||
deviceType: "WEB",
|
||||
},
|
||||
getVerifyParams(false) || {},
|
||||
@@ -332,17 +323,21 @@
|
||||
})
|
||||
.then(function (res) {
|
||||
if (ApiClient.isSuccess(res) && res.data) {
|
||||
localStorage.setItem(
|
||||
"token",
|
||||
JSON.stringify(
|
||||
res.data.token || res.data.access_token || res.data,
|
||||
),
|
||||
);
|
||||
const data = res.data || {};
|
||||
localStorage.setItem("token", data.access_token || data.token || "");
|
||||
localStorage.setItem("userInfo", JSON.stringify(data));
|
||||
sessionStorage.removeItem("authExpiredRedirecting");
|
||||
sessionStorage.removeItem("authExpiredMessage");
|
||||
layerInstance.msg(
|
||||
"登录成功,即将跳转到首页",
|
||||
{ icon: 1, time: 1200 },
|
||||
function () {
|
||||
window.location.href = "index.html";
|
||||
const redirect = new URLSearchParams(window.location.search).get("redirect");
|
||||
window.location.href =
|
||||
redirect ||
|
||||
(typeof CommonUtil !== "undefined"
|
||||
? CommonUtil.siteHref("/index.html")
|
||||
: "index.html");
|
||||
},
|
||||
);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user