重构前端:抽离发布表单逻辑
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import axios from 'axios'
|
||||
|
||||
import { apiClient } from './client'
|
||||
|
||||
export interface AdminUser {
|
||||
@@ -61,7 +63,6 @@ export async function logoutAdmin() {
|
||||
export async function refreshAdminSession() {
|
||||
const refreshToken = localStorage.getItem('admin_refresh_token')
|
||||
if (!refreshToken) throw new Error('no refresh token')
|
||||
const axios = (await import('axios')).default
|
||||
const { data } = await axios.post('/api/admin/auth/refresh', { refresh_token: refreshToken })
|
||||
return data.data as AdminTokenPair
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user