@lzpenguin/server 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -73,11 +73,11 @@ export class RiffleServer {
|
|
|
73
73
|
throw new Error('timestamp is required');
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
//
|
|
76
|
+
// 从全局变量或 URL 参数读取服务地址(会去掉协议前缀)
|
|
77
77
|
let baseUrl;
|
|
78
78
|
|
|
79
79
|
if (isBrowser && typeof window !== 'undefined') {
|
|
80
|
-
baseUrl = window.__RIFFLE_BASE_URL__;
|
|
80
|
+
baseUrl = window.__RIFFLE_BASE_URL__ || new URLSearchParams(location.search).get('base_url');
|
|
81
81
|
if (baseUrl) {
|
|
82
82
|
baseUrl = baseUrl.replace(/^(https?|http?|wss?|ws?):\/\//i, '').replace(/\/$/, '');
|
|
83
83
|
}
|