Commit bc3a39fd by Tang

feat: 添加模拟登陆,修复admin页面

parent 0245ebb7
......@@ -51,7 +51,7 @@ export default {
name: "CertificationDetail",
props: {
title: String,
subCenter: 'Boolean',
subCenter: Boolean,
reset: Boolean
},
data() {
......
......@@ -127,20 +127,28 @@ export default {
},
created() {
// TODO 判断用户状态 处理一下左侧的 sub_nav 和用户panel
const user = JSON.parse(localStorage.getItem('gs-user'))
// 1. 未申请条码
// 2.系统成员
// 3.管理员
this.userType = ADMIN;
if (user.type === 'admin') {
this.userType = ADMIN;
} else if (user.type === 'verify') {
this.userType = SYSTEM_MEMBER;
} else {
this.userType = UN_VERIFY;
}
if (this.userType === UN_VERIFY) {
this.$store.commit("system/SET_SUB_NAV", this.routerList);
} else if (this.userType === SYSTEM_MEMBER) {
this.routerList[0].link='/MyManage/SystemMember/index',
this.routerList[2].children.push({
id: uuid("gs_nav"),
name: "企业信息",
index: 3,
link: '/MyManage/SystemMember/companyInfo'
})
this.routerList[0].link = '/MyManage/SystemMember/index',
this.routerList[2].children.push({
id: uuid("gs_nav"),
name: "企业信息",
index: 3,
link: '/MyManage/SystemMember/companyInfo'
})
this.$store.commit("system/SET_SUB_NAV", this.routerList);
} else if (this.userType === ADMIN) {
this.$store.commit("system/SET_SUB_NAV", this.adminRouterList);
......
......@@ -114,7 +114,14 @@ export default {
if (valid) {
if (this.userForm.validateCode === 'kjjj') {
if (this.userForm.userName === 'test' && this.userForm.password === 'test') {
this.$router.push({path: '/MyManage'})
localStorage.setItem('gs-user', JSON.stringify({type: 'unVerify'}))
this.$router.push({path: '/MyManage/UnVerify/index'})
} else if (this.userForm.userName === 'test1' && this.userForm.password === 'test1') {
localStorage.setItem('gs-user', JSON.stringify({type: 'verify'}))
this.$router.push({path: '/MyManage/SystemMember/index'})
} else if (this.userForm.userName === 'admin' && this.userForm.password === 'admin') {
localStorage.setItem('gs-user', JSON.stringify({type: 'admin'}))
this.$router.push({path: '/MyManage/admin/check'})
} else {
this.userLoginError = '用户名或密码不正确!'
}
......@@ -130,7 +137,7 @@ export default {
},
loginByMobile() {
},
sendValidateCode() {
if (this.mobileForm.mobile === '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment