From 0e4c25700fac0e0c7d93327a5eaafc17b8dd3d78 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 08 九月 2021 19:16:09 +0800
Subject: [PATCH] 2021-09-08

---
 src/components/header/index.jsx |   37 +++++++++++++++++++++++++++++++++----
 1 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 9f703f8..f58c12a 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -22,14 +22,12 @@
 import enUS from '@/locales/en-US/main.js'
 import Utils from '@/utils/utils.js'
 import avatar from '@/assets/img/avatar.jpg'
-import asyncComponent from '@/utils/asyncComponent'
 import Resetpwd from './resetpwd'
 import LoginForm from './loginform'
 import './index.scss'
 
 const { confirm } = Modal
 const { Search } = Input
-const VersionsUp = asyncComponent(() => import('./versions'))
 
 class Header extends Component {
   static propTpyes = {
@@ -663,6 +661,37 @@
     }
   }
 
+  verup = () => {
+    confirm({
+      title: '鐗堟湰鍗囩骇',
+      content: '閲嶆柊鍔犺浇搴旂敤淇℃伅',
+      onOk() {
+        return new Promise(resolve => {
+          if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
+            notification.warning({
+              top: 92,
+              message: '鍗囩骇澶辫触锛岃鍒锋柊椤甸潰閲嶈瘯锛�',
+              duration: 2
+            })
+            resolve()
+          } else {
+            Api.updateAppVersion()
+            setTimeout(() => {
+              notification.success({
+                top: 92,
+                message: '鍗囩骇鎴愬姛锛�',
+                duration: 2
+              })
+              resolve()
+            }, 1000)
+          }
+        })
+      },
+      onCancel() {}
+    })
+  }
+
+
   render () {
     const { mainMenu, collapse } = this.props
     const { thdMenuList, searchkey, debug, menulist, navBar, menuType } = this.state
@@ -680,8 +709,8 @@
           ))}
         </Menu.SubMenu> : null}
         <Menu.Item key="doc" onClick={this.gotoDoc}>{this.state.dict['main.doc']}</Menu.Item>
-        <Menu.Item style={{padding: 0}} key="verup">
-          <VersionsUp debug={debug} />
+        <Menu.Item key="verup" onClick={this.verup}>
+          鐗堟湰鍗囩骇
         </Menu.Item>
         <Menu.Item key="logout" onClick={this.logout}>{this.state.dict['main.logout']}</Menu.Item>
       </Menu>

--
Gitblit v1.8.0