检查接口版本

This commit is contained in:
kuaifan 2022-05-29 13:39:06 +08:00
parent cc1d535311
commit ba95f33592
2 changed files with 15 additions and 1 deletions

View File

@ -102,7 +102,15 @@ export default {
axios.get($A.apiUrl('../version')).then(({status, data}) => {
if (status === 200) {
this.apiVersion = data.version || ''
if (this.$Electron) {
if (this.$isEEUiApp) {
// App
if (this.compareVersion(this.apiVersion, '0.14.94') === -1) {
$A.eeuiAppAlert({
title: '温馨提示',
message: '服务器接口版本过低,有可能无法正常使用系统功能。',
});
}
} else if (this.$Electron) {
//
this.$Electron.sendMessage('updateCheckAndDownload', {
apiVersion: this.apiVersion

View File

@ -10,6 +10,12 @@
* =============================================================================
*/
$.extend({
eeuiAppAlert(object, callback) {
if (!$A.isEEUiApp) return;
if (typeof callback !== "function") callback = _ => {};
requireModuleJs("eeui").alert(object, callback);
},
eeuiAppOpenPage(object, callback) {
if (!$A.isEEUiApp) return;
if (typeof callback !== "function") callback = _ => {};