字典管理ok
This commit is contained in:
@@ -1,68 +1,68 @@
|
||||
<template>
|
||||
<div @keyup.enter="onSubmit(formRef)">
|
||||
<div @contextmenu.stop="" id="bubble" class="bubble">
|
||||
<canvas id="bubble-canvas" class="bubble-canvas"></canvas>
|
||||
<div @keyup.enter='onSubmit(formRef)'>
|
||||
<div @contextmenu.stop='' id='bubble' class='bubble'>
|
||||
<canvas id='bubble-canvas' class='bubble-canvas'></canvas>
|
||||
</div>
|
||||
<div class="login-image"></div>
|
||||
<div class="login-container-form">
|
||||
<div class="title-container">
|
||||
<div class="title">
|
||||
<span style="font-size: 28px">电能质量数据监测云平台</span>
|
||||
<div class='login-image'></div>
|
||||
<div class='login-container-form'>
|
||||
<div class='title-container'>
|
||||
<div class='title'>
|
||||
<span style='font-size: 28px'>电能质量数据监测云平台</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-form :rules="rules" ref="formRef" size="large" class="login-form" :model="form">
|
||||
<el-form-item prop="username">
|
||||
<el-form :rules='rules' ref='formRef' size='large' class='login-form' :model='form'>
|
||||
<el-form-item prop='username'>
|
||||
<el-input
|
||||
ref="usernameRef"
|
||||
v-model="form.username"
|
||||
type="text"
|
||||
ref='usernameRef'
|
||||
v-model='form.username'
|
||||
type='text'
|
||||
clearable
|
||||
placeholder="用户名"
|
||||
autocomplete="off"
|
||||
placeholder='用户名'
|
||||
autocomplete='off'
|
||||
>
|
||||
<template #prefix>
|
||||
<span class="iconfont icon-yonghu" style="color: #003078"></span>
|
||||
<span class='iconfont icon-yonghu' style='color: #003078'></span>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-form-item prop='password'>
|
||||
<el-input
|
||||
ref="passwordRef"
|
||||
v-model="form.password"
|
||||
type="password"
|
||||
placeholder="密码"
|
||||
ref='passwordRef'
|
||||
v-model='form.password'
|
||||
type='password'
|
||||
placeholder='密码'
|
||||
show-password
|
||||
autocomplete="off"
|
||||
autocomplete='off'
|
||||
>
|
||||
<template #prefix>
|
||||
<span class="iconfont icon-mima" style="color: #003078"></span>
|
||||
<span class='iconfont icon-mima' style='color: #003078'></span>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
:loading="state.submitLoading"
|
||||
class="submit-btn"
|
||||
:loading='state.submitLoading'
|
||||
class='submit-btn'
|
||||
round
|
||||
type="info"
|
||||
@click="onSubmit(formRef)"
|
||||
type='info'
|
||||
@click='onSubmit(formRef)'
|
||||
>
|
||||
登录
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="copy-right">
|
||||
<div class='copy-right'>
|
||||
<span>版权所有 @ 南京灿能电力自动化股份有限公司</span>
|
||||
<br />
|
||||
<img style="width: 20px; height: 20px; position: absolute" src="@/assets/login/jhui.png" />
|
||||
<img style='width: 20px; height: 20px; position: absolute' src='@/assets/login/jhui.png' />
|
||||
|
||||
<span> 苏公网安备 32011502011902号</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
<script setup lang='ts'>
|
||||
import { onMounted, onBeforeUnmount, reactive, ref, nextTick } from 'vue'
|
||||
import * as pageBubble from '@/utils/pageBubble'
|
||||
import { sm3Digest } from '@/assets/commjs/sm3.js'
|
||||
@@ -74,6 +74,7 @@ import type { FormInstance, InputInstance, FormRules } from 'element-plus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ADMIN_INFO } from '@/stores/constant/cacheKey'
|
||||
import { Local } from '@/utils/storage'
|
||||
|
||||
const router = useRouter()
|
||||
let timer: number
|
||||
|
||||
@@ -82,13 +83,14 @@ const usernameRef = ref<InputInstance>()
|
||||
const passwordRef = ref<InputInstance>()
|
||||
const userInfo = useAdminInfo()
|
||||
|
||||
Local.remove(ADMIN_INFO)
|
||||
Local.remove(ADMIN_INFO)
|
||||
userInfo.removeToken()
|
||||
|
||||
interface RuleForm {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
const state = reactive({
|
||||
showCaptcha: false,
|
||||
submitLoading: false
|
||||
@@ -137,7 +139,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
imageCode: '',
|
||||
verifyCode: 0
|
||||
}).then(res => {
|
||||
res.data.loginName = encrypt(form.username)
|
||||
res.data.loginName = encrypt(form.username)
|
||||
userInfo.dataFill(res.data)
|
||||
state.submitLoading = false
|
||||
router.push({
|
||||
@@ -153,7 +155,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
<style scoped lang='scss'>
|
||||
.bubble {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
@@ -192,21 +194,25 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
border-radius: 30px;
|
||||
transform: translate(-85%, -50%);
|
||||
box-shadow: 3px 3px 2px 2px #011b2bab;
|
||||
|
||||
.title-container {
|
||||
position: relative;
|
||||
width: 398px;
|
||||
max-width: 100%;
|
||||
padding: 20px 0 0;
|
||||
margin: 0 auto;
|
||||
|
||||
.title {
|
||||
margin-bottom: 20px;
|
||||
font-size: 33px;
|
||||
font-weight: 600;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
text-align: center;
|
||||
|
||||
& :v-deep .svg-icon {
|
||||
// color: $;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
@@ -216,6 +222,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
position: relative;
|
||||
width: 368px;
|
||||
@@ -224,6 +231,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
margin: 0 auto;
|
||||
margin-bottom: 20px;
|
||||
overflow: hidden;
|
||||
|
||||
&.el-input {
|
||||
input {
|
||||
height: 40px;
|
||||
@@ -232,6 +240,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
line-height: 40px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.el-input__prefix,
|
||||
.el-input__suffix {
|
||||
width: 40px;
|
||||
@@ -242,14 +251,17 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
vertical-align: -0.25em;
|
||||
}
|
||||
}
|
||||
|
||||
.el-input__prefix {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.el-input__suffix {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.copy-right {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
@@ -258,9 +270,11 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
color: rgb(233, 229, 229);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
:v-deep.el-form-item--large {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
margin-top: 0px;
|
||||
@@ -268,6 +282,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
background: #4d6ea1;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 720px) {
|
||||
.login {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user