|
@@ -1,24 +1,23 @@
|
|
|
-
|
|
|
// 'http://192.168.1.222:8088','https://file-dev.xyyxt.net/'线下
|
|
|
// 'https://api.xyyxt.net' 'https://file.xyyxt.net/'线上
|
|
|
import store from '@/store/index.js'
|
|
|
import api from './api.js'
|
|
|
var num = 1
|
|
|
|
|
|
-export const BASE_URL = 'http://42.192.164.187:19005'//接口api http://42.192.164.187:19005
|
|
|
+export const BASE_URL = 'http://192.168.1.222:5055' //接口api http://42.192.164.187:19005
|
|
|
|
|
|
|
|
|
-export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'//图片上传api 'https://file.xyyxt.net/
|
|
|
+export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/' //图片上传api 'https://file.xyyxt.net/
|
|
|
export const tenantId = '867735392558919680'
|
|
|
export const myRequest = (options) => {
|
|
|
- if(store.state.allowLoading){
|
|
|
+ if (store.state.allowLoading) {
|
|
|
uni.showLoading({
|
|
|
- title:'拼命加载中...'
|
|
|
- })
|
|
|
+ title: '拼命加载中...'
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
- let token =uni.getStorageSync('token')
|
|
|
+ let token = uni.getStorageSync('token')
|
|
|
uni.request({
|
|
|
url: BASE_URL + options.url,
|
|
|
method: options.method || 'GET',
|
|
@@ -26,7 +25,7 @@ export const myRequest = (options) => {
|
|
|
header: options.noToken ? {
|
|
|
TenantId: tenantId,
|
|
|
} : {
|
|
|
- AuthorizationToken: 'WX ' + (token?token:uni.getStorageSync('token_temp')),
|
|
|
+ AuthorizationToken: 'WX ' + (token ? token : uni.getStorageSync('token_temp')),
|
|
|
TenantId: tenantId
|
|
|
},
|
|
|
success: async (res) => {
|
|
@@ -52,9 +51,9 @@ export const myRequest = (options) => {
|
|
|
})
|
|
|
reject(JSON.stringify(err))
|
|
|
},
|
|
|
- complete:()=>{
|
|
|
+ complete: () => {
|
|
|
uni.hideLoading()
|
|
|
- // uni.hideToast()
|
|
|
+ // uni.hideToast()
|
|
|
}
|
|
|
})
|
|
|
})
|