Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcsjsb-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c568d17b
authored
2023-06-26 10:24:13 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:上报修改
1 parent
cbcf2d8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
29 deletions
public/index.html
src/permission.js
public/index.html
View file @
c568d17
<!--
* @Description: 引入配置文件
* @Autor: renchao
* @LastEditTime: 2023-06-2
0 11:24:04
* @LastEditTime: 2023-06-2
6 10:22:28
-->
<!DOCTYPE html>
<html>
...
...
@@ -22,7 +22,7 @@
// 是否微服务模式,业务系统根据需要读取
cloudEnable
:
false
,
baseUrl
:
location
.
origin
||
location
.
protocol
+
'//'
+
location
.
host
,
// 是否启用
单点登录
// 是否启用
cas登录页面
casEnable
:
false
,
// cas 基地址
casBaseURL
:
'http://192.168.2.38/cas'
,
...
...
src/permission.js
View file @
c568d17
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-06-2
0 11:28:11
* @LastEditTime: 2023-06-2
6 10:18:09
*/
import
Vue
from
'vue'
import
axios
from
'axios'
...
...
@@ -13,7 +13,7 @@ import "nprogress/nprogress.css"; // progress bar style
import
getPageTitle
from
"@/utils/get-page-title"
;
import
getTheme
from
"@/utils/theme"
;
import
Cookies
from
"js-cookie"
;
import
{
getToken
,
getUrlParam
,
setToken
}
from
"@/utils/util"
;
import
{
getToken
,
getUrlParam
,
setToken
}
from
"@/utils/util"
;
NProgress
.
configure
({
showSpinner
:
false
});
...
...
@@ -27,7 +27,7 @@ router.beforeEach(async (to, from, next) => {
// cas操作
const
token
=
getToken
()
let
locationUrl
=
window
.
location
.
origin
+
window
.
location
.
pathname
;
function
casValidate
(
ticket
){
function
casValidate
(
ticket
)
{
axios
.
get
(
window
.
_config
.
services
.
management
+
"/management/cas/validate"
,
{
params
:
{
ticket
:
ticket
,
...
...
@@ -35,10 +35,10 @@ router.beforeEach(async (to, from, next) => {
},
}).
then
(
async
(
res
)
=>
{
if
(
res
.
data
.
status
===
1
)
{
setToken
(
res
.
data
.
content
.
accessToken
)
window
.
location
.
href
=
localStorage
.
getItem
(
'sjsb-location'
)
+
'#'
+
localStorage
.
getItem
(
'hash'
)
setToken
(
res
.
data
.
content
.
accessToken
)
window
.
location
.
href
=
localStorage
.
getItem
(
'sjsb-location'
)
+
'#'
+
localStorage
.
getItem
(
'hash'
)
}
else
{
alert
(
res
.
data
.
message
)
alert
(
res
.
data
.
message
)
}
}).
catch
((
e
)
=>
{
console
.
log
(
e
);
...
...
@@ -92,35 +92,35 @@ router.beforeEach(async (to, from, next) => {
if
(
ticket
)
{
casValidate
(
ticket
)
}
else
{
if
(
to
.
path
===
'/login'
)
{
if
(
getUrlParam
(
'_flag'
)
===
'1'
)
{
next
();
return
}
else
{
//todo: loginUrl 需要业务系统根据登录页面路由地址获取,这里只是简写
localStorage
.
setItem
(
'sjsb-location'
,
locationUrl
)
localStorage
.
setItem
(
'hash'
,
to
.
fullPath
)
window
.
location
.
href
=
window
.
_config
.
services
.
management
+
`/management/cas/status?loginUrl=
${
window
.
_config
.
baseUrl
}
/sjsb/&hash=/login&`
return
}
if
(
to
.
path
===
'/login'
)
{
if
(
getUrlParam
(
'_flag'
)
===
'1'
)
{
next
();
return
}
else
{
//todo: loginUrl 需要业务系统根据登录页面路由地址获取,这里只是简写
localStorage
.
setItem
(
'sjsb-location'
,
locationUrl
)
localStorage
.
setItem
(
'hash'
,
to
.
fullPath
)
window
.
location
.
href
=
window
.
_config
.
services
.
management
+
`/management/cas/status?loginUrl=
${
window
.
_config
.
baseUrl
}
/sjsb/&hash=/login&`
return
}
localStorage
.
setItem
(
'sjsb-location'
,
locationUrl
)
localStorage
.
setItem
(
'hash'
,
to
.
fullPath
)
//todo: loginUrl 需要业务系统根据登录页面路由地址获取,这里只是简写
window
.
location
.
href
=
window
.
_config
.
services
.
management
+
`/management/cas/status?loginUrl=
${
window
.
_config
.
baseUrl
}
/sjsb/&hash=/login`
}
localStorage
.
setItem
(
'sjsb-location'
,
locationUrl
)
localStorage
.
setItem
(
'hash'
,
to
.
fullPath
)
//todo: loginUrl 需要业务系统根据登录页面路由地址获取,这里只是简写
window
.
location
.
href
=
window
.
_config
.
services
.
management
+
`/management/cas/status?loginUrl=
${
window
.
_config
.
baseUrl
}
/sjsb/&hash=/login`
}
}
else
{
}
else
{
if
(
to
.
path
===
'/login'
)
{
const
redirectUrl
=
getUrlParam
(
'redirectUrl'
);
if
(
redirectUrl
&&
redirectUrl
!==
''
)
{
window
.
location
.
href
=
redirectUrl
return
window
.
location
.
href
=
redirectUrl
return
}
else
{
next
(
'/'
);
return
permission
()
next
(
'/'
);
return
}
}
permission
()
}
}
NProgress
.
done
()
...
...
Please
register
or
sign in
to post a comment