Sfoglia il codice sorgente

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

huangbin 4 anni fa
parent
commit
984db9398d
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      src/common/setup/validate/index.ts

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

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