EENE Dashboard upload to Gitea
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,10 @@ export function fileDownloadUrl(fileId: string): string {
|
||||
return `${baseURL}/files/${fileId}/download`;
|
||||
}
|
||||
|
||||
export function fileHwpPreviewUrl(fileId: string): string {
|
||||
return `${baseURL}/files/${fileId}/hwp-preview`;
|
||||
}
|
||||
|
||||
apiClient.interceptors.request.use((config) => {
|
||||
if (config.data instanceof FormData) {
|
||||
delete config.headers['Content-Type'];
|
||||
@@ -34,6 +38,14 @@ apiClient.interceptors.response.use(
|
||||
);
|
||||
|
||||
export function getApiErrorMessage(err: unknown, fallback: string): string {
|
||||
const ax = err as { response?: { data?: { message?: string }; status?: number }; message?: string };
|
||||
return ax.response?.data?.message || ax.message || fallback;
|
||||
const ax = err as {
|
||||
response?: { data?: { message?: string }; status?: number };
|
||||
message?: string;
|
||||
code?: string;
|
||||
};
|
||||
if (ax.response?.data?.message) return ax.response.data.message;
|
||||
if (!ax.response && (ax.code === 'ERR_NETWORK' || ax.message?.includes('Network Error'))) {
|
||||
return '서버에 연결할 수 없습니다. 서버 PC에서 서버시작.bat 이 실행 중인지 확인해 주세요.';
|
||||
}
|
||||
return ax.message || fallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user