Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
d92e264c
Commit
d92e264c
authored
Nov 06, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(统一身份): 补交遗漏的票据落地页 pages/auth/ticket.vue
parent
69649f08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
pages/auth/ticket.vue
+63
-0
No files found.
pages/auth/ticket.vue
0 → 100644
View file @
d92e264c
<
template
>
<view
class=
"ticket-landing"
>
<image
src=
"@/static/images/logoLanuch.png"
style=
"width: 100rpx; height: 100rpx;"
mode=
"widthFix"
/>
<text
class=
"tip"
>
{{
tip
}}
</text>
</view>
</
template
>
<
script
setup
>
import
{
ref
}
from
'vue'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
consumeTicket
,
setSsoToken
,
isMiniprogram
,
reloginViaMiniprogram
}
from
'@/util/sso'
let
tip
=
ref
(
'登录中...'
)
onLoad
((
options
)
=>
{
const
redirect
=
options
.
redirect
?
decodeURIComponent
(
options
.
redirect
)
:
'/pages/index/index'
const
ticket
=
options
.
ticket
// 无票据(误访问/收藏夹直开):不建 sso 态,回首页走老 H5 链路
if
(
!
ticket
)
{
uni
.
reLaunch
({
url
:
'/pages/index/index'
})
return
}
consumeTicket
(
ticket
).
then
(({
token
,
userId
})
=>
{
// 令牌只进内存;业务 userId/isLogin 落 storage,随后请求由 interceptor 携带 X-Authorization
setSsoToken
(
token
,
userId
)
uni
.
reLaunch
({
url
:
redirect
})
}).
catch
((
err
)
=>
{
console
.
error
(
'票据消费失败:'
,
err
)
if
(
isMiniprogram
())
{
// 票据 30s 过期/已消费/重放:销毁本 web-view,原生强制重走 wx.login→票据
tip
.
value
=
'登录已过期,正在重新登录...'
reloginViaMiniprogram
(
redirect
)
}
else
{
tip
.
value
=
'登录失败,即将返回首页'
setTimeout
(()
=>
uni
.
reLaunch
({
url
:
'/pages/index/index'
}),
1500
)
}
})
})
</
script
>
<
style
lang=
"scss"
scoped
>
.ticket-landing
{
min-height
:
100vh
;
background-color
:
#fff
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
gap
:
30
rpx
;
}
.tip
{
font-size
:
26
rpx
;
color
:
#999
;
}
</
style
>
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