浏览代码

【优化】中文判断

cherishsince 11 月之前
父节点
当前提交
d974124918
共有 1 个文件被更改,包括 1 次插入1 次删除
  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)
 }