!159 eslint升级v9版本

* update: eslint升级v9版本 & 更新一些不符合校验规则的代码
This commit is contained in:
玲娜贝er
2024-11-27 07:39:34 +00:00
committed by LiuHao
parent f3425493ed
commit 845b848b60
9 changed files with 102 additions and 36 deletions

View File

@ -66,7 +66,7 @@ const closeSearch = () => {
state.isShowSearch = false;
};
// 菜单搜索数据过滤
const menuSearch = (queryString: string, cb: Function) => {
const menuSearch = (queryString: string, cb: (options: any[]) => void) => {
let options = state.menuList.filter((item) => {
return item.title.indexOf(queryString) > -1;
});

View File

@ -40,7 +40,7 @@ router.beforeEach(async (to, from, next) => {
router.addRoute(route); // 动态添加可访问路由表
}
});
// @ts-ignore
// @ts-expect-error hack方法 确保addRoutes已完成
next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成
}
} else {

View File

@ -92,7 +92,7 @@ const registerRules: ElFormRules = {
password: [
{ required: true, trigger: 'blur', message: '请输入您的密码' },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' }
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\ |', trigger: 'blur' }
],
confirmPassword: [
{ required: true, trigger: 'blur', message: '请再次输入您的密码' },

View File

@ -393,7 +393,7 @@ const initData: PageData<UserForm, UserQuery> = {
message: '用户密码长度必须介于 5 和 20 之间',
trigger: 'blur'
},
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' }
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\ |', trigger: 'blur' }
],
email: [
{
@ -506,7 +506,7 @@ const handleResetPwd = async (row: UserVO) => {
inputErrorMessage: '用户密码长度必须介于 5 和 20 之间',
inputValidator: (value) => {
if (/<|>|"|'|\||\\/.test(value)) {
return '不能包含非法字符:< > " \' \\\ |';
return '不能包含非法字符:< > " \' \\ |';
}
}
})

View File

@ -45,7 +45,7 @@ const rules = ref({
message: '长度在 6 到 20 个字符',
trigger: 'blur'
},
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\\ |', trigger: 'blur' }
{ pattern: /^[^<>"'|\\]+$/, message: '不能包含非法字符:< > " \' \\ |', trigger: 'blur' }
],
confirmPassword: [
{ required: true, message: '确认密码不能为空', trigger: 'blur' },

View File

@ -63,7 +63,7 @@ const emit = defineEmits(['ok']);
/** 查询参数列表 */
const show = (dataName: string) => {
getDataNames().then(res => {
getDataNames().then((res) => {
if (res.code == 200) {
dataNameList.value = res.data;
if (dataName) {