mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: 1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import { get } from "lodash-es";
|
||||
import Adapter from "axios-mock-adapter";
|
||||
import { errorLog, errorCreate } from "./tools";
|
||||
import { errorLog, errorCreate, response } from "./tools";
|
||||
import { env } from "/src/utils/util.env";
|
||||
import { useUserStore } from "../store/modules/user";
|
||||
/**
|
||||
@@ -96,6 +96,10 @@ function createService() {
|
||||
const userStore = useUserStore();
|
||||
userStore.logout();
|
||||
}
|
||||
|
||||
if (error?.config?.onError) {
|
||||
error.config.onError(error);
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -55,6 +55,9 @@ export function errorLog(error: any) {
|
||||
if (error.response?.data?.message) {
|
||||
message = error.response.data.message;
|
||||
}
|
||||
if (message.indexOf("ssl3_get_record:wrong version number" > -1)) {
|
||||
message = "http协议错误,服务端要求http协议,请检查是否使用了https请求";
|
||||
}
|
||||
// 显示提示
|
||||
uiContext.get().notification.error({ message });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user