优化代码实现。

This commit is contained in:
scholar
2024-09-06 16:14:59 +08:00
parent f01dc0a539
commit 2205526a79
3 changed files with 252 additions and 119 deletions

View File

@ -1,6 +1,6 @@
import request from '@/config/axios'
import { getRefreshToken } from '@/utils/auth'
import type { UserLoginVO } from './types'
import type {RegisterVO, UserLoginVO} from './types'
export interface SmsCodeVO {
mobile: string
@ -17,6 +17,12 @@ export const login = (data: UserLoginVO) => {
return request.post({ url: '/system/auth/login', data })
}
// 注册
export const register = (data: RegisterVO) => {
console.log("data: RegisterVO=========",data)
return request.post({ url: '/system/auth/register', data })
}
// 刷新访问令牌
export const refreshToken = () => {
return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() })

View File

@ -29,3 +29,10 @@ export type UserVO = {
loginIp: string
loginDate: string
}
export type RegisterVO = {
tenantName: string
username: string
password: string
captchaVerification: string
}