Merge branch 'main' into ruoyi

This commit is contained in:
xlsea
2024-08-30 15:56:48 +08:00
10 changed files with 888 additions and 737 deletions

View File

@ -20,6 +20,9 @@ declare namespace Api {
rows: T[];
}
/** common search params of table */
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
/**
* enable status
*

View File

@ -26,7 +26,7 @@ declare namespace NaiveUI {
type TableColumn<T> = TableColumnWithKey<T> | DataTableSelectionColumn<T> | DataTableExpandColumn<T>;
type TableApiFn<T = any, R = Api.SystemManage.CommonSearchParams> = (
type TableApiFn<T = any, R = Api.Common.CommonSearchParams> = (
params: R
) => Promise<FlatResponseData<Api.Common.PaginatingQueryRecord<T>>>;

View File

@ -1,3 +1,5 @@
import json5 from 'json5';
/**
* Create service config by current env
*
@ -8,10 +10,12 @@ export function createServiceConfig(env: Env.ImportMeta) {
let other = {} as Record<App.Service.OtherBaseURLKey, string>;
try {
other = JSON.parse(VITE_OTHER_SERVICE_BASE_URL || '{}');
if (VITE_OTHER_SERVICE_BASE_URL) {
other = json5.parse(VITE_OTHER_SERVICE_BASE_URL);
}
} catch (error) {
// eslint-disable-next-line no-console
console.error('VITE_OTHER_SERVICE_BASE_URL is not a valid JSON string');
console.error('VITE_OTHER_SERVICE_BASE_URL is not a valid json5 string');
}
const httpConfig: App.Service.SimpleServiceConfig = {