halo/console
Takagi bce65c4947
fix: handle external exceptions when uploading files (#4431)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.9.x

#### What this PR does / why we need it:

原先使用 uppy 上传文件时抛出异常时,处理了 Halo 系统内部异常,但并未处理外部抛出的异常,例如反向代理等,因而会导致上传文件时卡在 0% 或者 100%。
更改之后当上传抛出异常时,首先会尝试将异常信息转换为 JSON,如果转换失败,则代表为外部异常,此时会抛出异常信息,异常信息格式为 `status: statusText`。

<img width="1045" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/228a73aa-b22e-40f9-b69d-3180e2f78032">


#### How to test it?

在 Halo 上传接口前增加一层反向代理,并设置最大允许文件值,之后上传超过其值的文件进行尝试,若能够成功抛出异常即可。

#### Which issue(s) this PR fixes:

Fixes #4359 

#### Does this PR introduce a user-facing change?
```release-note
修复上传文件时由于外部异常而导致进度条不变的问题
```
2023-08-15 10:02:12 +00:00
..
.changeset Move root to console 2023-03-02 15:49:22 +08:00
.husky Refactor workflow for new console project (#3445) 2023-03-02 18:07:23 +08:00
.vscode Move root to console 2023-03-02 15:49:22 +08:00
cypress Move root to console 2023-03-02 15:49:22 +08:00
docs Support backup and restore (#4206) 2023-07-24 08:26:16 +00:00
packages refactor: improve the system initialization process (#4306) 2023-08-11 09:10:35 +08:00
public Move root to console 2023-03-02 15:49:22 +08:00
src fix: handle external exceptions when uploading files (#4431) 2023-08-15 10:02:12 +00:00
.editorconfig Move root to console 2023-03-02 15:49:22 +08:00
.env.development Configure default external-url as slash (#3655) 2023-04-03 03:50:13 +00:00
.env.production Move root to console 2023-03-02 15:49:22 +08:00
.eslintrc.cjs chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
.gitignore Refactor workflow for new console project (#3445) 2023-03-02 18:07:23 +08:00
.gitpod.yml Move root to console 2023-03-02 15:49:22 +08:00
.npmignore Move root to console 2023-03-02 15:49:22 +08:00
.npmrc Move root to console 2023-03-02 15:49:22 +08:00
.prettierignore feat: add i18n supports for console (#3506) 2023-03-23 08:54:33 +00:00
Makefile Support publishing to maven central repository (#3767) 2023-04-18 14:28:23 +08:00
OWNERS Refactor workflow for new console project (#3445) 2023-03-02 18:07:23 +08:00
README.md chore: bump pnpm version to 8 (#3935) 2023-05-11 08:50:21 +00:00
cypress.json Move root to console 2023-03-02 15:49:22 +08:00
env.d.ts chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
index.html perf: remove html lang attribute in console (#4085) 2023-06-19 01:30:10 +00:00
package.json chore: bump formkit version to 0.17.5 (#4411) 2023-08-13 14:40:12 +00:00
pnpm-lock.yaml chore: bump formkit version to 0.17.5 (#4411) 2023-08-13 14:40:12 +00:00
pnpm-workspace.yaml Move root to console 2023-03-02 15:49:22 +08:00
postcss.config.js fix: modal height issue in ios devices (#4106) 2023-06-25 02:06:14 +00:00
prettier.config.js Move root to console 2023-03-02 15:49:22 +08:00
tailwind.config.js Move root to console 2023-03-02 15:49:22 +08:00
tsconfig.app.json refactor: improve the system initialization process (#4306) 2023-08-11 09:10:35 +08:00
tsconfig.json chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
tsconfig.node.json chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
tsconfig.vitest.json Move root to console 2023-03-02 15:49:22 +08:00
vite.config.ts chore: use rollup-plugin-gzip instead of vite-compression-plugin (#4354) 2023-08-02 13:12:25 +00:00
vitest.config.ts Move root to console 2023-03-02 15:49:22 +08:00

README.md

README

Halo logo

Halo 2.0 的管理端项目(原 halo-admin

GitHub release GitHub GitHub last commit GitHub Workflow Status Gitpod ready-to-code


当前仓库已经将 halo-admin 改为了 console。但对于 Halo 1.x 版本,依旧保持 halo-admin 的概念。

开发环境运行

npm install -g pnpm@8
pnpm install 
pnpm build:packages
pnpm dev

生产构建

pnpm build

状态

Repobeats analytics