访问接口header加上version、platform
This commit is contained in:
parent
cebcc26baf
commit
dc1f1985e8
14
resources/assets/js/app.js
vendored
14
resources/assets/js/app.js
vendored
@ -90,9 +90,16 @@ Vue.prototype.goBack = function (number) {
|
||||
};
|
||||
|
||||
Vue.prototype.$A = $A;
|
||||
Vue.prototype.$Electron = !!__IS_ELECTRON ? require('electron') : null;
|
||||
Vue.prototype.$isMainElectron = !!__IS_ELECTRON && window.navigator && window.navigator.userAgent && /\s+MainTaskWindow\//.test(window.navigator.userAgent);
|
||||
Vue.prototype.$isSubElectron = !!__IS_ELECTRON && window.navigator && window.navigator.userAgent && /\s+SubTaskWindow\//.test(window.navigator.userAgent);
|
||||
Vue.prototype.$Electron = null;
|
||||
Vue.prototype.$Platform = "web";
|
||||
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;
|
||||
|
||||
@ -115,6 +122,7 @@ $A.store = app.$store;
|
||||
$A.L = app.$L;
|
||||
|
||||
$A.Electron = app.$Electron;
|
||||
$A.Platform = app.$Platform;
|
||||
$A.isMainElectron = app.$isMainElectron;
|
||||
$A.isSubElectron = app.$isSubElectron;
|
||||
$A.execMainDispatch = (action, data) => {
|
||||
|
2
resources/assets/js/store/actions.js
vendored
2
resources/assets/js/store/actions.js
vendored
@ -17,6 +17,8 @@ export default {
|
||||
params.header['language'] = $A.getLanguage();
|
||||
params.header['token'] = state.userToken;
|
||||
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);
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user