Commit 3c096382 by Lyan

修改登录

parent 1bc29154
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>人人快速开发平台</title> <title>gs1后台管理</title>
<% if (process.env.NODE_ENV === 'production') { %> <% if (process.env.NODE_ENV === 'production') { %>
<!-- 生产环境 --> <!-- 生产环境 -->
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script> <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) => { ...@@ -62,26 +62,188 @@ router.beforeEach((to, from, next) => {
if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') { if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') {
next() next()
} else { } else {
http({ console.log(http)
url: http.adornUrl('/sys/menu/nav'), var navDataList = [
method: 'get', {
params: http.adornParams() 'menuId': 1,
}).then(({data}) => { 'parentId': 0,
if (data && data.code === 0) { 'parentName': null,
fnAddDynamicMenuRoutes(data.menuList) 'name': '系统管理',
router.options.isAddDynamicMenuRoutes = true 'url': null,
sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]')) 'perms': null,
sessionStorage.setItem('permissions', JSON.stringify(data.permissions || '[]')) 'type': 0,
next({ ...to, replace: true }) 'icon': 'system',
} else { 'orderNum': 0,
sessionStorage.setItem('menuList', '[]') 'open': null,
sessionStorage.setItem('permissions', '[]') 'list': [
next() {
'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') var permissions = [
router.push({ name: 'login' }) '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 @@ ...@@ -22,7 +22,7 @@
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="10" class="login-captcha"> <el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt=""> <!-- <img :src="captchaPath" @click="getCaptcha()" alt=""> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
} }
}, },
created () { created () {
this.getCaptcha() // this.getCaptcha()
}, },
methods: { methods: {
// 提交表单 // 提交表单
...@@ -70,20 +70,17 @@ ...@@ -70,20 +70,17 @@
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/login'), url: this.$http.adornUrl('/office/sys/login'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'username': this.dataForm.userName, 'username': this.dataForm.userName,
'password': this.dataForm.password, 'password': this.dataForm.password
'uuid': this.dataForm.uuid,
'captcha': this.dataForm.captcha
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$cookie.set('token', data.token) this.$cookie.set('token', data.token)
this.$router.replace({ name: 'home' }) this.$router.replace({ name: 'home' })
} else { } else {
this.getCaptcha()
this.$message.error(data.msg) this.$message.error(data.msg)
} }
}) })
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<nav class="site-navbar" :class="'site-navbar--' + navbarLayoutType"> <nav class="site-navbar" :class="'site-navbar--' + navbarLayoutType">
<div class="site-navbar__header"> <div class="site-navbar__header">
<h1 class="site-navbar__brand" @click="$router.push({ name: 'home' })"> <h1 class="site-navbar__brand" @click="$router.push({ name: 'home' })">
<a class="site-navbar__brand-lg" href="javascript:;">人人快速开发平台</a> <a class="site-navbar__brand-lg" href="javascript:;">gs1后台管理</a>
<a class="site-navbar__brand-mini" href="javascript:;">人人</a> <a class="site-navbar__brand-mini" href="javascript:;">gs1</a>
</h1> </h1>
</div> </div>
<div class="site-navbar__body clearfix"> <div class="site-navbar__body clearfix">
......
...@@ -73,17 +73,18 @@ ...@@ -73,17 +73,18 @@
}, },
// 获取当前管理员信息 // 获取当前管理员信息
getUserInfo () { getUserInfo () {
this.$http({ this.loading = false
url: this.$http.adornUrl('/sys/user/info'), // this.$http({
method: 'get', // url: this.$http.adornUrl('/sys/user/info'),
params: this.$http.adornParams() // method: 'get',
}).then(({data}) => { // params: this.$http.adornParams()
if (data && data.code === 0) { // }).then(({data}) => {
this.loading = false // if (data && data.code === 0) {
this.userId = data.user.userId // this.loading = false
this.userName = data.user.username // this.userId = data.user.userId
} // this.userName = data.user.username
}) // }
// })
} }
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
window.SITE_CONFIG = {}; window.SITE_CONFIG = {};
// api接口请求地址 // api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'; window.SITE_CONFIG['baseUrl'] = ' http://81.68.189.225:9091';
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名 window.SITE_CONFIG['domain'] = './'; // 域名
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
window.SITE_CONFIG = {}; window.SITE_CONFIG = {};
// api接口请求地址 // api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:8080/renren-fast'; window.SITE_CONFIG['baseUrl'] = 'http://81.68.189.225:9091';
// cdn地址 = 域名 + 版本号 // cdn地址 = 域名 + 版本号
window.SITE_CONFIG['domain'] = './'; // 域名 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