“提交项目”
This commit is contained in:
29
ui/src/api/auth.js
Normal file
29
ui/src/api/auth.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import { http } from './http'
|
||||
|
||||
export async function getCaptcha() {
|
||||
const { data } = await http.get('/api/auth/captcha')
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function login(req) {
|
||||
const { data } = await http.post('/api/auth/login', req)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function register(req) {
|
||||
const { data } = await http.post('/api/auth/register', req)
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function me() {
|
||||
const { data } = await http.get('/api/auth/me')
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function updateProfile(data) {
|
||||
await http.post('/api/auth/profile', data)
|
||||
}
|
||||
|
||||
export async function updatePassword(data) {
|
||||
await http.post('/api/auth/password', data)
|
||||
}
|
||||
Reference in New Issue
Block a user