From e82ee73704c140127ed46c8f4fd1183acbb7e97f Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 20 十一月 2024 10:47:31 +0800
Subject: [PATCH] 用户头像http(s)链接支持
---
src/utils/validate.js | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/utils/validate.js b/src/utils/validate.js
index 71d0d06..8d32dc0 100644
--- a/src/utils/validate.js
+++ b/src/utils/validate.js
@@ -1,9 +1,21 @@
/**
- * 鍒ゆ柇url鏄惁鏄痟ttp鎴杊ttps
- * @param {string} path
+ * 鍒ゆ柇value瀛楃涓叉槸鍚︿负绌�
+ * @param {string} value
* @returns {Boolean}
*/
- export function isHttp(url) {
+export function isEmpty(value) {
+ if (value == null || value == "" || value == undefined || value == "undefined") {
+ return true;
+ }
+ return false;
+}
+
+/**
+ * 鍒ゆ柇url鏄惁鏄痟ttp鎴杊ttps
+ * @param {string} url
+ * @returns {Boolean}
+ */
+export function isHttp(url) {
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
}
@@ -12,7 +24,7 @@
* @param {string} path
* @returns {Boolean}
*/
- export function isExternal(path) {
+export function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path)
}
--
Gitblit v1.9.3