mm_os 2.7.7 → 2.7.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/core/com/mqtt/drive.js +9 -3
- package/package.json +1 -1
package/core/com/mqtt/drive.js
CHANGED
|
@@ -57,7 +57,9 @@ class Drive extends Item {
|
|
|
57
57
|
// 结果
|
|
58
58
|
"result": "result",
|
|
59
59
|
// 回复方法
|
|
60
|
-
"method_receive": "${method}-Ack"
|
|
60
|
+
"method_receive": "${method}-Ack",
|
|
61
|
+
// 服务器地址
|
|
62
|
+
"host": ""
|
|
61
63
|
};
|
|
62
64
|
|
|
63
65
|
// 开放给前端调用的函数
|
|
@@ -207,10 +209,14 @@ Drive.prototype.fullUrl = function(src) {
|
|
|
207
209
|
return ""
|
|
208
210
|
}
|
|
209
211
|
if (src.indexOf("http") !== 0) {
|
|
212
|
+
var host = this.config.host || $.host;
|
|
213
|
+
if (host.indexOf("http") !== 0) {
|
|
214
|
+
host = "http://" + host;
|
|
215
|
+
}
|
|
210
216
|
if (src.indexOf("~/") === 0) {
|
|
211
|
-
src = src.replace('~/',
|
|
217
|
+
src = src.replace('~/', host);
|
|
212
218
|
} else if (src.indexOf("/") === 0) {
|
|
213
|
-
src = src.replace('/',
|
|
219
|
+
src = src.replace('/', host);
|
|
214
220
|
}
|
|
215
221
|
}
|
|
216
222
|
return src;
|