dldiscuss
Version:
#### 介绍 {**以下是 Gitee 平台说明,您可以替换此简介** Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
186 lines (185 loc) • 6.72 kB
JavaScript
import { ElMessage as C } from "element-plus";
import { j as S, k as V, s as b, m as k, n as x, _ as B } from "./discussCom-BiaeqCV0.mjs";
import { defineComponent as h, openBlock as m, createElementBlock as _, createElementVNode as n, ref as F, reactive as N, resolveComponent as d, createVNode as l, Transition as z, withCtx as c, withKeys as f, createTextVNode as K, toDisplayString as I, pushScopeId as A, popScopeId as D } from "vue";
import { useRouter as L } from "vue-router";
import { decrypt as M, code as g } from "dl-components";
var v = (e, a) => {
const o = e.__vccOpts || e;
for (const [t, r] of a)
o[t] = r;
return o;
};
const U = h({
name: "Lock"
}), E = {
viewBox: "0 0 1024 1024",
xmlns: "http://www.w3.org/2000/svg"
}, H = /* @__PURE__ */ n("path", {
fill: "currentColor",
d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32H224zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96z"
}, null, -1), O = /* @__PURE__ */ n("path", {
fill: "currentColor",
d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32zm192-160v-64a192 192 0 1 0-384 0v64h384zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64z"
}, null, -1), T = [
H,
O
];
function j(e, a, o, t, r, s) {
return m(), _("svg", E, T);
}
var q = /* @__PURE__ */ v(U, [["render", j]]);
const P = h({
name: "User"
}), J = {
viewBox: "0 0 1024 1024",
xmlns: "http://www.w3.org/2000/svg"
}, R = /* @__PURE__ */ n("path", {
fill: "currentColor",
d: "M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384zm0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512zm320 320v-96a96 96 0 0 0-96-96H288a96 96 0 0 0-96 96v96a32 32 0 1 1-64 0v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 1 1-64 0z"
}, null, -1), Y = [
R
];
function G(e, a, o, t, r, s) {
return m(), _("svg", J, Y);
}
var Q = /* @__PURE__ */ v(P, [["render", G]]);
const W = {
name: "Login",
setup() {
const e = F(), a = L(), o = N({
form: {
appKey: "c44355bc-a765-11ec-a3e1-00163e35bfe4",
// 蜜蜂合议
// appKey: 'c44355bc-a765-11ec-a3e1-00163e35bfe8', // 猎豹
loginName: "",
pwd: "",
loading: !1
},
rules: {
loginName: [
{
required: !0,
message: "用户名不能为空",
trigger: "blur"
}
],
pwd: [
{
required: !0,
message: "密码不能为空",
trigger: "blur"
}
]
}
}), t = async () => {
e.value.validate((s) => {
if (s) {
o.form.loading = !0;
let i = o.form;
S({
appKey: i.appKey,
loginName: i.loginName,
pwd: V.encode("" + i.pwd)
}).then((u) => {
r(u), o.form.loading = !1;
}).catch(() => {
o.form.loading = !1;
});
}
});
}, r = async (s) => {
s = JSON.parse(M(s)), localStorage.setItem(g, s[g]), sessionStorage.setItem("oldPathName", location.pathname), b(s.token), k(s.sysAppServerList), x(o.form.appKey), C.success("登录成功"), a.push({ name: "home" });
};
return {
...o,
User: Q,
Lock: q,
handleSubmit: t,
ruleForm: e
};
}
}, w = (e) => (A("data-v-a12a6ed6"), e = e(), D(), e), X = { class: "login" }, Z = { class: "login-container" }, ee = { class: "login-form" }, oe = /* @__PURE__ */ w(() => /* @__PURE__ */ n("div", { class: "login-title" }, [
/* @__PURE__ */ n("div", null, "欢迎登录")
], -1)), te = { class: "login-content" }, ne = /* @__PURE__ */ w(() => /* @__PURE__ */ n("p", { class: "login-tip" }, "请输入用户名和密码", -1)), ae = { class: "login-bot" };
function se(e, a, o, t, r, s) {
const i = d("el-input"), u = d("el-form-item"), y = d("el-button"), $ = d("el-form");
return m(), _("div", X, [
n("div", Z, [
l(z, { name: "fade" }, {
default: c(() => [
n("div", ee, [
oe,
n("div", te, [
l($, {
ref: "ruleForm",
model: e.form,
rules: e.rules
}, {
default: c(() => [
l(u, { prop: "loginName" }, {
default: c(() => [
l(i, {
modelValue: e.form.loginName,
"onUpdate:modelValue": a[0] || (a[0] = (p) => e.form.loginName = p),
class: "login-input",
size: "large",
"prefix-icon": t.User,
placeholder: "账号",
type: "text",
onKeyup: f(t.handleSubmit, ["enter"])
}, null, 8, ["modelValue", "prefix-icon", "onKeyup"])
]),
_: 1
}),
l(u, { prop: "pwd" }, {
default: c(() => [
l(i, {
modelValue: e.form.pwd,
"onUpdate:modelValue": a[1] || (a[1] = (p) => e.form.pwd = p),
class: "login-input",
size: "large",
"prefix-icon": t.Lock,
placeholder: "密码",
type: "password",
"show-password": "",
onKeyup: f(t.handleSubmit, ["enter"])
}, null, 8, ["modelValue", "prefix-icon", "onKeyup"])
]),
_: 1
}),
l(u, null, {
default: c(() => [
l(y, {
size: "large",
loading: e.form.loading,
long: "",
type: "primary",
onClick: t.handleSubmit
}, {
default: c(() => [
K("登录")
]),
_: 1
}, 8, ["loading", "onClick"])
]),
_: 1
})
]),
_: 1
}, 8, ["model", "rules"]),
ne
])
])
]),
_: 1
})
]),
n("div", ae, [
n("span", null, "©" + I((/* @__PURE__ */ new Date()).getFullYear()) + " 深轻科技 | 沪ICP备2020037756号", 1)
])
]);
}
const de = /* @__PURE__ */ B(W, [["render", se], ["__scopeId", "data-v-a12a6ed6"]]);
export {
de as default
};