|
|
|
@ -1,56 +1,56 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="login-container"> |
|
|
|
<div class="login-page"> |
|
|
|
<canvas id="login-background"/> |
|
|
|
<canvas id="login-background"/> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" autocomplete="on" class="login-form" label-position="left"> |
|
|
|
<div class="login-container"> |
|
|
|
<div class="title-container"> |
|
|
|
<div class="title">进销存管理系统</div> |
|
|
|
<h3 class="title">进销存管理系统</h3> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" autocomplete="on" label-position="left"> |
|
|
|
</div> |
|
|
|
<el-form-item prop="username"> |
|
|
|
<el-form-item prop="username"> |
|
|
|
|
|
|
|
<span class="svg-container"> |
|
|
|
<span class="svg-container"> |
|
|
|
<svg-icon icon="user"/> |
|
|
|
<svg-icon icon="user"/> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
ref="username" |
|
|
|
ref="username" |
|
|
|
v-model="form.username" |
|
|
|
v-model="form.username" |
|
|
|
:maxlength="20" |
|
|
|
:maxlength="20" |
|
|
|
autocomplete="on" |
|
|
|
autocomplete="on" |
|
|
|
name="username" |
|
|
|
name="username" |
|
|
|
placeholder="请输入用户名" |
|
|
|
placeholder="请输入用户名" |
|
|
|
type="text" |
|
|
|
type="text" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-tooltip v-model="capsTooltip" :tabindex="-1" content="大写锁定已打开" manual placement="left"> |
|
|
|
<el-tooltip v-model="capsTooltip" :tabindex="-1" content="大写锁定已打开" manual placement="left"> |
|
|
|
<span class="svg-container"> |
|
|
|
<span class="svg-container"> |
|
|
|
<svg-icon icon="password"/> |
|
|
|
<svg-icon icon="password"/> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
ref="password" |
|
|
|
ref="password" |
|
|
|
v-model="form.password" |
|
|
|
v-model="form.password" |
|
|
|
:key="passwordType" |
|
|
|
:key="passwordType" |
|
|
|
:type="passwordType" |
|
|
|
:type="passwordType" |
|
|
|
:maxlength="20" |
|
|
|
:maxlength="20" |
|
|
|
autocomplete="on" |
|
|
|
autocomplete="on" |
|
|
|
name="password" |
|
|
|
name="password" |
|
|
|
placeholder="请输入密码" |
|
|
|
placeholder="请输入密码" |
|
|
|
@keyup.enter.native="login" |
|
|
|
@keyup.enter.native="login" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<span @click="showPwd" class="show-pwd"> |
|
|
|
<span @click="showPwd" class="show-pwd"> |
|
|
|
<svg-icon :icon="passwordType === 'password' ? 'eye' : 'eye-open'"/> |
|
|
|
<svg-icon :icon="passwordType === 'password' ? 'eye' : 'eye-open'"/> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-button :loading="loading" style="width: 100%" type="primary" @click="login">登录</el-button> |
|
|
|
<el-button :loading="loading" style="width: 100%" type="primary" @click="login">登录</el-button> |
|
|
|
<div class="flex" style="margin-top: 20px"> |
|
|
|
<div class="flex" style="margin-top: 20px"> |
|
|
|
<p class="other-ways"> |
|
|
|
<p class="other-ways"> |
|
|
|
其他方式登录 |
|
|
|
其他方式登录 |
|
|
|
<span v-for="i in otherWays" :key="i" @click="$message.info('假装可以第三方登录')"> |
|
|
|
<span v-for="i in otherWays" :key="i" @click="$message.info('假装可以第三方登录')"> |
|
|
|
<svg-icon :icon="i"/> |
|
|
|
<svg-icon :icon="i"/> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<el-button type="text" @click="!loading&&$router.push('/register')">注册账户</el-button> |
|
|
|
<el-button type="text" @click="!loading&&$router.push('/register')">注册账户</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
@ -100,7 +100,8 @@ |
|
|
|
success() { |
|
|
|
success() { |
|
|
|
elSuccess('登陆成功') |
|
|
|
elSuccess('登陆成功') |
|
|
|
let redirect = this.$route.query.redirect || '/' |
|
|
|
let redirect = this.$route.query.redirect || '/' |
|
|
|
window.location.href = '/#' + redirect |
|
|
|
//由于清除消息时会造成卡顿,所以延迟0.5s跳转 |
|
|
|
|
|
|
|
setTimeout(() => window.location.href = '/#' + redirect, 500) |
|
|
|
}, |
|
|
|
}, |
|
|
|
capsLockTip({keyCode}) { |
|
|
|
capsLockTip({keyCode}) { |
|
|
|
if (keyCode === 20) this.capsTooltip = !this.capsTooltip |
|
|
|
if (keyCode === 20) this.capsTooltip = !this.capsTooltip |
|
|
|
@ -116,11 +117,13 @@ |
|
|
|
if (loginBackgroundAnimate) { |
|
|
|
if (loginBackgroundAnimate) { |
|
|
|
import('@/plugin/rain') |
|
|
|
import('@/plugin/rain') |
|
|
|
.then(_ => { |
|
|
|
.then(_ => { |
|
|
|
this.rain = new _.default({ |
|
|
|
this.rain = new _.default( |
|
|
|
rainDropCount: 500, |
|
|
|
{ |
|
|
|
rainColor: 'rgba(150,180,255,0.8)', |
|
|
|
rainDropCount: 500, |
|
|
|
backgroundColor: '#2d3a4b' |
|
|
|
rainColor: 'rgba(150,180,255,0.8)', |
|
|
|
}, document.getElementById('login-background')) |
|
|
|
backgroundColor: '#2d3a4b' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
document.getElementById('login-background')) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.addCapsLockEvent() |
|
|
|
this.addCapsLockEvent() |
|
|
|
|