mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
upgrade third party dependencies
This commit is contained in:
Vendored
+3
@@ -1,3 +1,6 @@
|
||||
declare module 'vuetify/styles';
|
||||
declare module 'framework7-icons';
|
||||
|
||||
declare const __EZBOOKKEEPING_IS_PRODUCTION__: boolean;
|
||||
declare const __EZBOOKKEEPING_VERSION__: string;
|
||||
declare const __EZBOOKKEEPING_BUILD_UNIX_TIME__: string;
|
||||
|
||||
+21
-11
@@ -22,6 +22,7 @@ import type {
|
||||
} from '@/models/data_management.ts';
|
||||
|
||||
import {
|
||||
isArray,
|
||||
isObject,
|
||||
isString,
|
||||
isNumber
|
||||
@@ -380,19 +381,28 @@ export const useUserStore = defineStore('user', () => {
|
||||
function getExportedUserData(fileType: string, req?: ExportTransactionDataRequest): Promise<Blob> {
|
||||
return new Promise((resolve, reject) => {
|
||||
services.getExportedUserData(fileType, req).then(response => {
|
||||
if (response && response.headers) {
|
||||
const contentType = response.headers['content-type']?.toString() || '';
|
||||
|
||||
if (fileType === 'csv' && !KnownFileType.CSV.isSameType(contentType)) {
|
||||
reject({ message: 'Unable to retrieve exported user data' });
|
||||
return;
|
||||
} else if (fileType === 'tsv' && !KnownFileType.TSV.isSameType(contentType)) {
|
||||
reject({ message: 'Unable to retrieve exported user data' });
|
||||
return;
|
||||
}
|
||||
if (!response || !response.data) {
|
||||
reject({ message: 'Unable to retrieve exported user data' });
|
||||
return;
|
||||
}
|
||||
|
||||
const blob = new Blob([response.data], { type: response.headers['content-type'] });
|
||||
let contentType = response.headers['content-type'] ?? '';
|
||||
|
||||
if (isArray(contentType)) {
|
||||
contentType = contentType[0] ?? '';
|
||||
}
|
||||
|
||||
contentType = contentType.toString();
|
||||
|
||||
if (fileType === 'csv' && !KnownFileType.CSV.isSameType(contentType)) {
|
||||
reject({ message: 'Unable to retrieve exported user data' });
|
||||
return;
|
||||
} else if (fileType === 'tsv' && !KnownFileType.TSV.isSameType(contentType)) {
|
||||
reject({ message: 'Unable to retrieve exported user data' });
|
||||
return;
|
||||
}
|
||||
|
||||
const blob = new Blob([response.data], { type: contentType });
|
||||
resolve(blob);
|
||||
}).catch(error => {
|
||||
logger.error('failed to retrieve user statistics data', error);
|
||||
|
||||
Reference in New Issue
Block a user