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
c02a5a0c
Commit
c02a5a0c
authored
Apr 12, 2024
by
肖健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token存储key更改
parent
90fea996
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
181 additions
and
181 deletions
+181
-181
api.js
common/api/api.js
+4
-4
request.js
common/request/request/core/request.js
+2
-2
requestConfig.js
common/request/requestConfig.js
+4
-4
utils.js
common/utils.js
+11
-11
index.vue
pages/binding/index.vue
+3
-3
home-new.vue
pages/home-new.vue
+28
-28
home.vue
pages/home.vue
+8
-8
main.vue
pages/main.vue
+20
-20
moveCar.vue
pages/moveCar.vue
+6
-6
personal.vue
pages/personal.vue
+19
-19
shop.vue
pages/shop.vue
+9
-9
index.vue
pagesA/pages/mrAct/index.vue
+36
-36
index.vue
pagesA/pages/popAct/index.vue
+27
-27
detail.vue
pagesC/pages/shop/detail.vue
+1
-1
search.vue
pagesC/pages/shop/search.vue
+1
-1
userInfo.vue
pagesD/pages/personal/userInfo.vue
+2
-2
No files found.
common/api/api.js
View file @
c02a5a0c
...
...
@@ -34,7 +34,7 @@ const httpRequest = (opts, data) => {
let
requestNumber
=
0
;
//带Token请求
const
httpTokenRequest
=
(
opts
,
data
)
=>
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
uni
.
getStorage
({
key
:
'token'
,
success
:
function
(
ress
)
{
...
...
@@ -67,7 +67,7 @@ const httpTokenRequest = (opts, data) => {
if
(
res
[
1
].
data
.
code
==
401
){
if
(
requestNumber
<=
0
){
requestNumber
++
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'userToken
1
'
)
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
...
...
common/request/request/core/request.js
View file @
c02a5a0c
...
...
@@ -129,7 +129,7 @@ export default class request {
setTimeout
(()
=>
{
if
(
loginPopupNum
<=
0
){
loginPopupNum
++
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'userToken
1
'
)
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
jdLoginPage
(
returnPage
,
pageType
)
...
...
common/request/requestConfig.js
View file @
c02a5a0c
...
...
@@ -123,7 +123,7 @@ $http.requestStart = function(options) {
}
}
//请求前加入token
options
.
header
[
'Authorization'
]
=
'Bearer '
+
uni
.
getStorageSync
(
'userToken'
);
options
.
header
[
'Authorization'
]
=
'Bearer '
+
uni
.
getStorageSync
(
'userToken
1
'
);
return
options
;
}
//请求结束
...
...
@@ -184,7 +184,7 @@ $http.dataFactory = async function(res) {
setTimeout
(()
=>
{
if
(
loginPopupNum
<=
0
){
loginPopupNum
++
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'userToken
1
'
)
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
jdLoginPage
(
returnPage
,
pageType
)
...
...
common/utils.js
View file @
c02a5a0c
...
...
@@ -9,7 +9,7 @@ export function goToLocation(item) {
})
return
}
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
!
token
)
{
uni
.
setStorageSync
(
'jdNavToObj'
,
item
)
let
returnPage
=
'/pages/main'
;
...
...
pages/binding/index.vue
View file @
c02a5a0c
...
...
@@ -163,7 +163,7 @@
// duration: 1500
// })
// uni.setStorageSync('xcxIndexPath', res.data.data.xcxIndexPath);
// uni.setStorageSync("userToken", res.data.data.token)
// uni.setStorageSync("userToken
1
", res.data.data.token)
//
// if (this.scene) {
// let param = {
...
...
@@ -290,8 +290,8 @@
// }
//
//
// let userToken
= uni.getStorageSync('userToken
')
// if (userToken) {
// let userToken
1 = uni.getStorageSync('userToken1
')
// if (userToken
1
) {
// let that = this
// let opts = {
// url: '/app/user/info',
...
...
pages/home-new.vue
View file @
c02a5a0c
...
...
@@ -165,7 +165,7 @@
})
this
.
clickState
=
true
let
that
=
this
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
!
token
)
{
uni
.
hideLoading
()
this
.
clickState
=
false
...
...
pages/home.vue
View file @
c02a5a0c
...
...
@@ -110,7 +110,7 @@
})
this
.
clickState
=
true
let
that
=
this
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
!
token
)
{
uni
.
hideLoading
()
this
.
clickState
=
false
...
...
pages/main.vue
View file @
c02a5a0c
...
...
@@ -97,7 +97,7 @@
this
.
tab
=
'moveCar'
break
;
case
2
:
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
token
)
{
if
(
this
.
scanClick
)
{
this
.
scanClick
=
false
...
...
@@ -309,7 +309,7 @@
}
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
!
token
)
{
let
ptKey
=
plugin
.
getPtKey
();
if
(
ptKey
)
{
...
...
@@ -351,7 +351,7 @@
console
.
log
(
res
,
'88888888'
)
if
(
res
.
data
.
code
==
200
)
{
let
token
=
res
.
data
.
data
.
token
uni
.
setStorageSync
(
'userToken'
,
token
)
uni
.
setStorageSync
(
'userToken
1
'
,
token
)
uni
.
hideLoading
()
uni
.
showToast
({
title
:
"登录成功"
,
...
...
pages/moveCar.vue
View file @
c02a5a0c
...
...
@@ -97,7 +97,7 @@
goUrl
(
vo
)
{
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
vo
.
url
)
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=1'
...
...
pages/personal.vue
View file @
c02a5a0c
...
...
@@ -177,7 +177,7 @@
data
:{},
}).
then
(
res
=>
{
this
.
token
=
null
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'userToken
1
'
)
uni
.
removeStorageSync
(
'xcxIndexPath'
)
// uni.removeStorageSync('openid')
plugin
.
logout
().
then
((
res
)
=>
{
...
...
@@ -193,7 +193,7 @@
})
},
goOrder
(
current
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
uni
.
removeStorageSync
(
'routerLogin'
)
if
(
!
token
){
// uni.navigateTo({
...
...
@@ -209,7 +209,7 @@
});
},
goUrl
(
vo
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
vo
.
url
)
if
(
!
token
){
...
...
@@ -244,7 +244,7 @@
},
editInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
'/pagesD/pages/personal/userInfo'
)
if
(
!
token
){
...
...
@@ -262,7 +262,7 @@
});
},
async
getUserInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
!
token
){
this
.
logoutFlag
=
false
return
...
...
@@ -376,7 +376,7 @@
setTimeout
(()
=>
{
this
.
show
=
true
},
100
);
this
.
token
=
uni
.
getStorageSync
(
'userToken'
);
this
.
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
this
.
token
){
this
.
getUserInfo
()
}
...
...
pages/shop.vue
View file @
c02a5a0c
...
...
@@ -99,7 +99,7 @@ export default {
})
},
goDetail
(
id
,
link
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
false
)
if
(
!
token
){
...
...
pagesA/pages/mrAct/index.vue
View file @
c02a5a0c
...
...
@@ -327,7 +327,7 @@ export default {
this
.
tips
=
text
;
},
checkLogin
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
!
token
)
{
uni
.
setStorageSync
(
'routerLogin'
,
'/pagesA/pages/mrAct/index'
)
uni
.
setStorageSync
(
'routerLoginPageType'
,
'switchTab'
)
...
...
@@ -489,7 +489,7 @@ export default {
that
.
checkLogin
()
if
(
that
.
disabledSubmit
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
token
)
{
that
.
receivedFailShow
=
true
}
...
...
@@ -561,7 +561,7 @@ export default {
title
:
this
.
appName
,
});
let
that
=
this
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
token
)
{
that
.
getActCheckInfo
()
}
...
...
pagesA/pages/popAct/index.vue
View file @
c02a5a0c
...
...
@@ -167,7 +167,7 @@ export default {
},
// 获取爱车列表
getCarList
(){
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
!
token
)
{
this
.
goToLogin
()
return
...
...
@@ -232,7 +232,7 @@ export default {
//活动检查信息
submitAct
()
{
let
that
=
this
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
!
token
)
{
that
.
goToLogin
()
return
...
...
@@ -289,7 +289,7 @@ export default {
title
:
this
.
appName
,
});
let
that
=
this
let
token
=
uni
.
getStorageSync
(
'userToken'
)
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
)
if
(
token
)
{
that
.
checkCaptchaInfo
()
}
...
...
pagesC/pages/shop/detail.vue
View file @
c02a5a0c
...
...
@@ -43,7 +43,7 @@ export default {
},
methods
:
{
pay
(){
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
!
token
){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pagesC/pages/shop/detail&id=' + this.id
...
...
pagesC/pages/shop/search.vue
View file @
c02a5a0c
...
...
@@ -67,7 +67,7 @@
},
300
)
},
goDetail
(
id
,
link
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken
1
'
);
if
(
!
token
)
{
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
...
...
pagesD/pages/personal/userInfo.vue
View file @
c02a5a0c
...
...
@@ -265,7 +265,7 @@ export default {
// 请求头一定要加,否则 iOS 图片上传会失败
header
:
{
'content-type'
:
'multipart/form-data'
,
'Authorization'
:
'Bearer '
+
uni
.
getStorageSync
(
'userToken'
)
'Authorization'
:
'Bearer '
+
uni
.
getStorageSync
(
'userToken
1
'
)
},
success
:
(
res
)
=>
{
let
uploadData
=
JSON
.
parse
(
res
.
data
)
...
...
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