用户管理

This commit is contained in:
仲么了
2024-01-22 14:21:31 +08:00
parent 08e0e9e013
commit 0bf750e5ae
13 changed files with 432 additions and 451 deletions

View File

@@ -128,3 +128,20 @@ export const timeFormat = (dateTime: string | number | null = null, fmt = 'yyyy-
}
return fmt
}
/**
* el-form 密码正则校验 密码需要包含特殊字符字母数字长度为8-16
*/
export const validatePwd = (rule: any, value: string, callback: any) => {
if (value === '') {
callback(new Error('请输入密码'))
} else {
const reg = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@#$%^&+=!])(?=.*[a-zA-Z0-9])[A-Za-z\d@#$%^&+=!]{8,16}$/
if (!reg.test(value)) {
callback(new Error('密码需要包含特殊字符字母数字长度为8-16'))
} else {
callback()
}
}
}

View File

@@ -1,7 +1,7 @@
import type { AxiosRequestConfig, Method } from 'axios'
import axios from 'axios'
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
import { refreshToken } from '@/api/user'
import { refreshToken } from '@/api/user-boot/user'
import router from '@/router/index'
import { useAdminInfo } from '@/stores/adminInfo'
@@ -67,8 +67,6 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
// 自动携带token
if (config.headers) {
const token = adminInfo.getToken()
console.log(token)
console.log(token.length, 'token')
if (token) {
;(config.headers as anyObj).Authorization = token
} else {