|
|
@@ -10,7 +10,19 @@ BASE_URL ='https://' + process.uniEnv.baseUrl;
|
|
|
* post请求封装
|
|
|
*/
|
|
|
export const request = (url, method, data, show = false) => {
|
|
|
+ console.log(url)
|
|
|
let token=uni.getStorageSync('token')
|
|
|
+ let header={
|
|
|
+ 'content-type': 'application/json',
|
|
|
+ 'hversion': '1.0',
|
|
|
+ 'Authorization': '',
|
|
|
+ }
|
|
|
+ if(url==='/auth/oauth2/token'){
|
|
|
+ token='YXBwOmFwcA=='
|
|
|
+ header['CLIENT-TOC']='Y'
|
|
|
+ }
|
|
|
+ header.Authorization= 'Bearer '+token
|
|
|
+ console.log(header)
|
|
|
// data.token = token;
|
|
|
// data.m_id = uni.getStorageSync('m_id')
|
|
|
if (show) {
|
|
|
@@ -26,12 +38,7 @@ export const request = (url, method, data, show = false) => {
|
|
|
url:BASE_URL+ url,
|
|
|
data: data,
|
|
|
method: method || 'post',
|
|
|
- header: {
|
|
|
- 'content-type': 'application/json',
|
|
|
- 'hversion': '1.0',
|
|
|
- 'Authorization': 'Bearer cd58ee97-5700-45f3-ae1f-9bebef504fc1'
|
|
|
- // 'Authorization': 'Bearer '+token
|
|
|
- },
|
|
|
+ header: header,
|
|
|
success: (res) => {
|
|
|
if (res.statusCode === 200) {
|
|
|
// console.log('应答信息-----------------------')
|