重构前端:抽离发布表单逻辑

This commit is contained in:
yml
2026-05-25 01:26:15 +08:00
parent a8dc96aa3b
commit 3cf236def6
9 changed files with 1343 additions and 1599 deletions
+3 -2
View File
@@ -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
}
}