Commit 841b27d1 authored by mengcuiguang's avatar mengcuiguang

header添加version

parent dbf68494
...@@ -18,7 +18,8 @@ import { ...@@ -18,7 +18,8 @@ import {
} from "../utils/util.js"; } from "../utils/util.js";
import { import {
PAKEAGE_NAME PAKEAGE_NAME,
VERSION_CODE
} from "../../utils/utils.js"; } from "../../utils/utils.js";
import { import {
printError printError
...@@ -148,7 +149,8 @@ function postPhone(data, callback) { ...@@ -148,7 +149,8 @@ function postPhone(data, callback) {
function requestToken(data, callback) { function requestToken(data, callback) {
let url = `${config["BASE_URL"]}/user/ttLogin`; let url = `${config["BASE_URL"]}/user/ttLogin`;
let header = { let header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
version: VERSION_CODE,
token: `` token: ``
} }
uni.request({ uni.request({
...@@ -181,7 +183,8 @@ function requestUserInfo(callback) { ...@@ -181,7 +183,8 @@ function requestUserInfo(callback) {
Object.assign(header, { Object.assign(header, {
token: readToken(), token: readToken(),
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
version: VERSION_CODE,
proChannel: uniChannel proChannel: uniChannel
}) })
......
...@@ -12,7 +12,8 @@ import { ...@@ -12,7 +12,8 @@ import {
appendParam, appendParam,
} from "./util"; } from "./util";
import { import {
PAKEAGE_NAME PAKEAGE_NAME,
VERSION_CODE
} from "../../utils/utils"; } from "../../utils/utils";
import { import {
addNormalNotificationObserver, addNormalNotificationObserver,
...@@ -111,7 +112,8 @@ let apiRequest = function({ ...@@ -111,7 +112,8 @@ let apiRequest = function({
option.header = { option.header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
token: `${token}`, token: `${token}`,
version: VERSION_CODE,
proChannel: uniChannel proChannel: uniChannel
} }
// header处理 // header处理
...@@ -252,7 +254,8 @@ function apiUPLOAD({ ...@@ -252,7 +254,8 @@ function apiUPLOAD({
option.url = `${option.url}?t=${new Date().getTime()}`; // 路径 option.url = `${option.url}?t=${new Date().getTime()}`; // 路径
option.header = { option.header = {
pkgName: PAKEAGE_NAME, pkgName: PAKEAGE_NAME,
version: VERSION_CODE,
token: `${token}` token: `${token}`
} }
if (header) { if (header) {
......
export const PAKEAGE_NAME = 'com.duben.dybookhm' export const PAKEAGE_NAME = 'com.duben.dybookhm'
export const VERSION_CODE = '1.0.1'
// export const PAKEAGE_NAME = 'com.test.test' // export const PAKEAGE_NAME = 'com.test.test'
export function trim(str) { export function trim(str) {
......
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