diff options
| author | crupest <crupest@outlook.com> | 2021-04-02 23:16:10 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2021-04-02 23:16:10 +0800 |
| commit | d9a303d4e832dfcc7599ae750b8a4258f80ea677 (patch) | |
| tree | 64fcb4985a3463bd5a3f14bc304c99acc54b517c /FrontEnd/src/app/http | |
| parent | 11127533782ba29fe803aa030dfc2b454771891b (diff) | |
| download | timeline-d9a303d4e832dfcc7599ae750b8a4258f80ea677.tar.gz timeline-d9a303d4e832dfcc7599ae750b8a4258f80ea677.tar.bz2 timeline-d9a303d4e832dfcc7599ae750b8a4258f80ea677.zip | |
fix: Fix base64 bug for unicode string.
Diffstat (limited to 'FrontEnd/src/app/http')
| -rw-r--r-- | FrontEnd/src/app/http/common.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/FrontEnd/src/app/http/common.ts b/FrontEnd/src/app/http/common.ts index 5006109d..78ba3cda 100644 --- a/FrontEnd/src/app/http/common.ts +++ b/FrontEnd/src/app/http/common.ts @@ -1,4 +1,5 @@ import rawAxios, { AxiosError, AxiosResponse } from "axios"; +import { Base64 } from "js-base64"; export const apiBaseUrl = "/api"; @@ -63,7 +64,7 @@ export function setHttpToken(token: string | null): void { export function base64(blob: Blob | string): Promise<string> { if (typeof blob === "string") { - return Promise.resolve(btoa(blob)); + return Promise.resolve(Base64.encode(blob)); } return new Promise<string>((resolve) => { |
