Browse Source

【优化】中文判断

cherishsince 11 tháng trước cách đây
mục cha
commit
d974124918
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/views/ai/utils/common-utils.ts

+ 1 - 1
src/views/ai/utils/common-utils.ts

@@ -9,5 +9,5 @@
 
 /**  判断字符串是否包含中文  */
 export const hasChinese = async (str) => {
-  return /[\u4E00-\u9FA5]+/g.test(str)
+  return /[\u4e00-\u9fa5]/.test(str)
 }