feat(app): migrate auth pages to Vue SPA (stage 2)
This commit is contained in:
41
app-frontend/src/api/auth.js
Normal file
41
app-frontend/src/api/auth.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { publicApi } from './http'
|
||||
|
||||
export async function fetchEmailVerifyStatus() {
|
||||
const { data } = await publicApi.get('/email/verify-status')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function generateCaptcha() {
|
||||
const { data } = await publicApi.post('/generate_captcha', {})
|
||||
return data
|
||||
}
|
||||
|
||||
export async function login(payload) {
|
||||
const { data } = await publicApi.post('/login', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function register(payload) {
|
||||
const { data } = await publicApi.post('/register', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function resendVerifyEmail(payload) {
|
||||
const { data } = await publicApi.post('/resend-verify-email', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function forgotPassword(payload) {
|
||||
const { data } = await publicApi.post('/forgot-password', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function requestPasswordReset(payload) {
|
||||
const { data } = await publicApi.post('/reset_password_request', payload)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function confirmPasswordReset(payload) {
|
||||
const { data } = await publicApi.post('/reset-password-confirm', payload)
|
||||
return data
|
||||
}
|
||||
8
app-frontend/src/api/http.js
Normal file
8
app-frontend/src/api/http.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import axios from 'axios'
|
||||
|
||||
export const publicApi = axios.create({
|
||||
baseURL: '/api',
|
||||
timeout: 30_000,
|
||||
withCredentials: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user