Commit 503537a9 authored by jyx's avatar jyx

添加channel

parent 764eeba2
......@@ -103,7 +103,7 @@ function login(data, callback) {
// 更新用户数据
function refreshUserInfo() {
requestUserInfo((success, userData) => {
if (success) {
if (success) {
console.log(userData)
let user = new User({
...userData,
......@@ -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,
......
......@@ -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) {
......
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