Commit 3c096382 by Lyan

修改登录

parent 1bc29154
......@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>人人快速开发平台</title>
<title>gs1后台管理</title>
<% if (process.env.NODE_ENV === 'production') { %>
<!-- 生产环境 -->
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -62,26 +62,188 @@ router.beforeEach((to, from, next) => {
if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') {
next()
} else {
http({
url: http.adornUrl('/sys/menu/nav'),
method: 'get',
params: http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
fnAddDynamicMenuRoutes(data.menuList)
router.options.isAddDynamicMenuRoutes = true
sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]'))
sessionStorage.setItem('permissions', JSON.stringify(data.permissions || '[]'))
next({ ...to, replace: true })
} else {
sessionStorage.setItem('menuList', '[]')
sessionStorage.setItem('permissions', '[]')
next()
console.log(http)
var navDataList = [
{
'menuId': 1,
'parentId': 0,
'parentName': null,
'name': '系统管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'system',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 2,
'parentId': 1,
'parentName': null,
'name': '管理员列表',
'url': 'sys/user',
'perms': null,
'type': 1,
'icon': 'admin',
'orderNum': 1,
'open': null,
'list': null
},
{
'menuId': 3,
'parentId': 1,
'parentName': null,
'name': '角色管理',
'url': 'sys/role',
'perms': null,
'type': 1,
'icon': 'role',
'orderNum': 2,
'open': null,
'list': null
},
{
'menuId': 4,
'parentId': 1,
'parentName': null,
'name': '菜单管理',
'url': 'sys/menu',
'perms': null,
'type': 1,
'icon': 'menu',
'orderNum': 3,
'open': null,
'list': null
},
{
'menuId': 5,
'parentId': 1,
'parentName': null,
'name': 'SQL监控',
'url': 'http://localhost:8080/renren-fast/druid/sql.html',
'perms': null,
'type': 1,
'icon': 'sql',
'orderNum': 4,
'open': null,
'list': null
},
{
'menuId': 6,
'parentId': 1,
'parentName': null,
'name': '定时任务',
'url': 'job/schedule',
'perms': null,
'type': 1,
'icon': 'job',
'orderNum': 5,
'open': null,
'list': null
},
{
'menuId': 27,
'parentId': 1,
'parentName': null,
'name': '参数管理',
'url': 'sys/config',
'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
'type': 1,
'icon': 'config',
'orderNum': 6,
'open': null,
'list': null
},
{
'menuId': 30,
'parentId': 1,
'parentName': null,
'name': '文件上传',
'url': ' ',
'perms': 'sys:oss:all',
'type': 1,
'icon': 'oss',
'orderNum': 6,
'open': null,
'list': null
},
{
'menuId': 29,
'parentId': 1,
'parentName': null,
'name': '系统日志',
'url': 'sys/log',
'perms': 'sys:log:list',
'type': 1,
'icon': 'log',
'orderNum': 7,
'open': null,
'list': null
}
]
}
}).catch((e) => {
console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue')
router.push({ name: 'login' })
})
]
var permissions = [
'sys:schedule:info',
'sys:menu:update',
'sys:menu:delete',
'sys:config:info',
'sys:menu:list',
'sys:config:save',
'sys:config:update',
'sys:schedule:resume',
'sys:user:delete',
'sys:config:list',
'sys:user:update',
'sys:role:list',
'sys:menu:info',
'sys:menu:select',
'sys:schedule:update',
'sys:schedule:save',
'sys:role:select',
'sys:user:list',
'sys:menu:save',
'sys:role:save',
'sys:schedule:log',
'sys:role:info',
'sys:schedule:delete',
'sys:role:update',
'sys:schedule:list',
'sys:user:info',
'sys:schedule:run',
'sys:config:delete',
'sys:role:delete',
'sys:user:save',
'sys:schedule:pause',
'sys:log:list',
'sys:oss:all'
]
fnAddDynamicMenuRoutes(navDataList)
router.options.isAddDynamicMenuRoutes = true
sessionStorage.setItem('menuList', JSON.stringify(navDataList || '[]'))
sessionStorage.setItem('permissions', JSON.stringify(permissions || '[]'))
next({ ...to, replace: true })
// http({
// url: http.adornUrl('/sys/menu/nav'),
// method: 'get',
// params: http.adornParams()
// }).then(({data}) => {
// if (data && data.code === 0) {
// fnAddDynamicMenuRoutes(data.menuList)
// router.options.isAddDynamicMenuRoutes = true
// sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]'))
// sessionStorage.setItem('permissions', JSON.stringify(data.permissions || '[]'))
// next({ ...to, replace: true })
// } else {
// sessionStorage.setItem('menuList', '[]')
// sessionStorage.setItem('permissions', '[]')
// next()
// }
// }).catch((e) => {
// console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue')
// router.push({ name: 'login' })
// })
}
})
......
......@@ -22,7 +22,7 @@
</el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="">
<!-- <img :src="captchaPath" @click="getCaptcha()" alt=""> -->
</el-col>
</el-row>
</el-form-item>
......@@ -62,7 +62,7 @@
}
},
created () {
this.getCaptcha()
// this.getCaptcha()
},
methods: {
// 提交表单
......@@ -70,20 +70,17 @@
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/sys/login'),
url: this.$http.adornUrl('/office/sys/login'),
method: 'post',
data: this.$http.adornData({
'username': this.dataForm.userName,
'password': this.dataForm.password,
'uuid': this.dataForm.uuid,
'captcha': this.dataForm.captcha
'password': this.dataForm.password
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$cookie.set('token', data.token)
this.$router.replace({ name: 'home' })
} else {
this.getCaptcha()
this.$message.error(data.msg)
}
})
......
......@@ -2,8 +2,8 @@
<nav class="site-navbar" :class="'site-navbar--' + navbarLayoutType">
<div class="site-navbar__header">
<h1 class="site-navbar__brand" @click="$router.push({ name: 'home' })">
<a class="site-navbar__brand-lg" href="javascript:;">人人快速开发平台</a>
<a class="site-navbar__brand-mini" href="javascript:;">人人</a>
<a class="site-navbar__brand-lg" href="javascript:;">gs1后台管理</a>
<a class="site-navbar__brand-mini" href="javascript:;">gs1</a>
</h1>
</div>
<div class="site-navbar__body clearfix">
......
......@@ -73,17 +73,18 @@
},
// 获取当前管理员信息
getUserInfo () {
this.$http({
url: this.$http.adornUrl('/sys/user/info'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.loading = false
this.userId = data.user.userId
this.userName = data.user.username
}
})
this.loading = false
// this.$http({
// url: this.$http.adornUrl('/sys/user/info'),
// method: 'get',
// params: this.$http.adornParams()
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.loading = false
// this.userId = data.user.userId
// this.userName = data.user.username
// }
// })
}
}
}
......
......@@ -5,7 +5,7 @@
window.SITE_CONFIG = {};
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091';
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名
......
......@@ -5,7 +5,7 @@
window.SITE_CONFIG = {};
// api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast';
window.SITE_CONFIG['baseUrl'] = 'http://81.68.189.225:9091';
// cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名
......
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