Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
胡锦波
/
org-manager-web
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
bef5c33f
authored
Apr 07, 2022
by
胡锦波
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1. init 重定向页面处理
parent
82cd849f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
16 deletions
package.json
src/router/sub-router/login.ts
src/views/login/silent-redirect.vue
package.json
View file @
bef5c33f
...
...
@@ -75,7 +75,8 @@
"@typescript-eslint/camelcase"
:
"off"
,
"no-useless-constructor"
:
"off"
,
"no-console"
:
"error"
,
"@typescript-eslint/no-namespace"
:
"off"
"@typescript-eslint/no-namespace"
:
"off"
,
"@typescript-eslint/explicit-module-boundary-types"
:
"off"
}
},
"browserslist"
:
[
...
...
@@ -83,4 +84,4 @@
"last 2 versions"
,
"not dead"
]
}
}
\ No newline at end of file
src/router/sub-router/login.ts
View file @
bef5c33f
//
import { Direction } from '../direction';
//
import { MetaHeader } from '../meta-header';
import
{
Direction
}
from
'../direction'
;
import
{
MetaHeader
}
from
'../meta-header'
;
export
const
loginRouters
=
[
// {
...
...
@@ -12,16 +12,16 @@ export const loginRouters = [
// meta: { direction: Direction.Redirect2Domain, title: MetaHeader.root },
// component: () => import("@/views/login/custom-domain-nav.vue"),
// },
//
{
//
path: "/oidc-redirect",
//
meta: { direction: Direction.Redirect, title: MetaHeader.root },
//
component: () => import("@/views/login/redirect.vue"),
//
},
//
{
//
path: "/oidc-silent-redirect",
//
meta: { direction: Direction.SilentRedirect, title: MetaHeader.root },
//
component: () => import("@/views/login/silent-redirect.vue"),
//
},
{
path
:
"/oidc-redirect"
,
meta
:
{
direction
:
Direction
.
Redirect
,
title
:
MetaHeader
.
root
},
component
:
()
=>
import
(
"@/views/login/redirect.vue"
),
},
{
path
:
"/oidc-silent-redirect"
,
meta
:
{
direction
:
Direction
.
SilentRedirect
,
title
:
MetaHeader
.
root
},
component
:
()
=>
import
(
"@/views/login/silent-redirect.vue"
),
},
// {
// path: '/signout',
// component: () => import('@/views/login/signout.vue'),
...
...
src/views/login/silent-redirect.vue
View file @
bef5c33f
...
...
@@ -4,14 +4,29 @@
<
script
lang=
"ts"
>
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
config
from
"@/api/config"
;
@
Component
({
components
:
{}
})
export
default
class
SilentRedirect
extends
Vue
{
mounted
()
{
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
>
...
...
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