|
|
|
|
@ -1,73 +1,57 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="login-container">
|
|
|
|
|
<div ref="formContainer" class="form-container">
|
|
|
|
|
<template v-if="!userStore.isLogin">
|
|
|
|
|
<div class="title-container">
|
|
|
|
|
<img :src="require('@/assets/imgs/login-title.png')" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0 41px 0 104px;
|
|
|
|
|
margin-top: 57px;
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<div class="left">
|
|
|
|
|
<img :src="require('@/assets/imgs/login-img1.png')" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="loginFormRef"
|
|
|
|
|
:model="loginForm"
|
|
|
|
|
:rules="loginRules"
|
|
|
|
|
class="login-form"
|
|
|
|
|
auto-complete="on"
|
|
|
|
|
label-position="left"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item class="form-item" prop="username">
|
|
|
|
|
<el-form
|
|
|
|
|
ref="loginFormRef"
|
|
|
|
|
:model="loginForm"
|
|
|
|
|
:rules="loginRules"
|
|
|
|
|
class="login-form"
|
|
|
|
|
auto-complete="on"
|
|
|
|
|
label-position="left"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item class="form-item" prop="username">
|
|
|
|
|
<span class="svg-container">
|
|
|
|
|
<svg-icon icon-class="user" />
|
|
|
|
|
</span>
|
|
|
|
|
<el-input
|
|
|
|
|
ref="username"
|
|
|
|
|
v-model:value="loginForm.username"
|
|
|
|
|
placeholder="请输入账号"
|
|
|
|
|
name="username"
|
|
|
|
|
type="text"
|
|
|
|
|
tabindex="1"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item class="form-item" prop="password">
|
|
|
|
|
<el-input
|
|
|
|
|
ref="username"
|
|
|
|
|
v-model:value="loginForm.username"
|
|
|
|
|
placeholder="请输入账号"
|
|
|
|
|
name="username"
|
|
|
|
|
type="text"
|
|
|
|
|
tabindex="1"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item class="form-item" prop="password">
|
|
|
|
|
<span class="svg-container">
|
|
|
|
|
<svg-icon icon-class="password" />
|
|
|
|
|
</span>
|
|
|
|
|
<el-input
|
|
|
|
|
:key="pwdType"
|
|
|
|
|
ref="password"
|
|
|
|
|
v-model:value="loginForm.password"
|
|
|
|
|
:type="pwdType"
|
|
|
|
|
placeholder="请输入密码"
|
|
|
|
|
name="password"
|
|
|
|
|
tabindex="2"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
@keyup.enter.native="handleLogin"
|
|
|
|
|
/>
|
|
|
|
|
<span class="show-pwd" @click="showPwd">
|
|
|
|
|
<el-input
|
|
|
|
|
:key="pwdType"
|
|
|
|
|
ref="password"
|
|
|
|
|
v-model:value="loginForm.password"
|
|
|
|
|
:type="pwdType"
|
|
|
|
|
placeholder="请输入密码"
|
|
|
|
|
name="password"
|
|
|
|
|
tabindex="2"
|
|
|
|
|
auto-complete="off"
|
|
|
|
|
@keyup.enter.native="handleLogin"
|
|
|
|
|
/>
|
|
|
|
|
<span class="show-pwd" @click="showPwd">
|
|
|
|
|
<svg-icon :icon-class="pwdType === 'password' ? 'eye' : 'eye-open'" />
|
|
|
|
|
</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-checkbox size="large" style="margin-top: 18px;zoom: 1.3;" v-model="isRemember">记住密码</el-checkbox>
|
|
|
|
|
<el-checkbox size="large" style="margin-top: 18px;zoom: 1.3;" v-model="isRemember">记住密码</el-checkbox>
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
:loading="loading"
|
|
|
|
|
type="primary"
|
|
|
|
|
round
|
|
|
|
|
style="
|
|
|
|
|
<el-button
|
|
|
|
|
:loading="loading"
|
|
|
|
|
type="primary"
|
|
|
|
|
round
|
|
|
|
|
style="
|
|
|
|
|
margin-top: 35px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
letter-spacing: 3px;
|
|
|
|
|
@ -77,72 +61,10 @@
|
|
|
|
|
background-color: #3d7af6;
|
|
|
|
|
filter: drop-shadow(0px 4px 9px rgba(72, 93, 237, 0.63));
|
|
|
|
|
"
|
|
|
|
|
@click.native.prevent="handleLogin"
|
|
|
|
|
>登录</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div class="title-container">
|
|
|
|
|
<img :src="require('@/assets/imgs/login-title.png')" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0 41px 0 104px;
|
|
|
|
|
margin-top: 57px;
|
|
|
|
|
"
|
|
|
|
|
@click.native.prevent="handleLogin"
|
|
|
|
|
>登录</el-button
|
|
|
|
|
>
|
|
|
|
|
<div class="left">
|
|
|
|
|
<img :src="require('@/assets/imgs/login-img1.png')" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<el-descriptions title="用户信息" :column="2">
|
|
|
|
|
<el-descriptions-item label="用户名">{{ userStore.info.name }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="手机号">{{ userStore.info.mobile }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="职位">{{ userStore.info.position }}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="部门">
|
|
|
|
|
<el-tag size="small">{{ userStore.info.department ? userStore.info.department.name : "" }}</el-tag>
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
<div style="display: flex;justify-content: space-between;align-items: center;">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
round
|
|
|
|
|
style="
|
|
|
|
|
width: 44%;
|
|
|
|
|
margin-top: 35px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
letter-spacing: 3px;
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
background-color: #3d7af6;
|
|
|
|
|
filter: drop-shadow(0px 4px 9px rgba(72, 93, 237, 0.63));
|
|
|
|
|
"
|
|
|
|
|
@click.native.prevent="toAdmin"
|
|
|
|
|
>进入后台</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
round
|
|
|
|
|
style="
|
|
|
|
|
width: 44%;
|
|
|
|
|
margin-top: 35px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
letter-spacing: 3px;
|
|
|
|
|
border-radius: 50px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
filter: drop-shadow(0px 4px 9px rgba(219, 79, 43, 0.63));
|
|
|
|
|
"
|
|
|
|
|
@click.native.prevent="handleLogout"
|
|
|
|
|
>退出登录</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
@ -158,10 +80,6 @@ import { useRouter } from "@/hooks/use-router";
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
|
|
|
|
init(".form-container")
|
|
|
|
|
if (userStore.token) {
|
|
|
|
|
userStore.getUserInfo()
|
|
|
|
|
}
|
|
|
|
|
const validateUsername = (rule, value, callback) => {
|
|
|
|
|
if (!isvalidUsername(value)) {
|
|
|
|
|
callback(new Error("请输入正确的用户名"));
|
|
|
|
|
@ -226,7 +144,13 @@ const handleLogin = () => {
|
|
|
|
|
|
|
|
|
|
userStore.login(loginForm.value).then(res => {
|
|
|
|
|
loading.value = false;
|
|
|
|
|
ipcRenderer.invoke("create-admin-window")
|
|
|
|
|
//ipcRenderer.invoke("create-admin-window")
|
|
|
|
|
ipcRenderer.invoke("toggle-main-window-resizable",true)
|
|
|
|
|
ipcRenderer.invoke("main-window-resize",{
|
|
|
|
|
width: 1200,
|
|
|
|
|
height: 800
|
|
|
|
|
})
|
|
|
|
|
router.push('/')
|
|
|
|
|
if (isRemember.value) {
|
|
|
|
|
window.localStorage.setItem('lgif',window.btoa(JSON.stringify(loginForm.value)))
|
|
|
|
|
} else {
|
|
|
|
|
@ -319,20 +243,8 @@ $light_gray: #eee;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.form-container {
|
|
|
|
|
transition: all .2s;
|
|
|
|
|
width: 930px;
|
|
|
|
|
max-width: 100vw;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 14px;
|
|
|
|
|
padding-bottom: 53px;
|
|
|
|
|
filter: drop-shadow(0px 5px 24.5px rgba(74, 113, 240, 0.23));
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
img {
|
|
|
|
|
width: 310px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tips {
|
|
|
|
|
@ -347,13 +259,6 @@ $light_gray: #eee;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-item {
|
|
|
|
|
width: 361px;
|
|
|
|
|
height: 51px;
|
|
|
|
|
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.svg-container {
|
|
|
|
|
padding: 6px 0;
|
|
|
|
|
color: $dark_gray;
|
|
|
|
|
@ -364,16 +269,6 @@ $light_gray: #eee;
|
|
|
|
|
margin-left: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.title-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
position: relative;
|
|
|
|
|
margin-top: 85px;
|
|
|
|
|
img {
|
|
|
|
|
width: 754px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.show-pwd {
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 10px;
|
|
|
|
|
|