From e8d946a82907aa530ff086987d3ec7d2c04a90d2 Mon Sep 17 00:00:00 2001 From: Admin <978517621@qq.com> Date: 星期二, 15 十一月 2022 13:09:55 +0800 Subject: [PATCH] 默认更改列表 --- src/views/login/index.vue | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 3effba1..9797916 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -35,7 +35,7 @@ </template> <script> - import { loginByUsername } from '@/api/login' + import { getAccount,loginByUsername,getUserInfo } from '@/api/login' import { getToken, setToken, removeToken } from '@/utils/auth' import Cookies from 'js-cookie' import { initRouter } from '@/utils/router' @@ -138,6 +138,26 @@ Cookies.set('token_expired_at', data.tokenexpired) _this.$store.commit('SET_NAME', data.realname) _this.$store.commit('SET_USER_TYPE', data.type) + //换取账号密码 + getUserInfo().then(res => { + if (res.data.code == 200) { + loginForm.department = res.data.result.department + // loginForm.department = "公司领导" + getAccount(loginForm).then(res => { + if (res.data.code == 200) { + //缓存账号密码 + Cookies.set("hiddenDangerUsername",res.data.result.username) + Cookies.set("hiddenDangerPassword",res.data.result.password) + } else { + this.$message({type: 'error', message: res.data.msg, duration: 3000}) + } + }) + + } else { + this.$message({type: 'error', message: "用户信息获取失败!请重试", duration: 3000}) + } + }) + // 加载菜单 initRouter(_this) _this.$router.replace('/') @@ -174,7 +194,7 @@ .login-container { min-height: 100%; width: 100%; - background: url("../../assets/bg.jpg") center no-repeat; + background: url("../../assets/bg_login.png") center no-repeat; //background-size: auto 100%; // background-color: #2d3a4b; overflow: hidden; @@ -215,7 +235,7 @@ display: inline-block; height: 474px; width: 572px; - background: url("../../assets/img_bg_login.png") center no-repeat; + background: url("../../assets/bg.jpg") center no-repeat; } .login-main-form{ display: inline-block; -- Gitblit v1.9.2