瀏覽代碼

增加前后端版本检测对比

mxd 3 年之前
父節點
當前提交
a55b485e0e
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      magic-editor/src/console/src/components/magic-editor.vue

+ 6 - 0
magic-editor/src/console/src/components/magic-editor.vue

@@ -239,6 +239,12 @@ export default {
               let host = location.href.substring(0, location.href.indexOf(res.data.web))
               contants.SERVER_URL = replaceURL(host + '/' + (res.data.prefix || ''))
             }
+            if(contants.config.version && contants.config.version !== contants.MAGIC_API_VERSION_TEXT){
+              this.$magicAlert({
+                title: '版本检测',
+                content: `检测到前后端版本不一致(前端:${contants.MAGIC_API_VERSION_TEXT} 后端:${contants.config.version}),请检查`
+              })
+            }
           })
           .catch(e => {
             this.$magicAlert({