From 5bd3c6fc05b2548195ebe78bc4cec04886b51ca2 Mon Sep 17 00:00:00 2001
From: wangqi <magical1908@outlook.com>
Date: 星期五, 02 四月 2021 14:22:03 +0800
Subject: [PATCH] Merge branch 'develop' of http://xearth.cn:6600/r/wuyushui/SewerAndRainNetwork into develop

---
 src/utils/tools.js |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/src/utils/tools.js b/src/utils/tools.js
index 9aeb1f0..f47703e 100644
--- a/src/utils/tools.js
+++ b/src/utils/tools.js
@@ -1,9 +1,9 @@
 
 import * as $CONST from './constant'
+import { Message } from 'element-ui'
 // import { notify } from '@nutui/nutui'
 
 export const _ = require('lodash')
-const notify = window.vm.$notify
 /**
  * 闆嗗悎杞崲涓篔SON
  * @param obj collection鏁版嵁
@@ -25,7 +25,16 @@
   })
   return arr
 }
-
+/**
+ * 鏍规嵁涓嶅悓鐨勫崗璁紝鏇挎崲env閰嶇疆鏂囦欢涓殑URL鍗忚
+ *
+ * @return {String}
+ */
+export function getSchemeHost () {
+  const protocol = window.location.protocol
+  const host = process.env.VUE_APP_API_HOST
+  return host.replace(/scheme/g, protocol)
+}
 /**
  * collection鏁版嵁杞崲涓烘爣鍑咼SON
  * @param obj collection鏁版嵁
@@ -993,23 +1002,38 @@
 }
 
 export function success (msg = $CONST.MSG_SYS_SUCCESS) {
-  notify.success(msg)
+  Message({
+    message: msg,
+    type: 'success'
+  })
 }
 
 export function fail (msg = $CONST.MSG_SYS_FAIL) {
-  notify.warn(msg)
+  Message({
+    message: msg,
+    type: 'error'
+  })
 }
 
 export function error (msg = $CONST.MSG_SYS_ERR) {
-  notify.danger(msg)
+  Message({
+    message: msg,
+    type: 'error'
+  })
 }
 
 export function warning (msg = $CONST.MSG_SYS_WARNING) {
-  notify.warn(msg)
+  Message({
+    message: msg,
+    type: 'warning'
+  })
 }
 
 export function info (msg = $CONST.MSG_SYS_CANCELED) {
-  notify.primary(msg)
+  Message({
+    message: msg,
+    type: 'info'
+  })
 }
 
 /**

--
Gitblit v1.8.0