瀏覽代碼

千海金 客户资料 处理空格验证

huangbin 4 年之前
父節點
當前提交
984db9398d
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/common/setup/validate/index.ts

+ 4 - 1
src/common/setup/validate/index.ts

@@ -5,7 +5,10 @@
  * @returns
  * @returns
  */
  */
 export function validateCommon(value: any, errInfo: string) {
 export function validateCommon(value: any, errInfo: string) {
-    if (value) {
+    if (typeof value === 'string') {
+        value = value.trim()
+    }
+    if (!value) {
         return Promise.reject(errInfo);
         return Promise.reject(errInfo);
     } else {
     } else {
         return Promise.resolve();
         return Promise.resolve();