访问接口header加上version、platform
This commit is contained in:
parent
cebcc26baf
commit
dc1f1985e8
@ -90,9 +90,16 @@ Vue.prototype.goBack = function (number) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Vue.prototype.$A = $A;
|
Vue.prototype.$A = $A;
|
||||||
Vue.prototype.$Electron = !!__IS_ELECTRON ? require('electron') : null;
|
Vue.prototype.$Electron = null;
|
||||||
Vue.prototype.$isMainElectron = !!__IS_ELECTRON && window.navigator && window.navigator.userAgent && /\s+MainTaskWindow\//.test(window.navigator.userAgent);
|
Vue.prototype.$Platform = "web";
|
||||||
Vue.prototype.$isSubElectron = !!__IS_ELECTRON && window.navigator && window.navigator.userAgent && /\s+SubTaskWindow\//.test(window.navigator.userAgent);
|
Vue.prototype.$isMainElectron = false;
|
||||||
|
Vue.prototype.$isSubElectron = false;
|
||||||
|
if (!!__IS_ELECTRON) {
|
||||||
|
Vue.prototype.$Electron = require('electron');
|
||||||
|
Vue.prototype.$Platform = /macintosh|mac os x/i.test(navigator.userAgent) ? "mac" : "win";
|
||||||
|
Vue.prototype.$isMainElectron = /\s+MainTaskWindow\//.test(window.navigator.userAgent);
|
||||||
|
Vue.prototype.$isSubElectron = /\s+SubTaskWindow\//.test(window.navigator.userAgent);
|
||||||
|
}
|
||||||
|
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
@ -115,6 +122,7 @@ $A.store = app.$store;
|
|||||||
$A.L = app.$L;
|
$A.L = app.$L;
|
||||||
|
|
||||||
$A.Electron = app.$Electron;
|
$A.Electron = app.$Electron;
|
||||||
|
$A.Platform = app.$Platform;
|
||||||
$A.isMainElectron = app.$isMainElectron;
|
$A.isMainElectron = app.$isMainElectron;
|
||||||
$A.isSubElectron = app.$isSubElectron;
|
$A.isSubElectron = app.$isSubElectron;
|
||||||
$A.execMainDispatch = (action, data) => {
|
$A.execMainDispatch = (action, data) => {
|
||||||
|
@ -17,6 +17,8 @@ export default {
|
|||||||
params.header['language'] = $A.getLanguage();
|
params.header['language'] = $A.getLanguage();
|
||||||
params.header['token'] = state.userToken;
|
params.header['token'] = state.userToken;
|
||||||
params.header['fd'] = $A.getStorageString("userWsFd");
|
params.header['fd'] = $A.getStorageString("userWsFd");
|
||||||
|
params.header['version'] = window.systemInfo.version || "0.0.1";
|
||||||
|
params.header['platform'] = $A.Platform;
|
||||||
//
|
//
|
||||||
const cloneParams = $A.cloneJSON(params);
|
const cloneParams = $A.cloneJSON(params);
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user