Commit 92398cc8 by xinla

--no commit message

1 parent ed0e5ab3
...@@ -17,7 +17,7 @@ const permission = { ...@@ -17,7 +17,7 @@ const permission = {
state.addRoutes = routes state.addRoutes = routes
state.routes = constantRoutes.concat(routes) state.routes = constantRoutes.concat(routes)
// 根据roles权限生成可访问的路由表 // 根据roles权限生成可访问的路由表
router.addRoutes(routes) routes.forEach((e) => router.addRoute(e))
}, },
SET_DEFAULT_ROUTES: (state, routes) => { SET_DEFAULT_ROUTES: (state, routes) => {
state.defaultRoutes = constantRoutes.concat(routes) state.defaultRoutes = constantRoutes.concat(routes)
......
...@@ -9,8 +9,16 @@ ...@@ -9,8 +9,16 @@
<h3 class="title">{{ lwConfig.SYSTEM_NAME }}</h3> <h3 class="title">{{ lwConfig.SYSTEM_NAME }}</h3>
<template v-if="loginType === 'account'"> <template v-if="loginType === 'account'">
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input
<svg-icon style="height: 33px;" slot="prefix" icon-class="user" class="el-input__icon input-icon" /> v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号">
<svg-icon
style="height: 33px"
slot="prefix"
icon-class="user"
class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
...@@ -19,27 +27,28 @@ ...@@ -19,27 +27,28 @@
type="password" type="password"
auto-complete="off" auto-complete="off"
placeholder="密码" placeholder="密码"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin">
> <svg-icon
<svg-icon style="height: 33px;" slot="prefix" icon-class="password" class="el-input__icon input-icon" /> style="height: 33px"
slot="prefix"
icon-class="password"
class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<div style="display: flex;"> <div style="display: flex">
<el-input <el-input
v-model="loginForm.code" v-model="loginForm.code"
auto-complete="off" auto-complete="off"
placeholder="验证码" placeholder="验证码"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin">
>
<svg-icon <svg-icon
slot="prefix" slot="prefix"
icon-class="validCode" icon-class="validCode"
style="height: 33px;" style="height: 33px"
class="el-input__icon input-icon" class="el-input__icon input-icon" />
/>
</el-input> </el-input>
<div class="login-code" style="margin-left: 10px;"> <div class="login-code" style="margin-left: 10px">
<img :src="codeUrl" @click="getCode" class="login-code-img" /> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</div> </div>
...@@ -49,27 +58,26 @@ ...@@ -49,27 +58,26 @@
class="fl" class="fl"
v-model="isDemonstrationLogin" v-model="isDemonstrationLogin"
@change="changeDemonAccount" @change="changeDemonAccount"
style="margin: 0px 0px 25px 10px;" style="margin: 0px 0px 25px 10px">
>演示账号登录</el-checkbox 演示账号登录
> </el-checkbox>
<el-form-item style="width: 100%;"> <el-form-item style="width: 100%">
<el-button <el-button
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
style="width: 100%;" style="width: 100%"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin">
>
<span v-if="!loading">登 录</span> <span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span> <span v-else>登 录 中...</span>
</el-button> </el-button>
</el-form-item> </el-form-item>
<div style="margin-bottom: 20px;"> <div style="margin-bottom: 20px">
<a @click="changeLoginType('url')" class="link">企微登录</a> <a @click="changeLoginType('url')" class="link">企微登录</a>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<img style="height: 180px; width: 180px;" :src="wechatCodeUrl" alt="" /> <img style="height: 180px; width: 180px" :src="wechatCodeUrl" alt="" />
<!-- <div class="desc al">企业注册后,员工可直接扫码登录,无需重复注册</div> --> <!-- <div class="desc al">企业注册后,员工可直接扫码登录,无需重复注册</div> -->
<div class="desc al">扫码加入企业,点击企业微信登录,即可扫码登录系统</div> <div class="desc al">扫码加入企业,点击企业微信登录,即可扫码登录系统</div>
<el-form-item class="ac"> <el-form-item class="ac">
...@@ -79,11 +87,10 @@ ...@@ -79,11 +87,10 @@
srcset=" srcset="
//wwcdn.weixin.qq.com/node/wwopen/wwopenmng/style/images/independent/brand/300x40_white_2x$6a1f5234.png 2x //wwcdn.weixin.qq.com/node/wwopen/wwopenmng/style/images/independent/brand/300x40_white_2x$6a1f5234.png 2x
" "
alt="点我加入企业微信" alt="点我加入企业微信" />
/>
</a> </a>
</el-form-item> </el-form-item>
<div style="margin-bottom: 20px;"> <div style="margin-bottom: 20px">
<a @click="changeLoginType('account')" class="link">账号密码登录</a> <a @click="changeLoginType('account')" class="link">账号密码登录</a>
</div> </div>
</template> </template>
...@@ -93,17 +100,19 @@ ...@@ -93,17 +100,19 @@
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>{{ lwConfig.COPYRIGHT || 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.' }}</span> <span>
{{ lwConfig.COPYRIGHT || 'Copyright © 2018-2022 LinkWeChat All Rights Reserved.' }}
</span>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getCodeImg, getCodeInSyetem } from '@/api/login' import { getCodeImg, getCodeInSyetem } from '@/api/login'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from '@/utils/jsencrypt'
export default { export default {
name: 'Login', name: 'Login',
data() { data() {
return { return {
...@@ -116,18 +125,18 @@ ...@@ -116,18 +125,18 @@
password: '', password: '',
rememberMe: false, rememberMe: false,
code: '', code: '',
uuid: '' uuid: '',
}, },
loginRules: { loginRules: {
username: [{ required: true, trigger: 'blur', message: '用户名不能为空' }], username: [{ required: true, trigger: 'blur', message: '用户名不能为空' }],
password: [{ required: true, trigger: 'blur', message: '密码不能为空' }], password: [{ required: true, trigger: 'blur', message: '密码不能为空' }],
code: [{ required: true, trigger: 'change', message: '验证码不能为空' }] code: [{ required: true, trigger: 'change', message: '验证码不能为空' }],
}, },
authLink: '', authLink: '',
loading: false, loading: false,
redirect: undefined, redirect: undefined,
dialogVisible: true, dialogVisible: true,
isDemonstrationLogin: false isDemonstrationLogin: false,
} }
}, },
watch: { watch: {
...@@ -135,8 +144,8 @@ ...@@ -135,8 +144,8 @@
handler: function (route) { handler: function (route) {
this.redirect = route.query && route.query.redirect this.redirect = route.query && route.query.redirect
}, },
immediate: true immediate: true,
} },
}, },
created() { created() {
getCodeInSyetem().then(({ data, code, msg }) => { getCodeInSyetem().then(({ data, code, msg }) => {
...@@ -151,10 +160,14 @@ ...@@ -151,10 +160,14 @@
} }
}) })
window.lwConfig.IS_PUBLISH_DIALOG && window.lwConfig.IS_PUBLISH_DIALOG &&
this.$alert('LinkWeChat V2.5 已正式发布,遇到使用上的问题欢迎提交 Issue,我们将光速修复。', '提示', { this.$alert(
'LinkWeChat V2.5 已正式发布,遇到使用上的问题欢迎提交 Issue,我们将光速修复。',
'提示',
{
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消' cancelButtonText: '取消',
}) },
)
}, },
methods: { methods: {
changeLoginType(type) { changeLoginType(type) {
...@@ -177,7 +190,7 @@ ...@@ -177,7 +190,7 @@
this.loginForm = { this.loginForm = {
username: username === undefined ? this.loginForm.username : username, username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password), password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
} }
}, },
handleLogin() { handleLogin() {
...@@ -187,10 +200,10 @@ ...@@ -187,10 +200,10 @@
if (this.loginForm.rememberMe) { if (this.loginForm.rememberMe) {
Cookies.set('username', this.loginForm.username, { expires: 30 }) Cookies.set('username', this.loginForm.username, { expires: 30 })
Cookies.set('password', encrypt(this.loginForm.password), { Cookies.set('password', encrypt(this.loginForm.password), {
expires: 30 expires: 30,
}) })
Cookies.set('rememberMe', this.loginForm.rememberMe, { Cookies.set('rememberMe', this.loginForm.rememberMe, {
expires: 30 expires: 30,
}) })
} else { } else {
Cookies.remove('username') Cookies.remove('username')
...@@ -215,31 +228,31 @@ ...@@ -215,31 +228,31 @@
changeDemonAccount(val) { changeDemonAccount(val) {
this.loginForm.username = val ? 'lw' : '' this.loginForm.username = val ? 'lw' : ''
this.loginForm.password = val ? '123456' : '' this.loginForm.password = val ? '123456' : ''
} },
} },
} }
</script> </script>
<style> <style>
.el-popover { .el-popover {
width: 280px !important; width: 280px !important;
} }
</style> </style>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.login { .login {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
// background-image: url('../assets/image/login-background.png'); // background-image: url('../assets/image/login-background.png');
background-size: cover; background-size: cover;
} }
.title { .title {
margin: 0px auto 30px auto; margin: 0px auto 30px auto;
text-align: center; text-align: center;
color: #027dfe; color: #027dfe;
} }
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
width: 400px; width: 400px;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
...@@ -263,13 +276,13 @@ ...@@ -263,13 +276,13 @@
width: 14px; width: 14px;
margin-left: 2px; margin-left: 2px;
} }
} }
.login-tip { .login-tip {
font-size: 13px; font-size: 13px;
text-align: center; text-align: center;
color: #bfbfbf; color: #bfbfbf;
} }
.login-code { .login-code {
width: 33%; width: 33%;
height: 38px; height: 38px;
float: right; float: right;
...@@ -277,8 +290,8 @@ ...@@ -277,8 +290,8 @@
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
} }
} }
.el-login-footer { .el-login-footer {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
position: fixed; position: fixed;
...@@ -290,52 +303,53 @@ ...@@ -290,52 +303,53 @@
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
z-index: 90; z-index: 90;
} }
.login-code-img { .login-code-img {
height: 38px; height: 38px;
} }
.login ::v-deep.el-dialog { .login ::v-deep.el-dialog {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
margin-top: 0vh !important; margin-top: 0vh !important;
} }
.el-dialog__body { .el-dialog__body {
padding: 0px 20px; padding: 0px 20px;
} }
[class*='login-bg'] { [class*='login-bg'] {
position: absolute; position: absolute;
z-index: 0; z-index: 0;
} }
.login-form-wrap { .login-form-wrap {
position: relative; position: relative;
background: #fff; background: #fff;
text-align: center; text-align: center;
height: 609px; height: 609px;
top: 50px; top: 50px;
left: 100px; left: 100px;
} }
.login-wrap { .login-wrap {
position: relative; position: relative;
width: 1180px; width: 1180px;
height: 720px; height: 720px;
} overflow: hidden;
.login-bg1 { }
.login-bg1 {
top: 0; top: 0;
left: 0; left: 0;
} }
.login-bg2 { .login-bg2 {
top: 50px; top: 50px;
left: 370px; left: 370px;
z-index: 10; z-index: 10;
} }
.login-bg3 { .login-bg3 {
top: 220px; top: 220px;
right: 25px; right: 25px;
z-index: 20; z-index: 20;
} }
.link { .link {
color: $blue; color: $blue;
font-size: 14px; font-size: 14px;
float: right; float: right;
...@@ -343,13 +357,13 @@ ...@@ -343,13 +357,13 @@
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;
} }
} }
.code_con { .code_con {
text-align: center; text-align: center;
margin-top: 20px; margin-top: 20px;
img { img {
height: 200px; height: 200px;
width: 200px; width: 200px;
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!