diff --git a/activitylink/src/views/zhongchou/gift/importFixedList/index.vue b/activitylink/src/views/zhongchou/gift/importFixedList/index.vue index 96ffd3f..54cc367 100644 --- a/activitylink/src/views/zhongchou/gift/importFixedList/index.vue +++ b/activitylink/src/views/zhongchou/gift/importFixedList/index.vue @@ -265,8 +265,8 @@ const trimAddJwcode = (value) => { // 添加处理用户名输入的函数 const trimUsername = (value) => { - // 只允许中文、英文字符 - const filteredValue = value.replace(/[^\u4e00-\u9fa5a-zA-Z]/g, ''); + // 只允许中文、英文字符、0-9 + const filteredValue = value.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, ''); // 限制最长30个字符 addObj.value.username = filteredValue.slice(0, 30); } diff --git a/activitylink/src/views/zhongchou/gift/importuser/index.vue b/activitylink/src/views/zhongchou/gift/importuser/index.vue index 376e7bc..643fa00 100644 --- a/activitylink/src/views/zhongchou/gift/importuser/index.vue +++ b/activitylink/src/views/zhongchou/gift/importuser/index.vue @@ -247,8 +247,8 @@ const trimAddJwcode = (value) => { // 添加处理用户名输入的函数 const trimUsername = (value) => { - // 只允许中文、英文字符 - const filteredValue = value.replace(/[^\u4e00-\u9fa5a-zA-Z]/g, ''); + // 只允许中文、英文字符和数字0-9 + const filteredValue = value.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, ''); // 限制最长30个字符 addObj.value.username = filteredValue.slice(0, 30); }