var Ne = Object.defineProperty; var re = Object.getOwnPropertySymbols; var Ve = Object.prototype.hasOwnProperty, Fe = Object.prototype.propertyIsEnumerable; var ue = (m, e, c) => e in m ? Ne(m, e, { enumerable: !0, configurable: !0, writable: !0, value: c }) : m[e] = c, B = (m, e) => { for (var c in e || (e = {})) Ve.call(e, c) && ue(m, c, e[c]); if (re) for (var c of re(e)) Fe.call(e, c) && ue(m, c, e[c]); return m; }; var W = (m, e, c) => new Promise((f, _) => { var U = (g) => { try { d(c.next(g)); } catch ($) { _($); } }, j = (g) => { try { d(c.throw(g)); } catch ($) { _($); } }, d = (g) => g.done ? f(g.value) : Promise.resolve(g.value).then(U, j); d((c = c.apply(m, e)).next()); }); import { ref as n, reactive as X, watch as Ae, onMounted as Re, openBlock as x, createElementBlock as P, createElementVNode as l, toDisplayString as o, createVNode as s, withCtx as i, createCommentVNode as R, createTextVNode as V, normalizeStyle as Z, withDirectives as Ue, vShow as Te, normalizeClass as Y, unref as Ee, nextTick as ze } from "vue"; import { useRouter as Le } from "vue-router"; import { n as Me, I as qe, B as De, dC as Oe, dJ as Be } from "./index2.js"; import { e as Ze, f as je, h as Je, i as Ge } from "./account.js"; import { s as He } from "./success-qrcode.js"; import { C as Ke } from "./index18.js"; import { _ as Qe, S as We } from "./index11.js"; import { F as Xe, _ as Ye } from "./index5.js"; import { _ as ea, a as aa } from "./index10.js"; import { S as ta } from "./index15.js"; const la = { class: "activate-page" }, sa = { class: "header" }, oa = { class: "header-inner" }, na = { class: "logo-box" }, ia = ["src", "alt"], ra = { class: "sub-title" }, ua = { class: "main-wrap" }, ca = { key: 0 }, da = { class: "tip-text" }, va = { class: "bold-text" }, pa = { class: "small-text" }, fa = { id: "verification-code-div" }, _a = ["title"], ma = ["src"], ha = { class: "btn-group" }, ga = { key: 1, class: "form-wrap" }, wa = { class: "page-title" }, ba = { class: "page-desc" }, ya = { key: 0, class: "error-tip-box" }, ka = { class: "error-text" }, Ca = { key: 1 }, xa = { class: "info-display-box" }, Pa = { class: "label-text" }, $a = { class: "value-text" }, Sa = { class: "verify-between" }, Ia = { class: "verify-button-name" }, Na = { class: "djs" }, Va = { class: "btn-group" }, Fa = { key: 2, class: "btn-group only-prev-btn" }, Aa = { key: 2, class: "form-wrap" }, Ra = { class: "page-title" }, Ua = { class: "page-desc" }, Ta = { class: "pwd-strength-bar" }, Ea = { class: "pwd-rule-tips" }, za = { class: "btn-group" }, La = { key: 3, class: "form-wrap finish-wrap" }, Ma = { class: "success-icon" }, qa = ["src", "alt"], Da = { class: "finish-title" }, Oa = { class: "finish-desc" }, Ba = { class: "account-info-card" }, Za = { class: "info-item" }, ja = { class: "info-label" }, Ja = { class: "info-value" }, Ga = { class: "info-item" }, Ha = { class: "info-label" }, Ka = { class: "info-value" }, Qa = { class: "info-item" }, Wa = { class: "info-label" }, Xa = { class: "info-value" }, Ya = { class: "btn-group finish-btn-group" }, et = { class: "footer" }, at = /* @__PURE__ */ Object.assign({ name: "LoginActivate" }, { __name: "activate", setup(m) { const e = (a) => window.$l ? window.$l(a) : a, c = Le(), f = n(0), _ = n(!1), U = n(""), j = n(null), d = X({ no: "", name: "", certNo: "", verificationCode: "" }), g = { no: [{ required: !0, message: e("请输入工号/学号/手机号") }], name: [{ required: !0, message: e("请输入姓名") }], certNo: [{ required: !0, message: e("请输入证件号后6位") }], verificationCode: [{ required: !0, message: e("请输入验证码") }] }, $ = n(null), J = n(""), T = n(""), ee = n(null), M = X({ code: "" }), ce = { code: [{ required: !0, message: e("请输入4位验证码") }] }, r = n(""), q = n(""), S = n(""), A = n(e("获取验证码")), D = n(Date.now() + 60 * 1e3), w = n(!1), b = n(null), ae = n(null), y = X({ password: "", confirmPassword: "" }); function de(a, t) { const u = y.password; if (t) { if (t !== u) return Promise.reject(new Error(e("两次输入的密码不一致"))); } else return Promise.reject(new Error(e("请再次输入密码"))); return Promise.resolve(); } const ve = { password: [ { required: !0, message: e("请设置登录密码") }, { min: 8, max: 16, message: e("密码长度为8~16位") }, { pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};:\\|,.<>\/?!¥()【】;:,。、?“”‘’]).+$/, message: e("必须同时包含:大小写字母、数字、特殊字符") } ], confirmPassword: [ { required: !0, message: e("请再次输入密码") }, { validator: de } ] }, E = n(""), k = n(0), z = n(""), L = n(""), I = n(""), N = n(""), O = n(""), te = n(""), le = n(""), G = n(U), pe = { 1: "var(--s-color-success)", 2: "var(--s-color-warning)", 3: "var(--s-color-error)" }; function H(a) { return { background: k.value >= a ? pe[a] : "var(--s-border-color-light)" }; } function se() { c.push(window.$utils.env.VITE_APP_LOGIN_PATH || "/login"); } function K() { Oe().then((a) => { $.value = `data:image/gif;base64,${a.verificationImage}`, J.value = a.verificationCodeId; }).catch(() => { $.value = null, J.value = ""; }); } function fe() { return W(this, null, function* () { const a = B({}, d); _.value = !0; try { const t = yield Ze( a.no, a.name, a.certNo, a.verificationCode, J.value ); r.value = t.verifyType || "", S.value = t.realValue || "", T.value = t.userId || "", E.value = t.no || "", r.value === "telphone" ? q.value = ne(S.value) : r.value === "email" ? q.value = ie(S.value) : q.value = "", f.value = 1; } catch (t) { K(); } finally { _.value = !1; } }); } function _e() { if (w.value) return; if (!r.value) { window.$message.error(e("未获取到验证类型,请返回上一步重试")); return; } if (!S.value) { window.$message.error( `${r.value === "telphone" ? e("手机号") : e("邮箱")}${e("不能为空")}` ); return; } if (!T.value) { window.$message.error(e("用户ID不存在,请返回上一步重新核验身份")); return; } let a = !0; if (r.value === "telphone" ? /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[3-8]{1})|(18[0-9]{1})|(19[0-9]{1})|(14[5-7]{1}))+\d{8})$/.test(S.value) || (window.$message.error(e("手机号码格式错误")), a = !1) : r.value === "email" && (/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(S.value) || (window.$message.error(e("邮箱地址格式错误")), a = !1)), !a) return; A.value = e("重新发送"), w.value = !0, D.value = Date.now() + 60 * 1e3; const t = { userId: T.value, no: E.value, // 互斥传递 mobile/email mobile: r.value === "telphone" ? S.value : "", email: r.value === "email" ? S.value : "", type: r.value === "telphone" ? 0 : 1 }; Je(t).then(() => { window.$message.success( `${e("已向")}${r.value === "telphone" ? e("手机") : e("邮箱")}${e("发送验证码")}` ); }).catch(() => { w.value = !1, A.value = e("获取验证码"); }); } function me() { w.value = !1, A.value = e("获取验证码"), b.value && (clearInterval(b.value), b.value = null); } function oe() { var a; (a = ee.value) == null || a.resetFields(), f.value = 0, w.value = !1, A.value = e("获取验证码"), D.value = Date.now() + 60 * 1e3, b.value && (clearInterval(b.value), b.value = null); } function he() { const a = B({}, M); return _.value = !0, je(a.code, T.value).then(() => { f.value = 2; }).catch(() => { }).finally(() => { _.value = !1; }); } function ge(a) { const t = a && a.target ? a.target.value : a; le.value = JSON.parse(JSON.stringify(t)); } function we(a) { if (!a) { k.value = 0; return; } let t = 0; /[a-z]/.test(a) && t++, /[A-Z]/.test(a) && t++, /\d/.test(a) && t++, /[!@#$%^&*()_+\-=\[\]{};:\\|,.<>\/?!¥()【】;:,。、?“”‘’]/.test(a) && t++, t <= 1 ? k.value = 1 : t <= 3 ? k.value = 2 : k.value = 3; } function be() { ze(() => { const a = y.confirmPassword || "", t = y.password || ""; if (!a) { I.value = "", N.value = ""; return; } a !== t ? (I.value = "error", N.value = e("两次输入的密码不一致")) : (I.value = "success", N.value = ""); }); } function ye({ errorFields: a = [] }) { const t = a.find((v) => v.name && v.name[0] === "password"), u = a.find((v) => v.name && v.name[0] === "confirmPassword"); t ? (z.value = "error", L.value = t.errors[0]) : (z.value = "", L.value = ""), u ? (I.value = "error", N.value = u.errors[0]) : (I.value = "", N.value = ""); } function ke() { var a; (a = ae.value) == null || a.resetFields(), f.value = 1, k.value = 0, z.value = "", L.value = "", I.value = "", N.value = "", w.value = !1, A.value = e("获取验证码"), D.value = Date.now() + 60 * 1e3, b.value && (clearInterval(b.value), b.value = null); } function Ce() { z.value = "success", L.value = "", I.value = "success", N.value = "", _.value = !0; const t = B({}, y).password; Ge(T.value, t).then((u) => { E.value = u.accountNo || "", te.value = u.activateTime || ""; let v = ""; r.value === "telphone" ? (v = u.telphone || "", O.value = ne(v)) : r.value === "email" ? (v = u.email || "", O.value = ie(v)) : O.value = "", f.value = 3; }).catch(() => { }).finally(() => { _.value = !1; }); } function ne(a) { return !a || !/^\d{11}$/.test(a) ? a : a.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2"); } function ie(a) { if (!a || !a.includes("@")) return a; const [t, u] = a.split("@"); return `${t.slice(0, 1) + "****"}@${u}`; } function xe() { return W(this, null, function* () { const a = yield Be(); G.value = a.indexPageLogoUrl || U; }); } return Ae( le, (a) => { we(a); }, { immediate: !0, deep: !0 } ), Re(() => { K(), xe().catch(() => { G.value = U; }); }), (a, t) => { const u = We, v = Qe, F = qe, h = Ye, Pe = aa, $e = ea, C = De, Q = Xe, Se = ta, Ie = Ke; return x(), P("div", la, [ l("div", sa, [ l("div", oa, [ l("div", na, [ l("img", { src: G.value, alt: e("logo"), class: "logo-title-img" }, null, 8, ia), t[7] || (t[7] = l("span", { class: "split-line" }, "|", -1)), l("span", ra, o(e("统一身份认证账号激活")), 1) ]) ]) ]), l("div", ua, [ s(Ie, { class: "activate-card" }, { default: i(() => [ s(v, { current: f.value, class: "step-bar" }, { default: i(() => [ s(u, { title: e("身份核验") }, null, 8, ["title"]), s(u, { title: e("安全验证") }, null, 8, ["title"]), s(u, { title: e("设置密码") }, null, 8, ["title"]), s(u, { title: e("完成") }, null, 8, ["title"]) ]), _: 1 }, 8, ["current"]), f.value === 0 ? (x(), P("div", ca, [ l("div", da, [ l("p", va, o(e("验证您的身份")), 1), l("p", pa, o(e("请填写学校登记的个人信息")), 1) ]), s(Q, { ref_key: "formRef0", ref: j, class: "activate-form", model: d, rules: g, onFinish: fe }, { default: i(() => [ s(h, { class: "m-l-55", label: e("工号/学号/手机号"), name: "no", "label-col": { span: 8 }, "wrapper-col": { span: 16 } }, { default: i(() => [ s(F, { value: d.no, "onUpdate:value": t[0] || (t[0] = (p) => d.no = p), type: "text", placeholder: e("请输入工号/学号/手机号") }, null, 8, ["value", "placeholder"]) ]), _: 1 }, 8, ["label"]), s(h, { class: "m-l-55", label: e("姓名"), name: "name", "label-col": { span: 8 }, "wrapper-col": { span: 16 } }, { default: i(() => [ s(F, { value: d.name, "onUpdate:value": t[1] || (t[1] = (p) => d.name = p), type: "text", placeholder: e("请输入姓名") }, null, 8, ["value", "placeholder"]) ]), _: 1 }, 8, ["label"]), s(h, { class: "m-l-55", label: e("证件号后6位"), name: "certNo", "label-col": { span: 8 }, "wrapper-col": { span: 16 } }, { default: i(() => [ s(F, { value: d.certNo, "onUpdate:value": t[2] || (t[2] = (p) => d.certNo = p), type: "text", placeholder: e("请输入证件号后6位") }, null, 8, ["value", "placeholder"]) ]), _: 1 }, 8, ["label"]), s(h, { class: "m-l-55", label: e("验证码"), name: "verificationCode", "label-col": { span: 8 }, "wrapper-col": { span: 16 } }, { default: i(() => [ s($e, { gutter: 12 }, { default: i(() => [ s(Pe, { span: 24 }, { default: i(() => [ l("div", fa, [ s(F, { value: d.verificationCode, "onUpdate:value": t[3] || (t[3] = (p) => d.verificationCode = p), placeholder: e("请输入右侧验证码") }, null, 8, ["value", "placeholder"]), l("div", { id: "verificationCode", title: e("刷新一下"), onClick: K }, [ $.value ? (x(), P("img", { key: 0, style: { width: "100%", "font-size": "0" }, src: $.value }, null, 8, ma)) : R("", !0) ], 8, _a) ]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }, 8, ["label"]), s(h, { class: "m-l-55", "wrapper-col": { span: 24 } }, { default: i(() => [ l("div", ha, [ s(C, { onClick: se }, { default: i(() => [ V(o(e("返回登录页面")), 1) ]), _: 1 }), s(C, { type: "primary", "html-type": "submit", loading: _.value }, { default: i(() => [ V(o(e("下一步")), 1) ]), _: 1 }, 8, ["loading"]) ]) ]), _: 1 }) ]), _: 1 }, 8, ["model"]) ])) : R("", !0), f.value === 1 ? (x(), P("div", ga, [ l("h2", wa, o(r.value === "telphone" ? e("验证预留手机号") : e("验证预留邮箱")), 1), l("p", ba, o(e("请查看")) + o(r.value === "telphone" ? e("短信") : e("邮件")) + o(e(",输入 4 位验证码。")), 1), r.value ? (x(), P("div", Ca, [ l("div", xa, [ l("span", Pa, o(r.value === "telphone" ? e("预留手机号") : e("预留邮箱")), 1), l("span", $a, o(q.value), 1) ]), s(Q, { ref_key: "formRef1", ref: ee, class: "activate-form", model: M, rules: ce, onFinish: he }, { default: i(() => [ s(h, { class: "m-l-55", label: e("验证码"), name: "code", "label-col": { span: 8 }, "wrapper-col": { span: 16 } }, { default: i(() => [ l("div", Sa, [ s(F, { value: M.code, "onUpdate:value": t[4] || (t[4] = (p) => M.code = p), style: { width: "200px" }, placeholder: e("4 位数字") }, null, 8, ["value", "placeholder"]), s(C, { disabled: w.value, type: "link", style: Z({ color: w.value ? "var(--s-text-color-disabled)" : "var(--s-color)" }), class: "phone-verify-button", onClick: _e }, { default: i(() => [ l("span", Ia, o(A.value), 1), Ue(l("div", Na, [ t[9] || (t[9] = l("span", { class: "verify-button-brackets" }, "(", -1)), s(Se, { value: D.value, format: "s", class: "button-number", onFinish: me }, null, 8, ["value"]), t[10] || (t[10] = l("span", null, "s", -1)), t[11] || (t[11] = l("span", { class: "verify-button-brackets" }, ")", -1)) ], 512), [ [Te, w.value] ]) ]), _: 1 }, 8, ["disabled", "style"]) ]) ]), _: 1 }, 8, ["label"]), s(h, { class: "m-l-55", "wrapper-col": { span: 24 } }, { default: i(() => [ l("div", Va, [ s(C, { onClick: oe }, { default: i(() => [ V(o(e("上一步")), 1) ]), _: 1 }), s(C, { type: "primary", "html-type": "submit", loading: _.value }, { default: i(() => [ V(o(e("下一步")), 1) ]), _: 1 }, 8, ["loading"]) ]) ]), _: 1 }) ]), _: 1 }, 8, ["model"]) ])) : (x(), P("div", ya, [ t[8] || (t[8] = l("i", { class: "error-icon" }, "⚠", -1)), l("span", ka, o(e("未登记预留手机号/邮箱,无法在线激活,请联系管理员")), 1) ])), r.value ? R("", !0) : (x(), P("div", Fa, [ s(C, { onClick: oe }, { default: i(() => [ V(o(e("上一步")), 1) ]), _: 1 }) ])) ])) : R("", !0), f.value === 2 ? (x(), P("div", Aa, [ l("h2", Ra, o(e("设置登录密码")), 1), l("p", Ua, o(e("身份验证通过,请为账号")) + " " + o(E.value) + " " + o(e("设置登录密码,激活后使用该密码登录。")), 1), s(Q, { ref_key: "formRef2", ref: ae, class: "activate-form", model: y, rules: ve, onFinish: Ce, onFinishFailed: ye }, { default: i(() => [ s(h, { label: e("密码"), name: "password", "label-col": { span: 8 }, "wrapper-col": { span: 16 }, "validate-status": z.value, help: L.value }, { default: i(() => [ s(F, { value: y.password, "onUpdate:value": t[5] || (t[5] = (p) => y.password = p), type: "password", placeholder: e("请设置登录密码"), onChange: ge }, null, 8, ["value", "placeholder"]), l("div", Ta, [ l("div", { class: Y(["strength-item", { active: k.value >= 1 }]), style: Z(H(1)) }, null, 6), l("div", { class: Y(["strength-item", { active: k.value >= 2 }]), style: Z(H(2)) }, null, 6), l("div", { class: Y(["strength-item", { active: k.value >= 3 }]), style: Z(H(3)) }, null, 6) ]), l("div", Ea, [ l("p", null, "✓ " + o(e("长度为 8~16 位")), 1), l("p", null, "✓ " + o(e("必须同时包含:大小写字母、数字、特殊字符")), 1) ]) ]), _: 1 }, 8, ["label", "validate-status", "help"]), s(h, { label: e("确认密码"), name: "confirmPassword", "label-col": { span: 8 }, "wrapper-col": { span: 16 }, "validate-status": I.value, help: N.value }, { default: i(() => [ s(F, { value: y.confirmPassword, "onUpdate:value": t[6] || (t[6] = (p) => y.confirmPassword = p), type: "password", placeholder: e("请再次输入密码"), onChange: be }, null, 8, ["value", "placeholder"]) ]), _: 1 }, 8, ["label", "validate-status", "help"]), s(h, { class: "m-l-55", "wrapper-col": { span: 24 } }, { default: i(() => [ l("div", za, [ s(C, { onClick: ke }, { default: i(() => [ V(o(e("上一步")), 1) ]), _: 1 }), s(C, { type: "primary", "html-type": "submit", loading: _.value }, { default: i(() => [ V(o(e("下一步")), 1) ]), _: 1 }, 8, ["loading"]) ]) ]), _: 1 }) ]), _: 1 }, 8, ["model"]) ])) : R("", !0), f.value === 3 ? (x(), P("div", La, [ l("div", Ma, [ l("img", { style: { width: "60px" }, src: Ee(He), alt: e("成功") }, null, 8, qa) ]), l("h2", Da, o(e("账号激活成功")), 1), l("p", Oa, o(e("您的账号已成功激活,今后请使用账号 + 新密码登录统一信息平台。")), 1), l("div", Ba, [ l("div", Za, [ l("span", ja, o(e("账号")), 1), l("span", Ja, o(E.value), 1) ]), l("div", Ga, [ l("span", Ha, o(r.value === "telphone" ? e("绑定手机号") : e("绑定邮箱")), 1), l("span", Ka, o(O.value), 1) ]), l("div", Qa, [ l("span", Wa, o(e("激活时间")), 1), l("span", Xa, o(te.value), 1) ]) ]), l("div", Ya, [ s(C, { type: "primary", onClick: se }, { default: i(() => [ V(o(e("返回登录")), 1) ]), _: 1 }) ]) ])) : R("", !0) ]), _: 1 }) ]), l("div", et, o(e("无法使用预留联系方式接收验证码?请联系管理员")), 1) ]); }; } }), pt = /* @__PURE__ */ Me(at, [["__scopeId", "data-v-135ab6bd"]]); export { pt as default };