feat:新增岗位管理
This commit is contained in:
8
Yi.Pure.Vue3/src/utils/file.ts
Normal file
8
Yi.Pure.Vue3/src/utils/file.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import {isAllEmpty} from "@pureadmin/utils";
|
||||
|
||||
export function getFileUrl(fileId: string, tryPath: string): string {
|
||||
if (isAllEmpty(fileId)) {
|
||||
return tryPath;
|
||||
}
|
||||
return `${import.meta.env.VITE_APP_BASE_API}/file/${fileId}`;
|
||||
}
|
||||
@@ -12,7 +12,8 @@ import { stringify } from "qs";
|
||||
import NProgress from "../progress";
|
||||
import { getToken, formatToken } from "@/utils/auth";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
|
||||
import {message} from "@/utils/message";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
// 相关配置请参考:www.axios-js.com/zh-cn/docs/#axios-request-config-1
|
||||
const defaultConfig: AxiosRequestConfig = {
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
@@ -134,13 +135,14 @@ class PureHttp {
|
||||
}
|
||||
return response;
|
||||
},
|
||||
(error: PureHttpError) => {
|
||||
(error: any) => {
|
||||
const $error = error;
|
||||
message(error.response.data.error.message, { type: "error" });
|
||||
$error.isCancelRequest = Axios.isCancel($error);
|
||||
// 关闭进度条动画
|
||||
NProgress.done();
|
||||
// 所有的响应异常 区分来源为取消请求/非取消请求
|
||||
return Promise.reject($error);
|
||||
return Promise.reject($error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user