Selaa lähdekoodia

服务器提示更改

Lijy 2 vuotta sitten
vanhempi
commit
c212a7edf0

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -2,8 +2,8 @@ var path = require('path')
 
 //  var ip = '127.0.0.1'
 // var ip = '192.168.2.39'
-var ip = '192.168.2.10'
-// var ip = '192.168.2.39'
+// var ip = '192.168.2.15'
+var ip = '192.168.2.39'
 // var ip = '192.168.2.12'// var ip = '47.100.37.243' 
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip

BIN
fhKeeper/formulahousekeeper/timesheet/src/assets/image/jiazai.gif


+ 21 - 2
fhKeeper/formulahousekeeper/timesheet/src/http.js

@@ -1,8 +1,25 @@
 import axios from 'axios'
 import qs from 'qs'
+import imgPath from "@/assets/image/jiazai.gif"
 
 const TIME_OUT_MS = 60 * 1000 // 默认请求超时时间
 
+function prompt() {
+    window.ELEMENT.Message({
+        message: `<div style="display: flex;justify-content: center;flex-wrap: wrap;margin: 20px 0">
+        <img src="${imgPath}" alt="" style="width: 122px;height: 85px;margin-bottom: 20px"> 
+        <p style="width: 100%;text-align: center;color: #999"> 技术人员更新系统中,请一分钟后重试</p></div>`,
+        type: 'info',
+        dangerouslyUseHTMLString: true,
+        center: true,
+        iconClass: 'el-icon'
+    })
+    console.log('执行多少次')
+}
+
+// 定时器
+let timer = null
+
 /*
  * @param response 返回数据列表
  */
@@ -56,12 +73,14 @@ export default {
                 if (exception) {
                     var str = error + ''
                     if(str.indexOf('504') != '-1' || str.indexOf('502') != '-1') {
-                        exception('服务器维护中,请稍后重试')
+                        if (timer) clearTimeout(timer)
+                        timer = setTimeout(() => {
+                            prompt()
+                        }, 3000)
                     } else {
                         exception(error)
                     }
                 } else {
-                    console.log('执行好吧')
                     console.log(error, 3)
                 }
             }