Files
GX.O3.WMS/APK/APP_Report/common/global.js
T

41 lines
753 B
JavaScript
Executable File

export default {
globalReturnType:new Map(),
globalData: {
requestUrl: '', //http://localhost:8300
printUrl: '' //打印服务器地址
},
setGlobalObj(data) {
//设置服务器变量
this.globalData = Object.assign({}, this.globalData, data);
//缓存数据
uni.setStorage({
key: 'RequestUrl',
data: data.requestUrl
});
uni.setStorage({
key: 'PrintUrl',
data: data.printUrl
});
},
getReturnType(url){
if (url) {
return this.globalReturnType.get(url);
}
},
setReturnType(url, returnType) {
if (url && returnType) {
this.globalReturnType.set(url, returnType);
}
},
deleteReturnType(url) {
if (url) {
this.globalReturnType.delete(url);
}
},
}