Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
Project
Project
Details
Activity
Releases
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
android
uniapp_vedio
Commits
503537a9
Commit
503537a9
authored
Jun 24, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加channel
parent
764eeba2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
userServices.js
vedio/common/services/userServices.js
+19
-5
apiRequest.js
vedio/common/utils/apiRequest.js
+12
-1
No files found.
vedio/common/services/userServices.js
View file @
503537a9
...
...
@@ -168,10 +168,24 @@ function requestToken(data, callback) {
// 请求用户数据
function
requestUserInfo
(
callback
)
{
let
url
=
`
${
config
[
'BASE_URL'
]}
/user/baseMsg`
;
let
header
=
{
token
:
`
${
readToken
()}
`
,
pkgname
:
PAKEAGE_NAME
}
let
header
=
{}
let
uniChannel
=
'wechat'
;
// #ifdef MP-KUAISHOU
uniChannel
=
'kuaishou'
;
// #endif
// #ifdef MP-TOUTIAO
uniChannel
=
'douyin'
;
// #endif
Object
.
assign
(
header
,
{
token
:
uni
.
getStorageSync
(
'token'
),
pkgName
:
app
.
globalData
.
pkgName
,
proChannel
:
uniChannel
})
uni
.
request
({
url
,
header
,
...
...
vedio/common/utils/apiRequest.js
View file @
503537a9
...
...
@@ -99,9 +99,20 @@ let apiRequest = function({
if
(
typeof
originQuery
.
complete
==
'function'
)
originQuery
.
complete
();
return
;
}
let
uniChannel
=
'wechat'
;
// #ifdef MP-KUAISHOU
uniChannel
=
'kuaishou'
;
// #endif
// #ifdef MP-TOUTIAO
uniChannel
=
'douyin'
;
// #endif
option
.
header
=
{
pkgName
:
PAKEAGE_NAME
,
token
:
`
${
token
}
`
token
:
`
${
token
}
`
,
proChannel
:
uniChannel
}
// header处理
if
(
header
)
{
...
...
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