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
...@@ -149,6 +150,7 @@ function requestToken(data, callback) { ...@@ -149,6 +150,7 @@ 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({
...@@ -182,6 +184,7 @@ function requestUserInfo(callback) { ...@@ -182,6 +184,7 @@ 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,
...@@ -112,6 +113,7 @@ let apiRequest = function({ ...@@ -112,6 +113,7 @@ 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处理
...@@ -253,6 +255,7 @@ function apiUPLOAD({ ...@@ -253,6 +255,7 @@ function apiUPLOAD({
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