1 line
6.2 KiB
JavaScript
1 line
6.2 KiB
JavaScript
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["chunk-48ee0a14"], { "96c6": function (e, t, a) { }, "9ed6": function (e, t, a) { "use strict"; a.r(t); var c = a("7a23"), o = (a("5d2d"), a("2295")); a("7902"), a("6797"), a("d9e2"); const l = () => (e, t, a) => { t.length < 6 ? a(new Error("密码不能少于6位")) : a() }; var r = a("5502"), n = a("6605"); const s = e => (Object(c["pushScopeId"])("data-v-75963f3f"), e = e(), Object(c["popScopeId"])(), e), d = { class: "login-container" }, p = s(() => Object(c["createElementVNode"])("div", { class: "title-container" }, [Object(c["createElementVNode"])("h3", { class: "title" }, "用户登录")], -1)), u = { class: "svg-container" }, b = { class: "svg-container" }, i = { class: "show-pwd" }, j = { class: "svg-container" }, O = { class: "image-slot" }, m = Object(c["createTextVNode"])("登录"), v = { name: "login" }; var h = Object.assign(v, { setup(e) { const t = Object(r["b"])(), a = Object(c["ref"])(""), s = Object(c["ref"])({ userName: "", password: "", kaptcha: "" }), v = Object(c["ref"])(!1), h = Object(c["ref"])([]), w = Object(c["ref"])(""), V = Object(c["ref"])(""), f = Object(c["ref"])(!1), k = Object(c["ref"])({ userName: [{ required: !0, trigger: "blur", message: "用户名为必填项" }], password: [{ required: !0, trigger: "blur", validator: l() }], kaptcha: [{ required: !0, trigger: "blur", message: "验证码为必填项" }] }), N = e => { t.dispatch("user/refreshToken", { deptId: e, jwtToken: V.value }).then(a => { x.value = !1, t.commit("user/setDeptId", e), _.push("/") }).catch(() => { x.value = !1 }) }, g = Object(c["ref"])("password"), C = () => { "password" === g.value ? g.value = "text" : g.value = "password" }, x = Object(c["ref"])(!1), y = Object(c["ref"])(null), _ = Object(n["d"])(), B = () => { y.value.validate(e => { if (!e) return !1; x.value = !0, t.dispatch("user/login", s.value).then(e => { x.value = !1, 1 === e.deptList.length ? _.push("/") : (h.value = [...e.deptList], v.value = !0, V.value = e.jwtToken, Object(o["a"])({ title: "提示", message: "请选择部门", duration: 3e3 })) }).catch(() => { x.value = !1 }) }) }; Object(c["onMounted"])(() => { }); const E = () => { const e = "http://123.60.67.142/mosty-base/kaptcha?date=" + new Date; a.value = e }; return (e, t) => { const o = Object(c["resolveComponent"])("svg-icon"), l = Object(c["resolveComponent"])("el-input"), r = Object(c["resolveComponent"])("el-form-item"), n = Object(c["resolveComponent"])("el-image"), V = Object(c["resolveComponent"])("el-button"), _ = Object(c["resolveComponent"])("el-option"), I = Object(c["resolveComponent"])("el-select"), T = Object(c["resolveComponent"])("el-form"); return Object(c["openBlock"])(), Object(c["createElementBlock"])("div", d, [Object(c["createVNode"])(T, { class: "login-form", ref_key: "loginFromRef", ref: y, model: s.value, rules: k.value, onSubmit: t[5] || (t[5] = Object(c["withModifiers"])(() => { }, ["prevent"])) }, { default: Object(c["withCtx"])(() => [p, Object(c["createVNode"])(r, { prop: "userName" }, { default: Object(c["withCtx"])(() => [Object(c["createVNode"])(l, { placeholder: "请输入账号", name: "userName", type: "text", modelValue: s.value.userName, "onUpdate:modelValue": t[0] || (t[0] = e => s.value.userName = e) }, { prepend: Object(c["withCtx"])(() => [Object(c["createElementVNode"])("span", u, [Object(c["createVNode"])(o, { icon: "user" })])]), _: 1 }, 8, ["modelValue"])]), _: 1 }), Object(c["createVNode"])(r, { prop: "password1" }, { default: Object(c["withCtx"])(() => [Object(c["createVNode"])(l, { placeholder: "请输入密码", name: "password", type: g.value, modelValue: s.value.password, "onUpdate:modelValue": t[1] || (t[1] = e => s.value.password = e) }, { prepend: Object(c["withCtx"])(() => [Object(c["createElementVNode"])("span", b, [Object(c["createVNode"])(o, { icon: "password" })])]), append: Object(c["withCtx"])(() => [Object(c["createElementVNode"])("span", i, [Object(c["createVNode"])(o, { onClick: C, icon: "password" === g.value ? "eye" : "eye-open" }, null, 8, ["icon"])])]), _: 1 }, 8, ["type", "modelValue"])]), _: 1 }), f.value ? (Object(c["openBlock"])(), Object(c["createBlock"])(r, { key: 0, prop: "kaptcha" }, { default: Object(c["withCtx"])(() => [Object(c["createElementVNode"])("span", j, [Object(c["createVNode"])(o, { icon: "kaptcha" })]), Object(c["createVNode"])(l, { onKeydown: t[2] || (t[2] = Object(c["withKeys"])(e => B(), ["enter"])), modelValue: s.value.kaptcha, "onUpdate:modelValue": t[3] || (t[3] = e => s.value.kaptcha = e), placeholder: "请输入验证码", name: "kaptcha", type: "text" }, null, 8, ["modelValue"]), Object(c["createElementVNode"])("span", { onClick: E }, [Object(c["createVNode"])(n, { class: "show-kaptcha", src: a.value, fit: "cover" }, { error: Object(c["withCtx"])(() => [Object(c["createElementVNode"])("div", O, [Object(c["createVNode"])(o, { icon: "errorImg" })])]), _: 1 }, 8, ["src"])])]), _: 1 })) : Object(c["createCommentVNode"])("", !0), v.value ? Object(c["createCommentVNode"])("", !0) : (Object(c["openBlock"])(), Object(c["createBlock"])(r, { key: 1, style: { height: "49px" } }, { default: Object(c["withCtx"])(() => [Object(c["createVNode"])(V, { onClick: B, type: "primary", style: { width: "520px", height: "49px" }, loading: x.value, "native-type": "submit" }, { default: Object(c["withCtx"])(() => [m]), _: 1 }, 8, ["loading"])]), _: 1 })), v.value ? (Object(c["openBlock"])(), Object(c["createBlock"])(r, { key: 2, class: "choosedept-wrap" }, { default: Object(c["withCtx"])(() => [Object(c["createVNode"])(I, { modelValue: w.value, "onUpdate:modelValue": t[4] || (t[4] = e => w.value = e), onChange: N, placeholder: "请选择部门" }, { default: Object(c["withCtx"])(() => [(Object(c["openBlock"])(!0), Object(c["createElementBlock"])(c["Fragment"], null, Object(c["renderList"])(h.value, e => (Object(c["openBlock"])(), Object(c["createBlock"])(_, { key: e.deptId, label: e.deptName, value: e.deptId }, null, 8, ["label", "value"]))), 128))]), _: 1 }, 8, ["modelValue"])]), _: 1 })) : Object(c["createCommentVNode"])("", !0)]), _: 1 }, 8, ["model", "rules"])]) } } }), w = (a("ddbc"), a("d959")), V = a.n(w); const f = V()(h, [["__scopeId", "data-v-75963f3f"]]); t["default"] = f }, ddbc: function (e, t, a) { "use strict"; a("96c6") } }]); |