Commit bef5c33f by 胡锦波

1. init 重定向页面处理

parent 82cd849f
...@@ -75,7 +75,8 @@ ...@@ -75,7 +75,8 @@
"@typescript-eslint/camelcase": "off", "@typescript-eslint/camelcase": "off",
"no-useless-constructor": "off", "no-useless-constructor": "off",
"no-console": "error", "no-console": "error",
"@typescript-eslint/no-namespace": "off" "@typescript-eslint/no-namespace": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
} }
}, },
"browserslist": [ "browserslist": [
...@@ -83,4 +84,4 @@ ...@@ -83,4 +84,4 @@
"last 2 versions", "last 2 versions",
"not dead" "not dead"
] ]
} }
\ No newline at end of file
// import { Direction } from '../direction'; import { Direction } from '../direction';
// import { MetaHeader } from '../meta-header'; import { MetaHeader } from '../meta-header';
export const loginRouters = [ export const loginRouters = [
// { // {
...@@ -12,16 +12,16 @@ export const loginRouters = [ ...@@ -12,16 +12,16 @@ export const loginRouters = [
// meta: { direction: Direction.Redirect2Domain, title: MetaHeader.root }, // meta: { direction: Direction.Redirect2Domain, title: MetaHeader.root },
// component: () => import("@/views/login/custom-domain-nav.vue"), // component: () => import("@/views/login/custom-domain-nav.vue"),
// }, // },
// { {
// path: "/oidc-redirect", path: "/oidc-redirect",
// meta: { direction: Direction.Redirect, title: MetaHeader.root }, meta: { direction: Direction.Redirect, title: MetaHeader.root },
// component: () => import("@/views/login/redirect.vue"), component: () => import("@/views/login/redirect.vue"),
// }, },
// { {
// path: "/oidc-silent-redirect", path: "/oidc-silent-redirect",
// meta: { direction: Direction.SilentRedirect, title: MetaHeader.root }, meta: { direction: Direction.SilentRedirect, title: MetaHeader.root },
// component: () => import("@/views/login/silent-redirect.vue"), component: () => import("@/views/login/silent-redirect.vue"),
// }, },
// { // {
// path: '/signout', // path: '/signout',
// component: () => import('@/views/login/signout.vue'), // component: () => import('@/views/login/signout.vue'),
......
...@@ -4,14 +4,29 @@ ...@@ -4,14 +4,29 @@
<script lang="ts"> <script lang="ts">
import { setupOidcManager } from "@/api/token"; import { setupOidcManager } from "@/api/token";
import logger from "@/core-ui/controller/logger"; import logger from "@/api/logger";
import { Component, Vue } from "vue-property-decorator"; import { Component, Vue } from "vue-property-decorator";
import config from "@/api/config";
@Component({ components: {} }) @Component({ components: {} })
export default class SilentRedirect extends Vue { export default class SilentRedirect extends Vue {
mounted() { mounted() {
const oidc = setupOidcManager(); const oidc = setupOidcManager();
oidc.signinSilentCallback().then().catch(logger.error); oidc.signinSilentCallback()
.then(() => {
logger.log("window.location.href", window.location.href);
const data = localStorage.getItem(
`oidc.user:${config.oidc.authority}:${config.oidc.client_id}`
) as any;
if (data) {
const encodeData = JSON.parse(data);
const expiresAt = encodeData.expires_at;
logger.log("allData", encodeData);
logger.log("expires_at: ", expiresAt);
logger.log("到期时间", new Date(expiresAt * 1000));
}
})
.catch(logger.error);
} }
} }
</script> </script>
......
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