import "axios";
import { projectSettings as t } from "../../../../config/system-config/projectSettings.js";
import { ElNotification as a } from "element-plus";
const g = async (s, o) => {
  if (console.log("axios-响应中间件(成功响应): 响应成功处理中间件已执行"), s.response.data.code === t.resSuccessCode)
    console.log("axios-响应中间件(成功响应): 后台响应结果是成功编码: 0000"), await o();
  else {
    const e = s.response.data.code, r = s.response.data.message;
    throw a({
      type: "error",
      title: `错误码：${e}`,
      message: r,
      duration: 6e3
      // 6s自动关闭
    }), e === "1001" && console.log("axios-响应中间件(成功响应): 我是1001特定状态码执行自定义逻辑"), new Error(`后台响应结果是异常编码: ${e}`);
  }
};
export {
  g as handleSuccess
};
