用户管理
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user