mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 10:42:19 +08:00
fix(async-task-manager): get subapp name
This commit is contained in:
parent
48c35ae8c4
commit
4180913651
@ -22,6 +22,7 @@ export const useCurrentAppInfo = () => {
|
|||||||
lang: string;
|
lang: string;
|
||||||
version: string;
|
version: string;
|
||||||
exportLimit?: number;
|
exportLimit?: number;
|
||||||
|
name: string;
|
||||||
};
|
};
|
||||||
}>(CurrentAppInfoContext);
|
}>(CurrentAppInfoContext);
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@ import 'dayjs/locale/zh-cn';
|
|||||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||||
import { useT } from '../locale';
|
import { useT } from '../locale';
|
||||||
import { useAsyncTask } from '../AsyncTaskManagerProvider';
|
import { useAsyncTask } from '../AsyncTaskManagerProvider';
|
||||||
|
import { useCurrentAppInfo } from '@nocobase/client';
|
||||||
|
|
||||||
// Configure dayjs
|
// Configure dayjs
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
@ -45,6 +46,7 @@ export const AsyncTasks = () => {
|
|||||||
|
|
||||||
const plugin = usePlugin<any>('async-task-manager');
|
const plugin = usePlugin<any>('async-task-manager');
|
||||||
const app = useApp();
|
const app = useApp();
|
||||||
|
const appInfo = useCurrentAppInfo();
|
||||||
const t = useT();
|
const t = useT();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -298,7 +300,7 @@ export const AsyncTasks = () => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
const token = app.apiClient.auth.token;
|
const token = app.apiClient.auth.token;
|
||||||
const url = app.getApiUrl(
|
const url = app.getApiUrl(
|
||||||
`asyncTasks:fetchFile/${record.taskId}?token=${token}&__appName=${app.name}`,
|
`asyncTasks:fetchFile/${record.taskId}?token=${token}&__appName=${appInfo?.data?.name || app.name}`,
|
||||||
);
|
);
|
||||||
window.open(url);
|
window.open(url);
|
||||||
}}
|
}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user