浏览代码

auto update db
自动升级数据库

star7th 5 年之前
父节点
当前提交
2ccb5baaf4

+ 1 - 1
server/Application/Api/Controller/UpdateController.class.php

@@ -12,7 +12,7 @@ class UpdateController extends BaseController {
             if($r){
                 D("Options")->set("db_version_num" , $version_num );
             }
-            
+            //echo '执行数据库升级';
         }
         $this->sendResult(array());
     }

+ 12 - 1
web_src/src/components/item/Index.vue

@@ -28,7 +28,13 @@
             </a>
           </el-tooltip>
 
-          <el-tooltip v-if="lang =='zh-cn'" class="item" effect="dark" content="接口开发调试工具RunApi" placement="top">
+          <el-tooltip
+            v-if="lang =='zh-cn'"
+            class="item"
+            effect="dark"
+            content="接口开发调试工具RunApi"
+            placement="top"
+          >
             <a target="_blank" href="https://www.showdoc.cc/runapi">
               <i class="el-icon-connection"></i>
             </a>
@@ -483,6 +489,10 @@ export default {
     script_cron() {
       var url = DocConfig.server + '/api/ScriptCron/run'
       this.axios.get(url)
+    },
+    checkDb() {
+      var url = DocConfig.server + '/api/update/checkDb'
+      this.axios.get(url)
     }
   },
   mounted() {
@@ -490,6 +500,7 @@ export default {
     this.user_info()
     this.lang = DocConfig.lang
     this.script_cron()
+    this.checkDb()
   },
   beforeDestroy() {
     this.$message.closeAll()

+ 8 - 3
web_src/src/components/item/show/Index.vue

@@ -61,9 +61,9 @@ export default {
               json.default_page_id = json.menu.pages[0].page_id
             }
           }
-          //如果是irunapi类型项目,则去掉编辑权限。只允许在runapi里编辑
-          if(json.item_type == 3){
-            json.ItemCreator = json.ItemPermn = false;  
+          // 如果是irunapi类型项目,则去掉编辑权限。只允许在runapi里编辑
+          if (json.item_type == 3) {
+            json.ItemCreator = json.ItemPermn = false
           }
           that.item_info = json
           document.title = that.item_info.item_name + '--ShowDoc'
@@ -100,9 +100,14 @@ export default {
       this.item_info = ''
       this.keyword = keyword
       this.get_item_menu(keyword)
+    },
+    checkDb() {
+      var url = DocConfig.server + '/api/update/checkDb'
+      this.axios.get(url)
     }
   },
   mounted() {
+    this.checkDb()
     this.get_item_menu()
   },
   beforeDestroy() {

+ 6 - 2
web_src/src/components/user/Login.vue

@@ -39,8 +39,7 @@
           </el-form-item>
 
           <el-form-item label>
-            <router-link to="/user/register">{{$t("register_new_account")}}</router-link>
-&nbsp;&nbsp;&nbsp;
+            <router-link to="/user/register">{{$t("register_new_account")}}</router-link>&nbsp;&nbsp;&nbsp;
           </el-form-item>
         </el-form>
       </el-card>
@@ -112,6 +111,10 @@ export default {
     script_cron() {
       var url = DocConfig.server + '/api/ScriptCron/run'
       this.axios.get(url)
+    },
+    checkDb() {
+      var url = DocConfig.server + '/api/update/checkDb'
+      this.axios.get(url)
     }
   },
   mounted() {
@@ -128,6 +131,7 @@ export default {
     })
 
     this.script_cron()
+    this.checkDb()
   },
   beforeDestroy() {}
 }