Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
wly-APP
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘川
wly-APP
Commits
26fe3218
Commit
26fe3218
authored
Nov 05, 2022
by
xiangzj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登出问题
parent
7875b2fe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
usercenter.nvue
pages/usercenter/usercenter.nvue
+1
-1
api.helper.js
servers/api.helper.js
+8
-8
No files found.
pages/usercenter/usercenter.nvue
View file @
26fe3218
...
@@ -179,7 +179,7 @@
...
@@ -179,7 +179,7 @@
logOut() {
logOut() {
apiLogOut().then((res) => {
apiLogOut().then((res) => {
uni.setStorageSync('lifeData', {});
uni.setStorageSync('lifeData', {});
uni.
navigate
To({
uni.
redirect
To({
url: "/pages/login/login"
url: "/pages/login/login"
})
})
}).catch(() => {
}).catch(() => {
...
...
servers/api.helper.js
View file @
26fe3218
...
@@ -94,8 +94,7 @@ class Request {
...
@@ -94,8 +94,7 @@ class Request {
duration
:
2000
,
duration
:
2000
,
icon
:
'none'
icon
:
'none'
})
})
}
}
else
if
(
response
.
statusCode
==
401
)
{
if
(
response
.
statusCode
==
401
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'登录已失效'
,
title
:
'登录已失效'
,
duration
:
2000
,
duration
:
2000
,
...
@@ -104,7 +103,7 @@ class Request {
...
@@ -104,7 +103,7 @@ class Request {
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/login/login"
url
:
"/pages/login/login"
})
})
}
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'服务器异常'
,
title
:
'服务器异常'
,
duration
:
2000
,
duration
:
2000
,
...
@@ -114,6 +113,7 @@ class Request {
...
@@ -114,6 +113,7 @@ class Request {
}
}
}
}
}
}
}
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
// 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
options
.
url
=
validate
.
url
(
options
.
url
)
?
options
.
url
:
((
options
.
baseUrl
?
options
.
baseUrl
:
options
.
url
=
validate
.
url
(
options
.
url
)
?
options
.
url
:
((
options
.
baseUrl
?
options
.
baseUrl
:
...
...
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