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
9d159137
Commit
9d159137
authored
Mar 02, 2023
by
sunchao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://139.224.139.2:9091/chaosun/CFFP
into dev
parents
300b5e3a
75360b47
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
66 deletions
+76
-66
api/api.ts
+0
-0
manifest.json
+5
-1
pages/orderConfirm/orderConfirm.vue
+0
-0
sfp/housePurchase/housePurchase.vue
+3
-3
sfp/index/index.vue
+3
-3
util/interceptor.ts
+65
-59
No files found.
api/api.ts
View file @
9d159137
This diff is collapsed.
Click to expand it.
manifest.json
View file @
9d159137
...
...
@@ -47,10 +47,12 @@
"<uses-permission android:name=
\"
android.permission.INTERNET
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_CONTACTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_CONTACTS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_EXTERNAL_STORAGE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
],
...
...
@@ -93,7 +95,9 @@
"appid"
:
"wx3ec6ac74a8c074be"
,
"UniversalLinks"
:
"https://mapp.cffp.org.cn/app/"
}
}
},
"maps"
:
{},
"geolocation"
:
{}
},
"splashscreen"
:
{
"androidStyle"
:
"common"
,
...
...
pages/orderConfirm/orderConfirm.vue
View file @
9d159137
This diff is collapsed.
Click to expand it.
sfp/housePurchase/housePurchase.vue
View file @
9d159137
...
...
@@ -363,7 +363,7 @@
chart
.
setOption
(
this
.
option
);
});
},
checkToken
(){
/*
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
...
...
@@ -373,7 +373,7 @@
})
}
})
},
},
*/
radioChange
:
function
(
evt
)
{
for
(
let
i
=
0
;
i
<
this
.
chartsLegends
.
length
;
i
++
)
{
if
(
this
.
chartsLegends
[
i
].
value
===
evt
.
detail
.
value
)
{
...
...
@@ -738,7 +738,7 @@
// this.$refs.chart.init(echarts, chart => {
// chart.setOption(this.option);
// });
this
.
checkToken
();
//
this.checkToken();
}
}
</
script
>
...
...
sfp/index/index.vue
View file @
9d159137
...
...
@@ -261,7 +261,7 @@
url
:
'/pages/product/finance-calculator'
})
},
checkToken
(){
/*
checkToken(){
api.checkToken().then(res=>{
if(res['success']){}else{
api.obtainToken().then(res=>{
...
...
@@ -271,7 +271,7 @@
})
}
})
},
},
*/
getFollowData
(
e
){
this
.
isNeedOfficialAccountQrcode
=
ref
(
e
);
console
.
log
(
'父组件拿到值了'
,
e
);
...
...
@@ -634,7 +634,7 @@
}
},
mounted
()
{
this
.
checkToken
();
//
this.checkToken();
}
}
...
...
util/interceptor.ts
View file @
9d159137
// import {baseURL,apiURL,cffpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`/api/authorize/obtainToken`
,
`/api/authorize/checkToken`
];
export
const
interceptor
=
()
=>
{
uni
.
addInterceptor
(
'request'
,
{
// 请求拦截器
invoke
(
args
)
{
// console.log('请求拦截器',args);
// 加载loading
// uni.showLoading({
// title: '加载中...'
// });
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
uni
.
request
({
url
:
'/api/authorize/obtainToken'
,
method
:
'POST'
,
data
:
{
ticket
:
'uni-app'
},
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'data'
][
'token'
]);
window
.
location
.
href
=
window
.
location
.
href
+
'?'
+
't_reload='
+
new
Date
().
getTime
();
}
// console.log(res)
}
})
// uni.hideLoading();
}
// request 触发前拼接 url
//设置请求头及token
args
.
header
=
{
'content-type'
:
args
.
method
===
'POST'
?
'application/json'
:
'application/x-www-form-urlencoded'
,
'X-Authorization'
:
uni
.
getStorageSync
(
'uni-token'
)
?
uni
.
getStorageSync
(
'uni-token'
)
:
''
,
// 'Access-Control-Allow-Headers': 'appId',
// 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
// 'Access-Control-Max-Age': 86400,
}
// console.log(args.header)
},
// 响应拦截器,可以对数据进行预处理
success
()
{
// uni.hideLoading()
// console.log(args);
},
fail
()
{
// console.log('interceptor-fail', err)
// console.log('请求失败')
// uni.hideLoading()
},
complete
()
{
// uni.hideLoading()
}
})
}
// import {baseURL,apiURL,cffpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`/api/authorize/obtainToken`
,
`/api/authorize/checkToken`
];
export
const
interceptor
=
()
=>
{
uni
.
addInterceptor
(
'request'
,
{
// 请求拦截器
invoke
(
args
)
{
// console.log('请求拦截器',args);
// 加载loading
// uni.showLoading({
// title: '加载中...'
// });
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
const
params
=
{
ticket
:
'uni-app'
,
loginId
:
null
}
let
h5userId
=
uni
.
getStorageSync
(
'cffp_userId'
);
if
(
h5userId
)
{
params
.
loginId
=
h5userId
;
}
uni
.
request
({
url
:
'/api/authorize/obtainToken'
,
method
:
'POST'
,
data
:
params
,
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'data'
][
'token'
]);
window
.
location
.
href
=
window
.
location
.
href
+
'?'
+
't_reload='
+
new
Date
().
getTime
();
}
}
})
}
// request 触发前拼接 url
//设置请求头及token
args
.
header
=
{
'content-type'
:
args
.
method
===
'POST'
?
'application/json'
:
'application/x-www-form-urlencoded'
,
'X-Authorization'
:
uni
.
getStorageSync
(
'uni-token'
)
?
uni
.
getStorageSync
(
'uni-token'
)
:
''
,
// 'Access-Control-Allow-Headers': 'appId',
// 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS',
// 'Access-Control-Max-Age': 86400,
}
// console.log(args.header)
},
// 响应拦截器,可以对数据进行预处理
success
()
{
// uni.hideLoading()
// console.log(args);
},
fail
()
{
// console.log('interceptor-fail', err)
// console.log('请求失败')
// uni.hideLoading()
},
complete
()
{
// uni.hideLoading()
}
})
}
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