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>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
员工自助
</title>
</head>
<body>
<noscript>
<strong>
We're sorry but typescript doesn't work properly without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div
id=
"app"
></div>
<!-- built files will be auto injected -->
</body>
</html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
员工自助.
</title>
</head>
<body>
<noscript>
<strong>
We're sorry but typescript doesn't work properly without JavaScript enabled. Please enable it to
continue.
</strong>
</noscript>
<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
Router
from
'vue-router'
;
import
Mgr
from
'@/common/SecurityService'
;
//
import Mgr from '@/common/SecurityService';
import
employee_router
from
'./employee/employee-router'
;
import
qs
from
'qs'
;
import
axios
from
'axios'
;
...
...
@@ -9,7 +9,7 @@ import { GetCommonPms } from '../assets/js/CommonPms.js';
Vue
.
use
(
Router
);
let
mgr
=
new
Mgr
();
//
let mgr = new Mgr();
const
oidc_config
=
JSON
.
parse
(
process
.
env
.
VUE_APP_OIDC_CONFIG
);
const
isOpenHttps
=
process
.
env
.
VUE_APP_OPEN_HTTPS
;
...
...
@@ -28,26 +28,26 @@ const router = new Router({
* 使用授权码登录
* @param authCode 授权码
*/
function
loginByAuthcode
(
authCode
:
any
)
{
let
loginArgs
=
{
extraQueryParams
:
{
authcode
:
authCode
}
};
mgr
.
signIn
(
loginArgs
);
}
//
function loginByAuthcode(authCode: any) {
//
let loginArgs = { extraQueryParams: { authcode: authCode } };
//
mgr.signIn(loginArgs);
//
}
/**
* 自动登录
* @param authcode 授权码
*/
function
autoLogin
(
authcode
:
any
)
{
mgr
.
getUser
().
then
((
user
)
=>
{
if
(
user
==
null
)
{
loginByAuthcode
(
authcode
);
}
else
{
//如果已经登录,则先退出
localStorage
.
setItem
(
'authcode'
,
authcode
);
mgr
.
signOut
();
}
});
}
//
function autoLogin(authcode: any) {
//
mgr.getUser().then((user) => {
//
if (user == null) {
//
loginByAuthcode(authcode);
//
} else {
//
//如果已经登录,则先退出
//
localStorage.setItem('authcode', authcode);
//
mgr.signOut();
//
}
//
});
//
}
//@ts-ignore
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