Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
hrs_app_h5
/
bill
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
b10c24ce
authored
Apr 15, 2020
by
张建朝
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
tj
parent
b31a1b67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletions
src/router/index.js
src/views/test.vue
src/router/index.js
View file @
b10c24ce
...
...
@@ -17,7 +17,12 @@ const router = new VueRouter({
path
:
'/callback.html'
,
name
:
"oidcCallback"
,
component
:
()
=>
import
(
"@/views/OidcCallback.vue"
)
}
},{
path
:
"/test"
,
name
:
"test"
,
component
:
()
=>
import
(
"@/views/test.vue"
)
}
],
scrollBehavior
(
to
,
from
,
savedPosition
)
{
return
{
x
:
0
,
y
:
0
}
...
...
src/views/test.vue
View file @
b10c24ce
<
template
>
<div
class=
"b-container"
>
<tab-header
:title=
"title"
/>
<div
v-if=
"oidcIsAuthenticated"
>
已登录,
{{
oidcUser
}}
<a
@
click=
"signOutOidc"
>
退出
</a></div>
<div
v-else
>
</div>
</div>
</
template
>
<
script
>
import
{
TabHeader
}
from
"@/components"
;
import
{
mapGetters
,
mapActions
}
from
'vuex'
export
default
{
components
:{
TabHeader
,
},
computed
:
{
...
mapGetters
([
'oidcIsAuthenticated'
,
'oidcUser'
,
'oidcAccessToken'
,
'oidcAccessTokenExp'
,
'oidcIdToken'
,
'oidcIdTokenExp'
,
'oidcAuthenticationIsChecked'
,
'oidcError'
]),
hasAccess
:
function
()
{
return
this
.
oidcIsAuthenticated
||
this
.
$route
.
meta
.
isPublic
}
},
methods
:
{
...
mapActions
([
'authenticateOidc'
,
// Authenticates with redirect to sign in if not signed in
'oidcSignInCallback'
,
// Handles callback from authentication redirect. Has an optional url parameter
'authenticateOidcSilent'
,
// Authenticates if signed in. No redirect is made if not signed in
'getOidcUser'
,
// Get user from oidc-client storage and update it in vuex store. Returns a promise
'signOutOidc'
,
// Signs out user in open id provider
'removeOidcUser'
// Signs out user in vuex and browser storage, but not in open id provider
])
},
data
()
{
return
{
title
:
"TAB页面"
...
...
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