twt 1 年之前
父节点
当前提交
9ae8007e54
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      utils/request.js

+ 6 - 3
utils/request.js

@@ -8,8 +8,8 @@
 import $store from '../store'
 const extConfig = uni.getExtConfigSync();		
 console.log(extConfig)
-const baseUrl=extConfig.url+'/'
-//const baseUrl='http://192.168.0.176:20187/'
+//const baseUrl=extConfig.url+'/'
+const baseUrl='http://192.168.0.176:20187/'
 //const baseUrl='https://store-api.qdbtl.cn/'
 //const baseUrl='http://dms.66km.com.cn/'
 //wxc023ff04deb28f2d正式  wx33053a645546ec31 E37BB296-5A08-4534-859D-B351BA611AF9 EEADACCD-8A19-499D-8AD7-6975D2C93243 
@@ -27,8 +27,11 @@ const http = (url = '', date = {}, type = 'POST', header = {
 		//const wxOpenData = uni.getStorageSync("wxOpenData");
 		var wxOpenData=$store.state.wxOpenData
 		if(wxOpenData.token){
-			header['token']=wxOpenData.token;
+			header['token']=wxOpenData.token ;
+		}else if(wxOpenData.loginInfo?.token){
+			header['token']=wxOpenData.loginInfo.token;
 		}
+		
 		if(wxOpenData.loginInfo){
 			//header['token']=wxOpenData.loginInfo.token;
 			header['uid']=wxOpenData.loginInfo.uid;