Commit b4bbd51c by cocomilk2012

update

parent 56623d69
Showing with 37 additions and 32 deletions
<!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
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) {
......
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 sign in to comment