522 lines
52 KiB
JavaScript
522 lines
52 KiB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["chunk-73a0f3fa"], { 1644: function(e, t, o) {
|
||
}, "58fb": function(e, t, o) {
|
||
}, "62de": function(e, t, o) {
|
||
"use strict";
|
||
o("8ac4");
|
||
}, 7835: function(e, t, o) {
|
||
"use strict";
|
||
o("1644");
|
||
}, 7972: function(e, t, o) {
|
||
"use strict";
|
||
o("58fb");
|
||
}, "8ac4": function(e, t, o) {
|
||
}, "8d00": function(e, t, o) {
|
||
"use strict";
|
||
o("a321");
|
||
}, "9ed6": function(e, t, o) {
|
||
"use strict";
|
||
o.r(t);
|
||
var a = function() {
|
||
var e2 = this, t2 = e2.$createElement, o2 = e2._self._c || t2;
|
||
return o2("div", { staticStyle: { height: "100vh", width: "100vw", overflow: "hidden" } }, [o2("div", { staticClass: "login-container" }, [o2("div", { staticClass: "loginMain" }, [o2("el-form", { ref: "loginForm", staticClass: "login-form", attrs: { model: e2.loginForm, rules: e2.loginRules, "auto-complete": "on", "label-position": "left" } }, [o2("div", { staticClass: "title-container" }, [o2("h3", { staticClass: "title" }, [e2._v("云物业管理AI运营平台 ")])]), e2._v(" "), o2("div", [o2("el-tabs", { staticClass: "loginTabs", on: { "tab-click": e2.loginTypeChange }, model: { value: e2.activeName, callback: function(t3) {
|
||
e2.activeName = t3;
|
||
}, expression: "activeName" } }, [o2("el-tab-pane", { attrs: { label: "微信扫码", name: "byWechat" } }, [o2("div", { staticClass: "wechat-login-container" }, [o2("div", { staticClass: "qr-code-container" }, [e2.wechatQrCode && !e2.wechatQrCodeExpired ? o2("div", { staticClass: "qr-code-wrapper", on: { click: e2.refreshWechatQrCode } }, [o2("img", { staticClass: "qr-code-image", attrs: { src: e2.wechatQrCode, alt: "微信扫码登录" } }), e2._v(" "), o2("div", { staticClass: "qr-code-tip" }, [e2._v("请使用微信扫描二维码登录")]), e2._v(" "), o2("div", { staticClass: "qr-code-countdown" }, [o2("el-statistic", { attrs: { value: e2.wechatCountdownSeconds, title: "二维码剩余时间", precision: 0, suffix: "秒", "value-style": { color: e2.wechatCountdownSeconds <= 10 ? "#f56c6c" : "#409eff" } } })], 1), e2._v(" "), o2("div", { staticClass: "qr-code-refresh-tip" }, [e2._v("点击刷新二维码")])]) : e2.wechatQrCodeExpired ? o2("div", { staticClass: "qr-code-expired" }, [o2("i", { staticClass: "el-icon-warning-outline" }), e2._v(" "), o2("div", { staticClass: "qr-code-expired-tip" }, [e2._v("二维码已过期")]), e2._v(" "), o2("el-button", { staticClass: "refresh-btn", attrs: { type: "primary", size: "small" }, on: { click: e2.refreshWechatQrCode } }, [e2._v("\n 重新获取二维码\n ")])], 1) : o2("div", { staticClass: "qr-code-loading" }, [o2("i", { staticClass: "el-icon-loading" }), e2._v(" "), o2("div", [e2._v("正在生成二维码...")])])]), e2._v(" "), e2.wechatQrCodeExpired ? e2._e() : o2("div", { staticClass: "wechat-login-tip" }, [o2("i", { staticClass: "el-icon-mobile-phone" }), e2._v(" "), o2("span", [e2._v("请使用微信扫描上方二维码完成登录")])])])]), e2._v(" "), o2("el-tab-pane", { attrs: { label: "验证码", name: "byVerify" } }, [o2("el-form-item", { attrs: { prop: "username" } }, [o2("div", { staticClass: "itemSet" }, [o2("span", { staticClass: "svg-container" }, [o2("svg-icon", { attrs: { "icon-class": "mobile" } })], 1), e2._v(" "), o2("el-input", { ref: "username", attrs: { clearable: "", placeholder: "手机号码", name: "username", type: "text", autocomplete: "off" }, model: { value: e2.loginForm.username, callback: function(t3) {
|
||
e2.$set(e2.loginForm, "username", t3);
|
||
}, expression: "loginForm.username" } })], 1)]), e2._v(" "), o2("div", { staticClass: "verifyContent" }, [e2.verify ? o2("el-form-item", { attrs: { prop: "verifycode" } }, [o2("div", { staticClass: "itemSet" }, [o2("span", { staticClass: "svg-container" }, [o2("svg-icon", { attrs: { "icon-class": "verif" } })], 1), e2._v(" "), o2("el-input", { ref: "verifycode", attrs: { clearable: "", type: "text", maxlength: "4", placeholder: "验证码" }, nativeOn: { keyup: function(t3) {
|
||
return !t3.type.indexOf("key") && e2._k(t3.keyCode, "enter", 13, t3.key, "Enter") ? null : e2.handleLogin(t3);
|
||
} }, model: { value: e2.loginForm.verifycode, callback: function(t3) {
|
||
e2.$set(e2.loginForm, "verifycode", t3);
|
||
}, expression: "loginForm.verifycode" } })], 1)]) : e2._e(), e2._v(" "), o2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], staticClass: "verifyBtn", attrs: { plain: "", disabled: e2.verifyIng }, on: { click: e2.getVerify } }, [e2._v(e2._s(e2.verifyTitle))])], 1), e2._v(" "), o2("div", { staticStyle: { "font-size": "12px", "margin-bottom": "22px" } }, [e2._v("\n *输入验证码进行登录,仅支持中国大陆手机号码\n ")])], 1), e2._v(" "), o2("el-tab-pane", { attrs: { label: "账号密码", name: "byPwd" } }, [o2("el-form-item", { attrs: { prop: "username" } }, [o2("div", { staticClass: "itemSet" }, [o2("span", { staticClass: "svg-container" }, [o2("svg-icon", { attrs: { "icon-class": "user2" } })], 1), e2._v(" "), o2("el-input", { ref: "username", attrs: { clearable: "", placeholder: e2.$t("login.username"), name: "username", type: "text", autocomplete: "off" }, model: { value: e2.loginForm.username, callback: function(t3) {
|
||
e2.$set(e2.loginForm, "username", t3);
|
||
}, expression: "loginForm.username" } })], 1)]), e2._v(" "), o2("el-form-item", { attrs: { prop: "password" } }, [o2("div", { staticClass: "itemSet" }, [o2("span", { staticClass: "svg-container" }, [o2("svg-icon", { attrs: { "icon-class": "lock2" } })], 1), e2._v(" "), o2("el-input", { key: e2.passwordType, ref: "password", attrs: { clearable: "", type: e2.passwordType, placeholder: e2.$t("login.password"), name: "password", autocomplete: "off" }, nativeOn: { keyup: function(t3) {
|
||
return !t3.type.indexOf("key") && e2._k(t3.keyCode, "enter", 13, t3.key, "Enter") ? null : e2.handleLogin(t3);
|
||
} }, model: { value: e2.loginForm.password, callback: function(t3) {
|
||
e2.$set(e2.loginForm, "password", t3);
|
||
}, expression: "loginForm.password" } }), e2._v(" "), o2("span", { staticClass: "show-pwd", on: { click: e2.showPwd } }, [o2("svg-icon", { attrs: { "icon-class": "password" === e2.passwordType ? "eye" : "eye-open" } })], 1)], 1)]), e2._v(" "), "byPwd" === e2.activeName ? o2("el-form-item", { staticClass: "captcha-form-item", attrs: { prop: "captchaCode" } }, [o2("div", { staticClass: "itemSet" }, [o2("span", { staticClass: "svg-container" }, [o2("svg-icon", { attrs: { "icon-class": "lock" } })], 1), e2._v(" "), o2("el-input", { ref: "captchaCode", staticStyle: { width: "60%" }, attrs: { placeholder: "请输入图形验证码", name: "captchaCode", type: "text", autocomplete: "off", maxlength: "4", clearable: "" }, nativeOn: { keyup: function(t3) {
|
||
return !t3.type.indexOf("key") && e2._k(t3.keyCode, "enter", 13, t3.key, "Enter") ? null : e2.handleLogin(t3);
|
||
} }, model: { value: e2.loginForm.captchaCode, callback: function(t3) {
|
||
e2.$set(e2.loginForm, "captchaCode", t3);
|
||
}, expression: "loginForm.captchaCode" } }), e2._v(" "), o2("div", { staticClass: "captcha-container", on: { click: e2.refreshCaptcha } }, [e2.captchaImage ? o2("img", { staticClass: "captcha-image", attrs: { src: e2.captchaImage, alt: "验证码" } }) : o2("div", { staticClass: "captcha-placeholder" }, [e2._v("\n 点击获取验证码\n ")])])], 1), e2._v(" "), o2("div", { staticClass: "captcha-tip" }, [e2._v("验证码不区分大小写")])]) : e2._e(), e2._v(" "), o2("div", { staticStyle: { "text-align": "right", "margin-bottom": "15px" } }, [o2("el-button", { attrs: { type: "text" }, on: { click: function(t3) {
|
||
e2.changePasswordShow = true;
|
||
} } }, [e2._v("忘记密码")])], 1)], 1)], 1)], 1), e2._v(" "), o2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], staticClass: "loginBtn", attrs: { loading: e2.loading, size: "medium" }, nativeOn: { click: function(t3) {
|
||
return t3.preventDefault(), e2.handleLogin(t3);
|
||
} } }, [e2._v("\n " + e2._s(e2.$t("login.logIn")) + "\n ")])], 1)], 1), e2._v(" "), o2("div", { staticClass: "CopyRight" }, [e2._v("Power by Community Cloud Technology")]), e2._v(" "), o2("el-dialog", { attrs: { "custom-class": "r2Dialog", title: "选择角色", visible: e2.selectRolesDialog, "close-on-click-modal": false, width: "560px" }, on: { "update:visible": function(t3) {
|
||
e2.selectRolesDialog = t3;
|
||
} } }, [o2("div", { staticClass: "roleWrap" }, [o2("div", { directives: [{ name: "show", rawName: "v-show", value: e2.roleDivShow, expression: "roleDivShow" }], staticClass: "roleDiv el-icon-warning" }, [e2._v("\n 请选择所在的公司及岗位角色\n ")]), e2._v(" "), o2("ul", { staticClass: "roleTree" }, e2._l(e2.roleList, (function(t3) {
|
||
return o2("li", { key: t3.id }, [o2("span", [e2._v(e2._s(t3[0].orgName))]), e2._v(" "), e2._l(t3, (function(t4, a2) {
|
||
return o2("ul", { key: a2, staticClass: "roleTreeChild" }, [o2("li", { on: { click: function(o3) {
|
||
return e2.handleSelectedRole(t4);
|
||
} } }, [o2("span", { class: { checkColor: t4.id === e2.selectRole.id } }, [e2._v(e2._s(t4.roleName))]), e2._v(" "), o2("span", { directives: [{ name: "show", rawName: "v-show", value: t4.id === e2.selectRole.id, expression: "childItem.id === selectRole.id" }] }, [o2("i", { staticClass: "checkColor el-icon-check" })])])]);
|
||
}))], 2);
|
||
})), 0), e2._v(" "), o2("div", { staticClass: "btnWrap" }, [o2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], staticClass: "commitDialogBtn", attrs: { disabled: e2.btnDisabled }, on: { click: function(t3) {
|
||
return e2.submiLogInInfo();
|
||
} } }, [e2._v("确定")])], 1)])]), e2._v(" "), o2("Forget", { attrs: { show: e2.forgetShow }, on: { callClose: function(t3) {
|
||
e2.forgetShow = false;
|
||
} } }), e2._v(" "), o2("ChangePassword", { attrs: { show: e2.changePasswordShow }, on: { callClose: function(t3) {
|
||
e2.changePasswordShow = false;
|
||
} } })], 1), e2._v(" "), o2("el-dialog", { staticClass: "change-password-dialog", attrs: { title: "密码过于简单,请及时修改密码,有利于账号安全", visible: e2.showChangePasswordDialog, "close-on-click-modal": false, "close-on-press-escape": false, "show-close": false, width: "500px", center: "" }, on: { "update:visible": function(t3) {
|
||
e2.showChangePasswordDialog = t3;
|
||
} } }, [o2("el-form", { ref: "changePasswordForm", attrs: { model: e2.changePasswordForm, rules: e2.changePasswordRules, "label-width": "100px" } }, [o2("el-form-item", { attrs: { label: "手机号", prop: "mobile" } }, [o2("el-input", { attrs: { type: "text", clearable: "", placeholder: "请输入手机号", autocomplete: "off", name: "force-change-password-mobile" }, model: { value: e2.changePasswordForm.mobile, callback: function(t3) {
|
||
e2.$set(e2.changePasswordForm, "mobile", t3);
|
||
}, expression: "changePasswordForm.mobile" } })], 1), e2._v(" "), o2("el-form-item", { attrs: { label: "验证码", prop: "smscode" } }, [o2("div", { staticClass: "code-btn" }, [o2("el-input", { attrs: { type: "text", maxlength: "4", clearable: "", placeholder: "请输入验证码", autocomplete: "off", name: "force-change-password-smscode" }, model: { value: e2.changePasswordForm.smscode, callback: function(t3) {
|
||
e2.$set(e2.changePasswordForm, "smscode", t3);
|
||
}, expression: "changePasswordForm.smscode" } }), e2._v(" "), o2("el-button", { attrs: { type: "primary", disabled: e2.changePasswordVerifyIng }, on: { click: e2.getChangePasswordVerify } }, [e2._v("\n " + e2._s(e2.changePasswordVerifyTitle) + "\n ")])], 1)]), e2._v(" "), o2("el-form-item", { staticClass: "password-form-item", attrs: { label: "新密码", required: "", prop: "newPassword" } }, [o2("div", { staticClass: "password-input-wrapper" }, [o2("el-input", { attrs: { type: "password", clearable: "", placeholder: "请输入新密码", "show-password": "", autocomplete: "new-password", name: "force-change-password-new" }, model: { value: e2.changePasswordForm.newPassword, callback: function(t3) {
|
||
e2.$set(e2.changePasswordForm, "newPassword", t3);
|
||
}, expression: "changePasswordForm.newPassword" } }), e2._v(" "), o2("el-tooltip", { attrs: { placement: "top" } }, [o2("div", { attrs: { slot: "content" }, slot: "content" }, [o2("div", [e2._v("密码复杂度要求:")]), e2._v(" "), o2("div", [e2._v("• 至少8位字符")]), e2._v(" "), o2("div", [e2._v("• 包含大写字母 (A-Z)")]), e2._v(" "), o2("div", [e2._v("• 包含小写字母 (a-z)")]), e2._v(" "), o2("div", [e2._v("• 包含数字 (0-9)")]), e2._v(" "), o2("div", [e2._v("• 包含特殊字符 (!@#$%^&*等)")])]), e2._v(" "), o2("span", { staticClass: "password-tip-icon" }, [o2("i", { staticClass: "el-icon-question itemcursor" })])])], 1)]), e2._v(" "), o2("el-form-item", { attrs: { label: "确认密码", prop: "confirmNewPassword" } }, [o2("el-input", { attrs: { type: "password", clearable: "", placeholder: "请确认密码", "show-password": "", autocomplete: "new-password", name: "force-change-password-confirm" }, model: { value: e2.changePasswordForm.confirmNewPassword, callback: function(t3) {
|
||
e2.$set(e2.changePasswordForm, "confirmNewPassword", t3);
|
||
}, expression: "changePasswordForm.confirmNewPassword" } })], 1)], 1), e2._v(" "), o2("div", { staticClass: "change-password-info" }, [o2("i", { staticClass: "el-icon-info" }), e2._v("\n 修改密码需要验证手机号,验证通过后可设置新密码!\n ")]), e2._v(" "), o2("div", { staticClass: "dialog-footer", attrs: { slot: "footer" }, slot: "footer" }, [o2("el-button", { attrs: { loading: e2.changePasswordLoading, type: "primary" }, on: { click: e2.handleChangePassword } }, [e2._v("\n 确认修改\n ")])], 1)], 1), e2._v(" "), o2("el-dialog", { staticClass: "wechat-bind-dialog", attrs: { title: "首次扫码登录需绑定账号密码", visible: e2.wechatBindDialog, "close-on-click-modal": false, "close-on-press-escape": false, "show-close": false, width: "40%", center: "" } }, [o2("el-form", { ref: "wechatBindForm", attrs: { model: e2.wechatBindForm, rules: e2.loginRules, "label-width": "100px" } }, [o2("el-form-item", { attrs: { label: "手机号", prop: "username" } }, [o2("el-input", { attrs: { type: "text", clearable: "", placeholder: "请输入手机号", autocomplete: "off", name: "wechat-bind-username" }, model: { value: e2.wechatBindForm.username, callback: function(t3) {
|
||
e2.$set(e2.wechatBindForm, "username", t3);
|
||
}, expression: "wechatBindForm.username" } })], 1), e2._v(" "), o2("el-form-item", { attrs: { label: "密码", prop: "password" } }, [o2("el-input", { attrs: { type: "password", clearable: "", placeholder: "请输入密码", "show-password": "", autocomplete: "new-password", name: "wechat-bind-password" }, model: { value: e2.wechatBindForm.password, callback: function(t3) {
|
||
e2.$set(e2.wechatBindForm, "password", t3);
|
||
}, expression: "wechatBindForm.password" } })], 1), e2._v(" "), o2("el-form-item", { attrs: { label: "验证码", prop: "captchaCode" } }, [o2("div", { staticClass: "code-btn" }, [o2("el-input", { staticStyle: { width: "60%" }, attrs: { type: "text", maxlength: "4", clearable: "", placeholder: "请输入图形验证码", autocomplete: "off", name: "wechat-bind-captcha" }, model: { value: e2.wechatBindForm.captchaCode, callback: function(t3) {
|
||
e2.$set(e2.wechatBindForm, "captchaCode", t3);
|
||
}, expression: "wechatBindForm.captchaCode" } }), e2._v(" "), o2("div", { staticClass: "captcha-container", on: { click: e2.refreshWechatBindCaptcha } }, [e2.wechatBindCaptchaImage ? o2("img", { staticClass: "captcha-image", attrs: { src: e2.wechatBindCaptchaImage, alt: "验证码" } }) : o2("div", { staticClass: "captcha-placeholder" }, [e2._v("点击获取验证码")])])], 1), e2._v(" "), o2("div", { staticClass: "captcha-tip" }, [e2._v("验证码不区分大小写")])])], 1), e2._v(" "), o2("div", { staticClass: "wechat-bind-info" }, [o2("i", { staticClass: "el-icon-info" }), e2._v("\n 首次使用微信扫码登录需要绑定您的账号密码,绑定后可直接使用微信扫码登录!\n ")]), e2._v(" "), o2("div", { staticClass: "dialog-footer", attrs: { slot: "footer" }, slot: "footer" }, [o2("el-button", { attrs: { loading: e2.wechatBindLoading, type: "primary" }, on: { click: e2.handleWechatBindLogin } }, [e2._v("\n 确认绑定\n ")])], 1)], 1)], 1);
|
||
}, s = [], n = o("1131"), i = function() {
|
||
var e2 = this, t2 = e2.$createElement, o2 = e2._self._c || t2;
|
||
return o2("div", [o2("el-dialog", { attrs: { title: "忘记密码", visible: e2.show, "close-on-click-modal": false, width: "25%", "before-close": e2.handleClose }, on: { "update:visible": function(t3) {
|
||
e2.show = t3;
|
||
} } }, [o2("el-form", { ref: "form", attrs: { model: e2.form, rules: e2.rules, "label-width": "110px" } }, [o2("el-form-item", { attrs: { label: "账号/手机号", prop: "mobile" } }, [o2("el-input", { attrs: { type: "text", clearable: "", placeholder: "账号/手机号", autocomplete: "off", name: "forget-password-mobile" }, model: { value: e2.form.mobile, callback: function(t3) {
|
||
e2.$set(e2.form, "mobile", t3);
|
||
}, expression: "form.mobile" } })], 1), e2._v(" "), o2("el-form-item", { attrs: { label: "验证码", prop: "smscode" } }, [o2("div", { staticClass: "code-btn" }, [o2("el-input", { attrs: { placeholder: "短息验证码", type: "text", maxlength: "4", clearable: "", autocomplete: "off", name: "forget-password-smscode" }, model: { value: e2.form.smscode, callback: function(t3) {
|
||
e2.$set(e2.form, "smscode", t3);
|
||
}, expression: "form.smscode" } }), e2._v(" "), o2("el-button", { attrs: { type: "primary", disabled: e2.verifyIng }, on: { click: e2.getVerify } }, [e2._v(e2._s(e2.verifyTitle))])], 1)]), e2._v(" "), o2("el-form-item", [o2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], attrs: { type: "primary" }, on: { click: e2.submitForm } }, [e2._v("确认提交")])], 1)], 1), e2._v(" "), o2("div", { staticClass: "forget-info" }, [o2("i", { staticClass: "el-icon-info" }), e2._v(" 忘记密码验证通过后将重置密码,重置后的密码为手机号后6位!\n ")])], 1)], 1);
|
||
}, r = [], c = o("21bf"), l = { props: { show: { type: Boolean, default: false } }, data: function() {
|
||
var e2 = function(e3, t3, o2) {
|
||
"" === t3 ? o2(new Error("请输入短信验证码")) : o2();
|
||
}, t2 = function(e3, t3, o2) {
|
||
var a2 = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
||
"" === t3 ? o2(new Error("请输入账号(手机号)")) : a2.test(t3) ? o2() : o2(new Error("账号(手机号)输入有误"));
|
||
};
|
||
return { timer: null, count: "", verifyTitle: "获取验证码", verifyIng: false, savekey: "", form: { mobile: "", smscode: "" }, rules: { mobile: [{ required: true, validator: t2, trigger: "blur" }], smscode: [{ required: true, validator: e2, trigger: "blur" }] } };
|
||
}, watch: { show: function(e2) {
|
||
var t2 = this;
|
||
e2 && this.$nextTick((function() {
|
||
t2.form = { mobile: "", smscode: "" };
|
||
}));
|
||
} }, mounted: function() {
|
||
}, methods: { getVerify: function() {
|
||
var e2 = this, t2 = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
||
if (!this.form.mobile) return this.$message("请输入账号/手机号"), false;
|
||
if (!t2.test(this.form.mobile)) return this.$message("账号/手机号输入有误"), false;
|
||
var o2 = "code".concat(Date.now()).concat(this.form.mobile), a2 = { key: o2, mobile: this.form.mobile, type: 1 };
|
||
Object(c["b"])(a2).then((function(t3) {
|
||
0 == t3.code && (e2.$message({ message: "短信发送成功,请查看!", type: "success" }), e2.savekey = o2, e2.codeTime());
|
||
}));
|
||
}, codeTime: function() {
|
||
var e2 = this, t2 = 60;
|
||
this.count = t2, this.verifyIng = true, this.verifyTitle = "".concat(this.count, "秒后再次获取"), this.timer || (this.timer = setInterval((function() {
|
||
e2.count > 1 && e2.count <= t2 ? (e2.count--, e2.verifyTitle = "".concat(e2.count, "秒后再次获取")) : (e2.verifyIng = false, clearInterval(e2.timer), e2.timer = null, e2.verifyTitle = "获取验证码");
|
||
}), 1e3));
|
||
}, submitForm: function() {
|
||
var e2 = this;
|
||
this.$refs.form.validate((function(t2) {
|
||
if (t2) {
|
||
e2.form.mobile;
|
||
var o2 = { mobile: e2.form.mobile, smscode: e2.form.smscode, newPassword: e2.getLastSixChars(e2.form.mobile), key: e2.savekey };
|
||
Object(c["j"])(o2).then((function(t3) {
|
||
e2.$message({ type: "success", message: "密码重置成功" }), e2.handleClose();
|
||
}));
|
||
}
|
||
}));
|
||
}, getLastSixChars: function(e2) {
|
||
return e2.slice(-6);
|
||
}, handleClose: function() {
|
||
this.$refs["form"].resetFields(), this.verifyIng = false, clearInterval(this.timer), this.timer = null, this.verifyTitle = "获取验证码", this.$emit("callClose");
|
||
} } }, d = l, h = (o("62de"), o("829d")), m = Object(h["a"])(d, i, r, false, null, "122c312d", null), u = m.exports, f = function() {
|
||
var e2 = this, t2 = e2.$createElement, o2 = e2._self._c || t2;
|
||
return o2("div", [o2("el-dialog", { attrs: { title: "修改密码", visible: e2.show, "close-on-click-modal": false, width: "30%", "before-close": e2.handleClose }, on: { "update:visible": function(t3) {
|
||
e2.show = t3;
|
||
} } }, [o2("el-form", { ref: "form", attrs: { model: e2.form, rules: e2.rules, "label-width": "100px" } }, [o2("el-form-item", { attrs: { label: "手机号", prop: "mobile" } }, [o2("el-input", { attrs: { type: "text", clearable: "", placeholder: "请输入手机号", autocomplete: "off", name: "change-password-mobile" }, model: { value: e2.form.mobile, callback: function(t3) {
|
||
e2.$set(e2.form, "mobile", t3);
|
||
}, expression: "form.mobile" } })], 1), e2._v(" "), o2("el-form-item", { attrs: { label: "验证码", prop: "smscode" } }, [o2("div", { staticClass: "code-btn" }, [o2("el-input", { attrs: { type: "text", maxlength: "4", clearable: "", placeholder: "请输入验证码", autocomplete: "off", name: "change-password-smscode" }, model: { value: e2.form.smscode, callback: function(t3) {
|
||
e2.$set(e2.form, "smscode", t3);
|
||
}, expression: "form.smscode" } }), e2._v(" "), o2("el-button", { attrs: { type: "primary", disabled: e2.verifyIng }, on: { click: e2.getVerify } }, [e2._v(e2._s(e2.verifyTitle))])], 1)]), e2._v(" "), o2("el-form-item", { attrs: { label: "新密码", prop: "newPassword" } }, [o2("div", { staticClass: "password-input-row" }, [o2("el-input", { attrs: { type: "password", clearable: "", placeholder: "请输入新密码", "show-password": "", autocomplete: "new-password", name: "change-password-new" }, model: { value: e2.form.newPassword, callback: function(t3) {
|
||
e2.$set(e2.form, "newPassword", t3);
|
||
}, expression: "form.newPassword" } }), e2._v(" "), o2("el-tooltip", { attrs: { placement: "top" } }, [o2("div", { attrs: { slot: "content" }, slot: "content" }, [o2("div", [o2("div", [e2._v("密码复杂度要求:")]), e2._v(" "), o2("div", [e2._v("• 至少8位字符")]), e2._v(" "), o2("div", [e2._v("• 包含大写字母 (A-Z)")]), e2._v(" "), o2("div", [e2._v("• 包含小写字母 (a-z)")]), e2._v(" "), o2("div", [e2._v("• 包含数字 (0-9)")]), e2._v(" "), o2("div", [e2._v("• 包含特殊字符 (!@#$%^&*等)")])])]), e2._v(" "), o2("span", [o2("i", { staticClass: "el-icon-question itemcursor" })])])], 1)]), e2._v(" "), o2("el-form-item", { attrs: { label: "确认密码", prop: "confirmNewPassword" } }, [o2("el-input", { attrs: { type: "password", clearable: "", placeholder: "请确认密码", "show-password": "", autocomplete: "new-password", name: "change-password-confirm" }, model: { value: e2.form.confirmNewPassword, callback: function(t3) {
|
||
e2.$set(e2.form, "confirmNewPassword", t3);
|
||
}, expression: "form.confirmNewPassword" } })], 1), e2._v(" "), o2("el-form-item", [o2("el-button", { directives: [{ name: "points", rawName: "v-points", value: 500, expression: "500" }], attrs: { type: "primary" }, on: { click: e2.submitForm } }, [e2._v("确认修改")])], 1)], 1), e2._v(" "), o2("div", { staticClass: "change-password-info" }, [o2("i", { staticClass: "el-icon-info" }), e2._v("\n 修改密码需要验证手机号,验证通过后可设置新密码!\n ")])], 1)], 1);
|
||
}, g = [], p = { props: { show: { type: Boolean, default: false } }, data: function() {
|
||
var e2 = this, t2 = function(e3, t3, o3) {
|
||
var a3 = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
|
||
"" === t3 ? o3(new Error("请输入手机号")) : a3.test(t3) ? o3() : o3(new Error("手机号格式不正确"));
|
||
}, o2 = function(e3, t3, o3) {
|
||
"" === t3 ? o3(new Error("请输入验证码")) : o3();
|
||
}, a2 = function(e3, t3, o3) {
|
||
"" === t3 ? o3(new Error("请输入新密码")) : t3.length < 8 ? o3(new Error("密码长度至少8位")) : /(?=.*[a-z])/.test(t3) ? /(?=.*[A-Z])/.test(t3) ? /(?=.*\d)/.test(t3) ? /(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])/.test(t3) ? o3() : o3(new Error("密码必须包含特殊字符")) : o3(new Error("密码必须包含数字")) : o3(new Error("密码必须包含大写字母")) : o3(new Error("密码必须包含小写字母"));
|
||
}, s2 = function(t3, o3, a3) {
|
||
"" === o3 ? a3(new Error("请再次输入密码")) : o3 !== e2.form.newPassword ? a3(new Error("两次输入密码不一致!")) : o3.length < 8 ? a3(new Error("密码长度至少8位")) : /(?=.*[a-z])/.test(o3) ? /(?=.*[A-Z])/.test(o3) ? /(?=.*\d)/.test(o3) ? /(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])/.test(o3) ? a3() : a3(new Error("密码必须包含特殊字符")) : a3(new Error("密码必须包含数字")) : a3(new Error("密码必须包含大写字母")) : a3(new Error("密码必须包含小写字母"));
|
||
};
|
||
return { timer: null, count: "", verifyTitle: "获取验证码", verifyIng: false, savekey: "", form: { mobile: "", newPassword: "", confirmNewPassword: "", smscode: "" }, rules: { mobile: [{ required: true, validator: t2, trigger: "blur" }], smscode: [{ validator: o2, trigger: "blur" }], newPassword: [{ validator: a2, trigger: "blur" }], confirmNewPassword: [{ validator: s2, trigger: "blur" }] } };
|
||
}, watch: { show: function(e2) {
|
||
var t2 = this;
|
||
e2 && this.$nextTick((function() {
|
||
t2.form = { mobile: "", newPassword: "", confirmNewPassword: "", smscode: "" };
|
||
}));
|
||
} }, methods: { maskPhoneNumber: function(e2) {
|
||
return e2 ? e2.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : "";
|
||
}, getVerify: function() {
|
||
var e2 = this;
|
||
if (this.form.mobile) {
|
||
var t2 = "code".concat(Date.now()).concat(this.form.mobile), o2 = { key: t2, mobile: this.form.mobile, type: 1 };
|
||
Object(c["b"])(o2).then((function(o3) {
|
||
0 == o3.code && (e2.$message({ message: "短信发送成功,请查看!", type: "success" }), e2.savekey = t2, e2.codeTime());
|
||
}));
|
||
} else this.$message({ message: "请先输入手机号", type: "error" });
|
||
}, codeTime: function() {
|
||
var e2 = this, t2 = 60;
|
||
this.count = t2, this.verifyIng = true, this.verifyTitle = "".concat(this.count, "秒后再次获取"), this.timer || (this.timer = setInterval((function() {
|
||
e2.count > 1 && e2.count <= t2 ? (e2.count--, e2.verifyTitle = "".concat(e2.count, "秒后再次获取")) : (e2.verifyIng = false, clearInterval(e2.timer), e2.timer = null, e2.verifyTitle = "获取验证码");
|
||
}), 1e3));
|
||
}, submitForm: function() {
|
||
var e2 = this;
|
||
this.$refs.form.validate((function(t2) {
|
||
if (t2) {
|
||
var o2 = { mobile: e2.form.mobile, smscode: e2.form.smscode, newPassword: e2.form.confirmNewPassword, key: e2.savekey };
|
||
Object(c["j"])(o2).then((function(t3) {
|
||
e2.$message({ type: "success", message: "密码修改成功!" }), e2.handleClose();
|
||
}));
|
||
}
|
||
}));
|
||
}, psdSafety: function() {
|
||
this.$alert('\n <div style="text-align: left; line-height: 1.6;">\n <h4>密码安全策略</h4>\n <p><strong>密码复杂度要求:</strong></p>\n <ul>\n <li>至少8位字符</li>\n <li>包含大写字母 (A-Z)</li>\n <li>包含小写字母 (a-z)</li>\n <li>包含数字 (0-9)</li>\n <li>包含特殊字符 (!@#$%^&*等)</li>\n </ul>\n <p><strong>安全建议:</strong></p>\n <ul>\n <li>不要使用个人信息作为密码</li>\n <li>定期更换密码</li>\n <li>不要在多个账户使用相同密码</li>\n <li>避免使用常见密码模式</li>\n </ul>\n </div>\n ', "密码安全策略", { dangerouslyUseHTMLString: true, confirmButtonText: "我知道了" });
|
||
}, handleClose: function() {
|
||
this.$refs["form"].resetFields(), this.verifyIng = false, clearInterval(this.timer), this.timer = null, this.verifyTitle = "获取验证码", this.$emit("callClose");
|
||
} } }, w = p, v = (o("7972"), Object(h["a"])(w, f, g, false, null, "976a27a0", null)), b = v.exports, y = o("8c92"), C = o.n(y), I = o("c24f"), P = o("2b74"), _ = o("ed08");
|
||
function x(e2) {
|
||
return x = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e3) {
|
||
return typeof e3;
|
||
} : function(e3) {
|
||
return e3 && "function" == typeof Symbol && e3.constructor === Symbol && e3 !== Symbol.prototype ? "symbol" : typeof e3;
|
||
}, x(e2);
|
||
}
|
||
function k(e2, t2) {
|
||
var o2 = Object.keys(e2);
|
||
if (Object.getOwnPropertySymbols) {
|
||
var a2 = Object.getOwnPropertySymbols(e2);
|
||
t2 && (a2 = a2.filter((function(t3) {
|
||
return Object.getOwnPropertyDescriptor(e2, t3).enumerable;
|
||
}))), o2.push.apply(o2, a2);
|
||
}
|
||
return o2;
|
||
}
|
||
function $(e2) {
|
||
for (var t2 = 1; t2 < arguments.length; t2++) {
|
||
var o2 = null != arguments[t2] ? arguments[t2] : {};
|
||
t2 % 2 ? k(Object(o2), true).forEach((function(t3) {
|
||
F(e2, t3, o2[t3]);
|
||
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(o2)) : k(Object(o2)).forEach((function(t3) {
|
||
Object.defineProperty(e2, t3, Object.getOwnPropertyDescriptor(o2, t3));
|
||
}));
|
||
}
|
||
return e2;
|
||
}
|
||
function F(e2, t2, o2) {
|
||
return (t2 = T(t2)) in e2 ? Object.defineProperty(e2, t2, { value: o2, enumerable: true, configurable: true, writable: true }) : e2[t2] = o2, e2;
|
||
}
|
||
function T(e2) {
|
||
var t2 = S(e2, "string");
|
||
return "symbol" == x(t2) ? t2 : t2 + "";
|
||
}
|
||
function S(e2, t2) {
|
||
if ("object" != x(e2) || !e2) return e2;
|
||
var o2 = e2[Symbol.toPrimitive];
|
||
if (void 0 !== o2) {
|
||
var a2 = o2.call(e2, t2 || "default");
|
||
if ("object" != x(a2)) return a2;
|
||
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||
}
|
||
return ("string" === t2 ? String : Number)(e2);
|
||
}
|
||
var B = { name: "Login", components: { LangSelect: n["a"], Forget: u, ChangePassword: b }, data: function() {
|
||
var e2 = this, t2 = function(e3, t3, o3) {
|
||
t3 ? o3() : o3(new Error("请输入登录账号/手机号"));
|
||
}, o2 = function(e3, t3, o3) {
|
||
t3.length < 6 ? o3(new Error("登录密码为6位及以上")) : o3();
|
||
}, a2 = function(e3, t3, o3) {
|
||
t3 ? 4 != t3.length ? o3(new Error("验证码为4位数")) : o3() : o3(new Error("请输入验证码"));
|
||
}, s2 = function(t3, o3, a3) {
|
||
"byPwd" === e2.activeName ? o3 ? o3.length < 4 ? a3(new Error("图形验证码为4位")) : a3() : a3(new Error("请输入图形验证码")) : a3();
|
||
}, n2 = function(e3) {
|
||
var t3 = /[A-Z]/.test(e3), o3 = /[a-z]/.test(e3), a3 = /\d/.test(e3), s3 = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e3);
|
||
return t3 && o3 && a3 && s3;
|
||
}, i2 = function(e3, t3, o3) {
|
||
"" === t3 ? o3(new Error("请输入新密码")) : t3.length < 8 ? o3(new Error("密码长度至少8位")) : n2(t3) ? o3() : o3(new Error("密码必须包含大小写字母、数字和特殊字符"));
|
||
}, r2 = function(t3, o3, a3) {
|
||
"" === o3 ? a3(new Error("请再次输入密码")) : o3 !== e2.changePasswordForm.newPassword ? a3(new Error("两次输入密码不一致!")) : o3.length < 8 ? a3(new Error("密码长度至少8位")) : n2(o3) ? a3() : a3(new Error("密码必须包含大小写字母、数字和特殊字符"));
|
||
};
|
||
return { selectRolesDialog: false, verify: false, verifyIng: false, roleDivShow: false, btnDisabled: false, activeName: "byWechat", timer: null, count: "", verifyTitle: "获取验证码", loginForm: { username: "", password: "", verifycode: "", captchaCode: "", captchaUuid: "" }, logInRules: {}, loginRules: { username: [{ required: true, validator: t2 }], password: [{ required: true, validator: o2 }], verifycode: [{ required: true, validator: a2 }], captchaCode: [{ validator: s2 }] }, passwordType: "password", loading: false, showDialog: false, redirect: void 0, roleList: [], roleContrast: [], selectRole: "", logInInfo: {}, companyList: [], forgetShow: false, changePasswordShow: false, captchaImage: "", loginSubmitting: false, showChangePasswordDialog: false, changePasswordLoading: false, loginUserInfo: null, changePasswordForm: { mobile: "", smscode: "", newPassword: "", confirmNewPassword: "" }, changePasswordRules: { mobile: [{ required: true, message: "请输入手机号", trigger: "blur" }, { pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, message: "手机号格式不正确", trigger: "blur" }], smscode: [{ required: true, message: "请输入验证码", trigger: "blur" }], newPassword: [{ required: true, trigger: "blur", validator: i2 }], confirmNewPassword: [{ required: true, trigger: "blur", validator: r2 }] }, changePasswordVerifyIng: false, changePasswordVerifyTitle: "获取验证码", changePasswordTimer: null, changePasswordCount: 0, changePasswordSavekey: "", savedRoleInfo: null, wechatQrCode: "", wechatQrCodeExpired: false, wechatPollingTimer: null, wechatPollingStartTime: null, wechatTimeoutTimer: null, wechatCountdownTimer: null, wechatCountdownSeconds: 60, wechatBindDialog: false, wechatBindForm: { username: "", password: "", captchaCode: "", captchaUuid: "", openid: "" }, wechatBindLoading: false, wechatBindCaptchaImage: "" };
|
||
}, watch: { $route: { handler: function(e2) {
|
||
this.redirect = e2.query && e2.query.redirect;
|
||
}, immediate: true }, wechatBindDialog: function(e2) {
|
||
var t2 = this;
|
||
e2 && this.$nextTick((function() {
|
||
t2.wechatBindForm = { username: "", password: "", captchaCode: "", captchaUuid: t2.generateUUID(), openid: t2.wechatBindForm.openid }, t2.getWechatBindCaptcha();
|
||
}));
|
||
}, showChangePasswordDialog: function(e2) {
|
||
var t2 = this;
|
||
e2 && this.$nextTick((function() {
|
||
var e3 = t2.changePasswordForm.mobile;
|
||
t2.changePasswordForm = { mobile: e3, smscode: "", newPassword: "", confirmNewPassword: "" };
|
||
}));
|
||
} }, created: function() {
|
||
C.a.remove("CToken"), this.loginForm.captchaUuid = this.generateUUID(), this.getCaptcha(), this.initWechatLogin();
|
||
}, mounted: function() {
|
||
"" === this.loginForm.username ? this.$refs.username.focus() : "" === this.loginForm.password ? this.$refs.password.focus() : "" === this.loginForm.veritycode && this.$refs.veritycode.focus();
|
||
}, destroyed: function() {
|
||
this.clearWechatPolling();
|
||
}, methods: { generateUUID: function() {
|
||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(e2) {
|
||
var t2 = 16 * Math.random() | 0, o2 = "x" === e2 ? t2 : 3 & t2 | 8;
|
||
return o2.toString(16);
|
||
}));
|
||
}, getCaptcha: function() {
|
||
var e2 = this;
|
||
Object(I["a"])({ captchaUuid: this.loginForm.captchaUuid }).then((function(t2) {
|
||
t2 && 0 === t2.code ? e2.captchaImage = "data:image/png;base64,".concat(t2.data) : e2.$message.error("获取验证码失败");
|
||
})).catch((function(t2) {
|
||
console.error("获取验证码失败:", t2), e2.$message.error("获取验证码失败");
|
||
}));
|
||
}, refreshCaptcha: function() {
|
||
this.loginForm.captchaUuid = this.generateUUID(), this.loginForm.captchaCode = "", this.getCaptcha();
|
||
}, groupArr: function(e2, t2) {
|
||
var o2 = {};
|
||
return e2.forEach((function(e3) {
|
||
var a2 = JSON.stringify(t2(e3));
|
||
o2[a2] = o2[a2] || [], o2[a2].push(e3);
|
||
})), Object.keys(o2).map((function(e3) {
|
||
return o2[e3];
|
||
}));
|
||
}, handleSelectedRole: function(e2) {
|
||
this.selectRole = e2, this.selectRole.roleId && (this.btnDisabled = false, this.roleDivShow = false, 3 === this.logInInfo.type && this.selectRole.accountName && (this.logInInfo.username = this.selectRole.accountName));
|
||
}, findByAccountId: function() {
|
||
var e2 = this;
|
||
this.wechatBindLoading = false;
|
||
this.roleList = [], this.loading = true, 3 == this.logInInfo.type || this.logInInfo.accountName || (this.logInInfo.accountName = this.loginForm.username), Object(c["c"])(this.logInInfo).then((function(t2) {
|
||
if (0 === t2.code) {
|
||
var o2 = t2.data;
|
||
if (o2.length > 1) {
|
||
e2.loading = false, e2.selectRolesDialog = true;
|
||
var a2 = e2.groupArr(o2, (function(e3) {
|
||
return [e3.orgId];
|
||
}));
|
||
e2.roleList = a2;
|
||
} else 1 === o2.length && (e2.loading = false, e2.selectRole = o2[0], 3 === e2.logInInfo.type && e2.selectRole.accountName && (e2.logInInfo.username = e2.selectRole.accountName), e2.submiLogInInfo());
|
||
} else 999 == t2.code && (e2.loading = false, e2.wechatBindForm.openid = e2.logInInfo.openid, e2.wechatBindForm.captchaUuid = e2.generateUUID(), e2.getWechatBindCaptcha(), e2.wechatBindDialog = true);
|
||
})).catch((function(t2) {
|
||
console.log("findByAccountId error:", t2), e2.loading = false;
|
||
}));
|
||
}, unique: function(e2) {
|
||
var t2 = /* @__PURE__ */ new Map();
|
||
return e2.filter((function(e3) {
|
||
return !t2.has(e3.roleId) && t2.set(e3.roleId, 1);
|
||
}));
|
||
}, loginTypeChange: function(e2) {
|
||
this.activeName = e2.name, "byVerify" == this.activeName ? this.verify = true : this.verify = false, "byWechat" == this.activeName ? this.initWechatLogin() : this.clearWechatLogin();
|
||
}, getVerify: function() {
|
||
var e2 = this, t2 = { mobile: this.loginForm.username, type: 1 };
|
||
Object(c["k"])(t2).then((function(t3) {
|
||
0 == t3.code && (e2.$message({ message: "短信发送成功,请查看!", type: "success" }), e2.codeTime());
|
||
}));
|
||
}, codeTime: function() {
|
||
var e2 = this, t2 = 60;
|
||
this.count = t2, this.verifyIng = true, this.verifyTitle = "".concat(this.count, "秒后再次获取"), this.timer || (this.timer = setInterval((function() {
|
||
e2.count > 1 && e2.count <= t2 ? (e2.count--, e2.verifyTitle = "".concat(e2.count, "秒后再次获取")) : (e2.verifyIng = false, clearInterval(e2.timer), e2.timer = null, e2.verifyTitle = "获取验证码");
|
||
}), 1e3));
|
||
}, submiLogInInfo: function() {
|
||
this.btnDisabled = true, this.selectRole && this.selectRole.roleId ? (this.logInInfo.orgId = this.selectRole.orgId, this.logInInfo.memberId = this.selectRole.memberId, this.logInInfo.roleId = this.selectRole.roleId, 3 === this.logInInfo.type && this.selectRole.accountName && (this.logInInfo.username = this.selectRole.accountName), this.getProjectList()) : this.roleDivShow = true;
|
||
}, getProjectList: function() {
|
||
var e2 = this, t2 = { id: this.logInInfo.roleId };
|
||
Object(P["n"])(t2).then((function(t3) {
|
||
if (0 === t3.code && t3.data && t3.data.length) {
|
||
var o2 = t3.data, a2 = o2.find((function(e3) {
|
||
return e3.isHaveEquity;
|
||
}));
|
||
a2 || (a2 = o2[0]), localStorage.setItem("companyName", a2.companyName), e2.$store.commit("setState", { id: a2.id, star: a2.star, companyUuid: a2.companyUuid, companyId: a2.companyId, community_uuid: a2.uuid, community_name: a2.name, codeNumber: a2.codeNumber }), e2.$store.dispatch("user/login", e2.logInInfo).then((function(t4) {
|
||
console.log(t4, "login+++++++++++++"), e2.loading = false, e2.loginUserInfo = t4, t4.needChangePassword ? (e2.selectRolesDialog = false, e2.savedRoleInfo = { orgId: e2.selectRole.orgId, memberId: e2.selectRole.memberId, roleId: e2.selectRole.roleId }, e2.selectRole = {}, e2.changePasswordForm.mobile = e2.loginForm.username, e2.showChangePasswordDialog = true) : t4.needPasswordReminder ? e2.$alert("检测到您的密码长时间未修改?", "提示", { confirmButtonText: "我已知悉", showClose: false, closeOnClickModal: false, closeOnPressEscape: false }).then((function() {
|
||
e2.completeLogin();
|
||
})) : (e2.selectRolesDialog = false, e2.$store.dispatch("user/getInfo").then((function() {
|
||
e2.getCompanyList(), e2.checkPwd();
|
||
})));
|
||
})).catch((function() {
|
||
e2.loading = false, e2.btnDisabled = false;
|
||
}));
|
||
} else e2.$store.dispatch("user/login", e2.logInInfo).then((function(t4) {
|
||
console.log(t4, "login+++++++++++++"), e2.loading = false, e2.loginUserInfo = t4, t4.needChangePassword ? (e2.selectRolesDialog = false, e2.savedRoleInfo = { orgId: e2.selectRole.orgId, memberId: e2.selectRole.memberId, roleId: e2.selectRole.roleId }, e2.selectRole = {}, e2.showChangePasswordDialog = true) : t4.needPasswordReminder ? e2.$alert("检测到您的密码长时间未修改?", "提示", { confirmButtonText: "我已知悉", showClose: false, closeOnClickModal: false, closeOnPressEscape: false }).then((function() {
|
||
e2.completeLogin();
|
||
})) : (e2.selectRolesDialog = false, e2.$store.dispatch("user/getInfo").then((function() {
|
||
e2.getCompanyList(), e2.checkPwd();
|
||
})));
|
||
})).catch((function() {
|
||
e2.loading = false, e2.btnDisabled = false;
|
||
}));
|
||
}));
|
||
}, checkPwd: function() {
|
||
if ("byPwd" == this.activeName) {
|
||
var e2 = this.loginForm.username, t2 = this.loginForm.password;
|
||
e2.slice(-6) == t2 ? sessionStorage.setItem("dangerPwd", true) : sessionStorage.removeItem("dangerPwd");
|
||
}
|
||
}, completeLogin: function() {
|
||
var e2 = this;
|
||
this.selectRolesDialog = false, this.$store.dispatch("user/getInfo").then((function() {
|
||
e2.getCompanyList(), e2.checkPwd();
|
||
})).catch((function(t2) {
|
||
console.error("获取用户信息失败:", t2), e2.$message.error("获取用户信息失败,请重试");
|
||
}));
|
||
}, getCompanyList: function() {
|
||
var e2 = this, t2 = JSON.parse(window.localStorage.getItem("C_userInfo"));
|
||
Object(P["o"])({ accountName: this.logInInfo.accountName, roleId: t2.roleId, memberId: t2.memberId, orgId: t2.orgId }).then((function(t3) {
|
||
t3.data && t3.data.menuSelectAllResponseDTOS.length > 0 ? (e2.companyList = [t3.data.companyAuthApplyOrderRespDTO], e2.toCompany()) : (e2.companyList = [], e2.btnDisabled = false, e2.$router.push({ path: e2.redirect || "/" }), e2.selectRolesDialog = false);
|
||
}));
|
||
}, toCompany: function() {
|
||
var e2 = JSON.parse(window.localStorage.getItem("C_userInfo"));
|
||
if (0 != this.companyList.length) {
|
||
var t2 = { phone: this.companyList[0].phoneNumber, companyName: this.companyList[0].fullName, companyId: this.selectRole.orgId, logo: this.companyList[0].logo || "", roleId: e2.roleId, memberId: e2.memberId }, o2 = Object(_["e"])(t2), a2 = "".concat("https://hc-etms.sqygj.cn/", "#/login");
|
||
window.location.href = "".concat(a2, "?").concat(o2);
|
||
}
|
||
}, showPwd: function() {
|
||
var e2 = this;
|
||
"password" === this.passwordType ? this.passwordType = "" : this.passwordType = "password", this.$nextTick((function() {
|
||
e2.$refs.password.focus();
|
||
}));
|
||
}, handleLogin: function() {
|
||
var e2 = this;
|
||
if (localStorage.clear(), "byPwd" === this.activeName) {
|
||
var t2 = this.loginForm, o2 = t2.username, a2 = t2.password, s2 = t2.captchaCode, n2 = t2.captchaUuid;
|
||
if (!o2) return this.$message.error("请输入登录账号/手机号");
|
||
if (!a2 || a2.length < 6) return this.$message.error("登录密码为6位及以上");
|
||
if (!s2 || s2.length < 4) return this.$message.error("请输入4位图形验证码");
|
||
if (this.loginSubmitting) return;
|
||
this.loginSubmitting = true;
|
||
var i2 = { type: 1, username: o2, password: a2, captchaCode: s2, captchaUuid: n2 };
|
||
this.logInInfo = i2, this.findByAccountId(), this.$nextTick((function() {
|
||
return e2.loginSubmitting = false;
|
||
}));
|
||
} else if ("byVerify" === this.activeName) {
|
||
var r2 = this.loginForm, c2 = r2.username, l2 = r2.verifycode;
|
||
if (!c2) return this.$message.error("请输入登录账号/手机号");
|
||
if (!l2) return this.$message.error("请输入验证码");
|
||
if (4 !== String(l2).length) return this.$message.error("验证码为4位数");
|
||
if (this.loginSubmitting) return;
|
||
this.loginSubmitting = true;
|
||
var d2 = { type: 2, username: c2, smscode: l2 };
|
||
this.logInInfo = d2, this.findByAccountId(), this.$nextTick((function() {
|
||
return e2.loginSubmitting = false;
|
||
}));
|
||
} else this.activeName;
|
||
}, getChangePasswordVerify: function() {
|
||
var e2 = this, t2 = "code".concat(Date.now()).concat(this.changePasswordForm.mobile), o2 = { key: t2, mobile: this.changePasswordForm.mobile, type: 1 };
|
||
Object(c["b"])(o2).then((function(o3) {
|
||
0 == o3.code && (e2.$message({ message: "短信发送成功,请查看!", type: "success" }), e2.changePasswordSavekey = t2, e2.changePasswordCodeTime());
|
||
}));
|
||
}, changePasswordCodeTime: function() {
|
||
var e2 = this, t2 = 60;
|
||
this.changePasswordCount = t2, this.changePasswordVerifyIng = true, this.changePasswordVerifyTitle = "".concat(this.changePasswordCount, "秒后再次获取"), this.changePasswordTimer || (this.changePasswordTimer = setInterval((function() {
|
||
e2.changePasswordCount > 1 && e2.changePasswordCount <= t2 ? (e2.changePasswordCount--, e2.changePasswordVerifyTitle = "".concat(e2.changePasswordCount, "秒后再次获取")) : (e2.changePasswordVerifyIng = false, clearInterval(e2.changePasswordTimer), e2.changePasswordTimer = null, e2.changePasswordVerifyTitle = "获取验证码");
|
||
}), 1e3));
|
||
}, handleChangePassword: function() {
|
||
var e2 = this;
|
||
if (!this.$refs.changePasswordForm) return console.error("修改密码表单不存在"), void this.$message.error("表单未初始化,请重试");
|
||
try {
|
||
this.$refs.changePasswordForm.validate((function(t2) {
|
||
if (!t2) return console.log("error submit!!"), false;
|
||
e2.changePasswordLoading = true;
|
||
var o2 = { mobile: e2.changePasswordForm.mobile, smscode: e2.changePasswordForm.smscode, newPassword: e2.changePasswordForm.confirmNewPassword, key: e2.changePasswordSavekey };
|
||
Object(c["j"])(o2).then((function(t3) {
|
||
e2.changePasswordLoading = false, 0 == t3.code ? (e2.showChangePasswordDialog = false, e2.$refs.changePasswordForm.resetFields(), e2.$message.success("密码修改成功,正在自动登录..."), e2.autoLoginAfterPasswordChange()) : e2.$message.error(t3.message || "密码修改失败");
|
||
})).catch((function(t3) {
|
||
e2.changePasswordLoading = false, e2.$message.error("密码修改失败"), console.error("修改密码失败:", t3);
|
||
}));
|
||
}));
|
||
} catch (t2) {
|
||
this.changePasswordLoading = false, console.error("表单校验失败:", t2), this.$message.error("表单校验失败,请检查表单信息");
|
||
}
|
||
}, autoLoginAfterPasswordChange: function() {
|
||
if (this.loginUserInfo && this.savedRoleInfo) {
|
||
var e2 = $($({}, this.loginUserInfo), {}, { memberId: this.savedRoleInfo.memberId, roleId: this.savedRoleInfo.roleId, orgId: this.savedRoleInfo.orgId, username: this.loginForm.username, password: this.changePasswordForm.confirmNewPassword, type: 1, captchaCode: "", captchaUuid: "" });
|
||
this.logInInfo = e2, this.selectRole = this.savedRoleInfo, this.getProjectList();
|
||
} else this.$message.error("登录信息已丢失,请重新登录");
|
||
}, initWechatLogin: function() {
|
||
this.wechatQrCodeExpired = false, this.wechatQrCode = "", this.wechatCountdownSeconds = 60, this.getWechatQrCode();
|
||
}, getWechatQrCode: function() {
|
||
var e2 = this;
|
||
Object(I["b"])().then((function(t2) {
|
||
if (t2 && 0 === t2.code) {
|
||
var o2 = JSON.parse(t2.data), a2 = o2.ticket;
|
||
a2 ? (e2.getWechatQrCodeImage(a2), e2.startWechatPolling(), e2.startWechatCountdown()) : e2.$message.error("获取微信登录ticket失败");
|
||
} else e2.$message.error("获取微信登录二维码失败");
|
||
})).catch((function(t2) {
|
||
console.error("获取微信登录二维码失败:", t2), e2.$message.error("获取微信登录二维码失败");
|
||
}));
|
||
}, getWechatQrCodeImage: function(e2) {
|
||
var t2 = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=".concat(encodeURIComponent(e2));
|
||
this.wechatQrCode = t2;
|
||
}, refreshWechatQrCode: function() {
|
||
this.clearWechatPolling(), this.initWechatLogin();
|
||
}, startWechatPolling: function() {
|
||
var e2 = this;
|
||
this.clearWechatPolling(), this.wechatPollingStartTime = Date.now(), this.wechatPollingTimer = setInterval((function() {
|
||
e2.checkWechatLoginStatus();
|
||
}), 2e3), this.wechatTimeoutTimer = setTimeout((function() {
|
||
e2.handleWechatPollingTimeout();
|
||
}), 6e4);
|
||
}, startWechatCountdown: function() {
|
||
var e2 = this;
|
||
this.clearWechatCountdown(), this.wechatCountdownSeconds = 60, this.wechatCountdownTimer = setInterval((function() {
|
||
e2.wechatCountdownSeconds--, e2.wechatCountdownSeconds <= 0 && e2.clearWechatCountdown();
|
||
}), 1e3);
|
||
}, clearWechatCountdown: function() {
|
||
this.wechatCountdownTimer && (clearInterval(this.wechatCountdownTimer), this.wechatCountdownTimer = null);
|
||
}, checkWechatLoginStatus: function() {
|
||
var e2 = this;
|
||
Object(I["c"])({ ticket: this.getTicketFromQrCode() }).then((function(t2) {
|
||
0 == t2.code && ("1" == t2.data || (null === t2.data ? (e2.clearWechatPolling(), e2.$message.warning("二维码已过期,请刷新后重新扫码")) : (e2.clearWechatPolling(), e2.handleWechatLoginSuccess(t2.data))));
|
||
})).catch((function(t2) {
|
||
console.error("检查微信登录状态失败:", t2), e2.clearWechatPolling();
|
||
}));
|
||
}, getWechatBindCaptcha: function() {
|
||
var e2 = this;
|
||
Object(I["a"])({ captchaUuid: this.wechatBindForm.captchaUuid }).then((function(t2) {
|
||
t2 && 0 === t2.code ? e2.wechatBindCaptchaImage = "data:image/png;base64,".concat(t2.data) : e2.$message.error("获取验证码失败");
|
||
})).catch((function(t2) {
|
||
console.error("获取验证码失败:", t2), e2.$message.error("获取验证码失败");
|
||
}));
|
||
}, refreshWechatBindCaptcha: function() {
|
||
this.wechatBindForm.captchaUuid = this.generateUUID(), this.wechatBindForm.captchaCode = "", this.getWechatBindCaptcha();
|
||
}, handleWechatBindLogin: function() {
|
||
var e2 = this;
|
||
if (!this.$refs.wechatBindForm) return console.error("微信绑定表单不存在"), void this.$message.error("表单未初始化,请重试");
|
||
try {
|
||
this.$refs.wechatBindForm.validate((function(t2) {
|
||
if (!t2) return e2.wechatBindLoading = false, console.log("验证失败"), false;
|
||
e2.wechatBindLoading = true;
|
||
var o2 = { type: 1, username: e2.wechatBindForm.username, password: e2.wechatBindForm.password, captchaCode: e2.wechatBindForm.captchaCode, captchaUuid: e2.wechatBindForm.captchaUuid, openid: e2.wechatBindForm.openid, accountName: e2.wechatBindForm.username };
|
||
e2.logInInfo = o2, e2.wechatBindDialog = false, e2.findByAccountId();
|
||
}));
|
||
} catch (t2) {
|
||
this.wechatBindLoading = false, console.error("微信绑定登录失败:", t2), this.$message.error("表单校验失败,请检查表单信息");
|
||
}
|
||
}, handleWechatPollingTimeout: function() {
|
||
console.log("微信登录二维码已超时,需要手动刷新"), this.$message.warning("二维码已过期,请点击刷新按钮重新获取"), this.clearWechatPolling(), this.wechatQrCode = "", this.wechatQrCodeExpired = true;
|
||
}, getTicketFromQrCode: function() {
|
||
if (this.wechatQrCode) {
|
||
var e2 = new URL(this.wechatQrCode);
|
||
return e2.searchParams.get("ticket");
|
||
}
|
||
return null;
|
||
}, handleWechatLoginSuccess: function(e2) {
|
||
this.loading = true;
|
||
var t2 = { type: 3, openid: e2 };
|
||
this.logInInfo = t2, this.findByAccountId();
|
||
}, clearWechatLogin: function() {
|
||
this.wechatQrCode = "", this.wechatQrCodeExpired = false, this.wechatCountdownSeconds = 60, this.clearWechatPolling(), this.clearWechatCountdown();
|
||
}, clearWechatPolling: function() {
|
||
this.wechatPollingTimer && (clearInterval(this.wechatPollingTimer), this.wechatPollingTimer = null), this.wechatTimeoutTimer && (clearTimeout(this.wechatTimeoutTimer), this.wechatTimeoutTimer = null), this.wechatPollingStartTime = null;
|
||
} } }, N = B, L = (o("8d00"), o("7835"), o("ce3d"), Object(h["a"])(N, a, s, false, null, "51b6a756", null));
|
||
t["default"] = L.exports;
|
||
}, a0b6: function(e, t, o) {
|
||
}, a321: function(e, t, o) {
|
||
}, ce3d: function(e, t, o) {
|
||
"use strict";
|
||
o("a0b6");
|
||
} }]);
|