Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
frontend
/
qqxb-self-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b4bbd51c
authored
Jun 19, 2020
by
cocomilk2012
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
56623d69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
32 deletions
public/index.html
src/router/index.ts
public/index.html
View file @
b4bbd51c
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<head>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<title>
员工自助
</title>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
</head>
<title>
员工自助.
</title>
<body>
</head>
<noscript>
<strong>
We're sorry but typescript doesn't work properly without JavaScript enabled. Please enable it to continue.
</strong>
<body>
</noscript>
<noscript>
<div
id=
"app"
></div>
<strong>
We're sorry but typescript doesn't work properly without JavaScript enabled. Please enable it to
<!-- built files will be auto injected -->
continue.
</strong>
</body>
</noscript>
</html>
<div
id=
"app"
></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
src/router/index.ts
View file @
b4bbd51c
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
Router
from
'vue-router'
;
import
Router
from
'vue-router'
;
import
Mgr
from
'@/common/SecurityService'
;
//
import Mgr from '@/common/SecurityService';
import
employee_router
from
'./employee/employee-router'
;
import
employee_router
from
'./employee/employee-router'
;
import
qs
from
'qs'
;
import
qs
from
'qs'
;
import
axios
from
'axios'
;
import
axios
from
'axios'
;
...
@@ -9,7 +9,7 @@ import { GetCommonPms } from '../assets/js/CommonPms.js';
...
@@ -9,7 +9,7 @@ import { GetCommonPms } from '../assets/js/CommonPms.js';
Vue
.
use
(
Router
);
Vue
.
use
(
Router
);
let
mgr
=
new
Mgr
();
//
let mgr = new Mgr();
const
oidc_config
=
JSON
.
parse
(
process
.
env
.
VUE_APP_OIDC_CONFIG
);
const
oidc_config
=
JSON
.
parse
(
process
.
env
.
VUE_APP_OIDC_CONFIG
);
const
isOpenHttps
=
process
.
env
.
VUE_APP_OPEN_HTTPS
;
const
isOpenHttps
=
process
.
env
.
VUE_APP_OPEN_HTTPS
;
...
@@ -28,26 +28,26 @@ const router = new Router({
...
@@ -28,26 +28,26 @@ const router = new Router({
* 使用授权码登录
* 使用授权码登录
* @param authCode 授权码
* @param authCode 授权码
*/
*/
function
loginByAuthcode
(
authCode
:
any
)
{
//
function loginByAuthcode(authCode: any) {
let
loginArgs
=
{
extraQueryParams
:
{
authcode
:
authCode
}
};
//
let loginArgs = { extraQueryParams: { authcode: authCode } };
mgr
.
signIn
(
loginArgs
);
//
mgr.signIn(loginArgs);
}
//
}
/**
/**
* 自动登录
* 自动登录
* @param authcode 授权码
* @param authcode 授权码
*/
*/
function
autoLogin
(
authcode
:
any
)
{
//
function autoLogin(authcode: any) {
mgr
.
getUser
().
then
((
user
)
=>
{
//
mgr.getUser().then((user) => {
if
(
user
==
null
)
{
//
if (user == null) {
loginByAuthcode
(
authcode
);
//
loginByAuthcode(authcode);
}
else
{
//
} else {
//如果已经登录,则先退出
//
//如果已经登录,则先退出
localStorage
.
setItem
(
'authcode'
,
authcode
);
//
localStorage.setItem('authcode', authcode);
mgr
.
signOut
();
//
mgr.signOut();
}
//
}
});
//
});
}
//
}
//@ts-ignore
//@ts-ignore
function
getAccessToken
(
authcode
)
{
function
getAccessToken
(
authcode
)
{
...
...
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