Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_vue
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡宝山
template_vue
Commits
314a0aef
Commit
314a0aef
authored
Mar 18, 2024
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印 屏蔽移动端对应的菜单
parent
150e5857
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
5 deletions
+39
-5
login.js
src/api/login.js
+20
-0
permission.js
src/permission.js
+1
-0
permission.js
src/store/modules/permission.js
+10
-3
index.scss
src/styles/index.scss
+6
-1
vue.config.js
vue.config.js
+2
-1
No files found.
src/api/login.js
View file @
314a0aef
...
@@ -17,6 +17,26 @@ export function login(username, password, code, uuid) {
...
@@ -17,6 +17,26 @@ export function login(username, password, code, uuid) {
}
}
})
})
}
}
// export function login(username, password, code, uuid) {
// const data = {
// username,
// password,
// code,
// uuid
// }
// console.log('加密前数据', data)
// return request({
// url: '/auth/login',
// method: 'post',
// data: Qs.stringify({
// sign: encrypt(data)
// }),
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// }
// })
// }
// 刷新token
// 刷新token
export
function
refreshToken
(
params
)
{
export
function
refreshToken
(
params
)
{
return
request
({
return
request
({
...
...
src/permission.js
View file @
314a0aef
...
@@ -12,6 +12,7 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
...
@@ -12,6 +12,7 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
const
whiteList
=
[
'/auth-redirect'
,
'/bind'
,
'/register'
,
'/login'
,
'/forgetPwd'
]
const
whiteList
=
[
'/auth-redirect'
,
'/bind'
,
'/register'
,
'/login'
,
'/forgetPwd'
]
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
NProgress
.
start
()
NProgress
.
start
()
if
(
getToken
())
{
if
(
getToken
())
{
...
...
src/store/modules/permission.js
View file @
314a0aef
...
@@ -2,7 +2,8 @@ import { constantRoutes } from '@/router'
...
@@ -2,7 +2,8 @@ import { constantRoutes } from '@/router'
import
{
getRouters
}
from
'@/api/menu'
import
{
getRouters
}
from
'@/api/menu'
import
{
getInfo
}
from
'@/api/login'
import
{
getInfo
}
from
'@/api/login'
import
Layout
from
'@/layout/index'
import
Layout
from
'@/layout/index'
// pathList: 是要隐藏菜单的集合 system元素:一级菜单的路径(path)
const
pathList
=
[
'/setUp'
]
const
permission
=
{
const
permission
=
{
state
:
{
state
:
{
routes
:
[],
routes
:
[],
...
@@ -20,14 +21,20 @@ const permission = {
...
@@ -20,14 +21,20 @@ const permission = {
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
// 向后端请求路由数据
// 向后端请求路由数据
getInfo
().
then
(
res
=>
{
getInfo
().
then
(
res
=>
{
const
accessedRoutes
=
filterAsyncRouter
(
res
.
data
.
menus
)
var
menus
=
[]
res
.
data
.
menus
.
forEach
(
item
=>
{
if
(
!
pathList
.
includes
(
item
.
path
))
{
menus
.
push
(
item
)
}
})
const
accessedRoutes
=
filterAsyncRouter
(
menus
)
if
(
accessedRoutes
[
0
])
{
if
(
accessedRoutes
[
0
])
{
const
firstChild
=
getFirstChild
(
accessedRoutes
[
0
])
const
firstChild
=
getFirstChild
(
accessedRoutes
[
0
])
accessedRoutes
.
push
({
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
})
accessedRoutes
.
push
({
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
})
accessedRoutes
.
push
({
path
:
'/'
,
redirect
:
firstChild
,
hidden
:
true
})
accessedRoutes
.
push
({
path
:
'/'
,
redirect
:
firstChild
,
hidden
:
true
})
commit
(
'SET_ROUTES'
,
accessedRoutes
)
commit
(
'SET_ROUTES'
,
accessedRoutes
)
}
}
const
routers
=
{
accessedRoutes
:
accessedRoutes
,
getRouters
:
res
.
data
.
menus
}
const
routers
=
{
accessedRoutes
:
accessedRoutes
,
getRouters
:
menus
}
resolve
(
routers
)
resolve
(
routers
)
})
})
})
})
...
...
src/styles/index.scss
View file @
314a0aef
...
@@ -29,7 +29,12 @@ html {
...
@@ -29,7 +29,12 @@ html {
overflow-x
:
hidden
;
overflow-x
:
hidden
;
//min-width: 1440px;
//min-width: 1440px;
}
}
// 解决浏览器打印网站不全问题
@media
print
{
html
,
body
{
height
:
inherit
;
}
}
*,
*,
*
:before
,
*
:before
,
*
:after
{
*
:after
{
...
...
vue.config.js
View file @
314a0aef
...
@@ -115,7 +115,8 @@ module.exports = {
...
@@ -115,7 +115,8 @@ module.exports = {
// }
// }
// },
// },
[
process
.
env
.
VUE_APP_BASE_API
]:
{
[
process
.
env
.
VUE_APP_BASE_API
]:
{
target
:
`http://localhost:8088/`
,
target
:
`http://49.232.167.247:20014/`
,
// target: `http://localhost:8088/`,
// target: `http://10.5.87.231:10010/internal`,
// target: `http://10.5.87.231:10010/internal`,
// target: `http://117.122.212.91:32012/`,
// target: `http://117.122.212.91:32012/`,
// target: `http://192.144.239.97:20070/`,
// target: `http://192.144.239.97:20070/`,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment