Browse Source

Merge branch 'dev-烟台中转登录' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov

yantai_master
dai 3 years ago
parent
commit
b294911431
  1. 12
      src/router/index.js
  2. 26
      src/views/pages/yantai-login-transit.vue

12
src/router/index.js

@ -38,7 +38,7 @@ export const pageRoutes = [
}, },
}, },
{ {
path: "/login", path: "/login/",
component: () => { component: () => {
return import("@/views/pages/yantai-login-transit"); return import("@/views/pages/yantai-login-transit");
}, },
@ -47,6 +47,16 @@ export const pageRoutes = [
title: "登录", title: "登录",
}, },
}, },
{
path: "/login",
component: () => {
return import("@/views/pages/yantai-login-transit");
},
name: "login2",
meta: {
title: "登录",
},
},
{ {
path: "/", path: "/",
name: "index", name: "index",

26
src/views/pages/yantai-login-transit.vue

@ -23,6 +23,7 @@ export default {
async mounted() { async mounted() {
let code = getQueryPara("code"); let code = getQueryPara("code");
console.log("--------------code" + code);
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: "登录中……", text: "登录中……",
@ -34,29 +35,16 @@ export default {
await this.login(code); await this.login(code);
loading.close(); loading.close();
} else { } else {
// await this.skip(code); let uriComponent = "http://172.20.46.177/epmet-oper-gov/#/login/";
location.href = let redirect_url = encodeURIComponent(uriComponent);
"http://172.20.46.155:8080/sso/login?client_id=1000006&redirect_url=" + let url =
encodeURIComponent(location.href); "http://172.20.46.155:8080/sso/login?client_id=1000009&redirect_url=" +
redirect_url;
window.open(url, "_self");
} }
}, },
methods: { methods: {
//id
async skip() {
const url = "/gov222";
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
location.href = data.url;
} else {
console.log("获取跳转页面失败", msg);
}
},
//id //id
async login(client_code) { async login(client_code) {
const url = "/auth/sso-govlogin-yantai/" + client_code; const url = "/auth/sso-govlogin-yantai/" + client_code;

Loading…
Cancel
Save