|
@@ -6,10 +6,12 @@ let path = "";
|
6
|
6
|
let appIp = "";
|
7
|
7
|
let dsHost = "";
|
8
|
8
|
// #ifdef H5
|
9
|
|
-let domainName = location.host; //域名+端口
|
|
9
|
+let pathname = location.pathname.split('/')[1]; //二级目录
|
|
10
|
+pathname = pathname ? '/' + pathname : '';
|
10
|
11
|
let protocolName = document.location.protocol; //http协议
|
11
|
12
|
let wsName = protocolName === 'http:' ? 'ws' : 'wss'; //ws协议
|
12
|
|
-path = `${protocolName}//${domainName}/service`;
|
|
13
|
+export const baseUrl = `${location.origin}${pathname}`;
|
|
14
|
+path = `${baseUrl}/service`;
|
13
|
15
|
dsHost = location.hostname;
|
14
|
16
|
// #endif
|
15
|
17
|
uni.setStorageSync('path', path);
|