Commit 503537a9 authored by jyx's avatar jyx

添加channel

parent 764eeba2
...@@ -168,10 +168,24 @@ function requestToken(data, callback) { ...@@ -168,10 +168,24 @@ function requestToken(data, callback) {
// 请求用户数据 // 请求用户数据
function requestUserInfo(callback) { function requestUserInfo(callback) {
let url = `${config['BASE_URL']}/user/baseMsg`; let url = `${config['BASE_URL']}/user/baseMsg`;
let header = {
token: `${readToken()}`, let header = {}
pkgname: PAKEAGE_NAME
} 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({ uni.request({
url, url,
header, header,
......
...@@ -99,9 +99,20 @@ let apiRequest = function({ ...@@ -99,9 +99,20 @@ let apiRequest = function({
if (typeof originQuery.complete == 'function') originQuery.complete(); if (typeof originQuery.complete == 'function') originQuery.complete();
return; return;
} }
let uniChannel = 'wechat';
// #ifdef MP-KUAISHOU
uniChannel = 'kuaishou';
// #endif
// #ifdef MP-TOUTIAO
uniChannel = 'douyin';
// #endif
option.header = { option.header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
token: `${token}` token: `${token}`,
proChannel: uniChannel
} }
// header处理 // header处理
if (header) { if (header) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment