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;
|
||||
version: string;
|
||||
exportLimit?: number;
|
||||
name: string;
|
||||
};
|
||||
}>(CurrentAppInfoContext);
|
||||
};
|
||||
|
@ -7,6 +7,7 @@ import 'dayjs/locale/zh-cn';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import { useT } from '../locale';
|
||||
import { useAsyncTask } from '../AsyncTaskManagerProvider';
|
||||
import { useCurrentAppInfo } from '@nocobase/client';
|
||||
|
||||
// Configure dayjs
|
||||
dayjs.extend(relativeTime);
|
||||
@ -45,6 +46,7 @@ export const AsyncTasks = () => {
|
||||
|
||||
const plugin = usePlugin<any>('async-task-manager');
|
||||
const app = useApp();
|
||||
const appInfo = useCurrentAppInfo();
|
||||
const t = useT();
|
||||
|
||||
useEffect(() => {
|
||||
@ -298,7 +300,7 @@ export const AsyncTasks = () => {
|
||||
onClick={() => {
|
||||
const token = app.apiClient.auth.token;
|
||||
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);
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user