This commit is contained in:
hptangxi
2025-07-06 19:42:24 +08:00
parent 633645724c
commit ac4ac0e753
5 changed files with 242 additions and 44 deletions

View File

@@ -2,6 +2,12 @@ import { useAuthService } from "@/services/auth";
import axios from "axios";
import { appState } from "./app-state";
declare module "axios" {
interface AxiosRequestConfig {
hideMessage?: boolean;
}
}
const http = axios.create({
baseURL: "/api",
timeout: 10000,
@@ -22,7 +28,7 @@ http.interceptors.request.use(config => {
http.interceptors.response.use(
response => {
appState.loading = false;
if (response.config.method !== "get") {
if (response.config.method !== "get" && !response.config.hideMessage) {
window.$message.success("操作成功");
}
return response.data;