refactor: 将请求封装重构为函数模式

This commit is contained in:
yangsy
2026-01-05 11:30:20 +08:00
parent fd70f63fc9
commit 263dd5edfc
4 changed files with 52 additions and 55 deletions

View File

@@ -1,9 +1,9 @@
import router from '@/router';
import { useUserStore } from '@/stores';
import { getAppEnvConfig, RequestClient } from '@/utils';
import { createHttpClient, getAppEnvConfig } from '@/utils';
import type { AxiosError } from 'axios';
export const userClient = new RequestClient({
export const userClient = createHttpClient({
requestInterceptor: (config) => {
const userStore = useUserStore();
const { lampAuthorization, lampClientId, lampClientSecret } = getAppEnvConfig();