Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-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
Administrator
jd-vx-app
Commits
30f6c6a1
Commit
30f6c6a1
authored
May 10, 2022
by
lijiongliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回401重定向修改
parent
a4850f88
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
api.js
common/api/api.js
+10
-2
No files found.
common/api/api.js
View file @
30f6c6a1
const
baseUrl
=
'https://jduniapp.uzosp.com/test-api'
;
// const baseUrl = 'https://jduniapp.uzosp.com/test-api';
const
baseUrl
=
'http://sx2zq2.natappfree.cc'
;
const
httpRequest
=
(
opts
,
data
)
=>
{
let
httpDefaultOpts
=
{
url
:
baseUrl
+
opts
.
url
,
...
...
@@ -59,7 +60,14 @@ const httpTokenRequest = (opts, data) => {
let
promise
=
new
Promise
(
function
(
resolve
,
reject
)
{
uni
.
request
(
httpDefaultOpts
).
then
(
(
res
)
=>
{
// console.log(3333333333333333333,res)
console
.
log
(
33333333333
,
res
[
1
])
if
(
res
[
1
].
data
.
code
==
401
){
uni
.
removeStorageSync
(
'userToken'
)
uni
.
navigateTo
({
url
:
"/pages/binding/index"
})
return
;
}
resolve
(
res
[
1
])
}
).
catch
(
...
...
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