fix: Top-level await is not available in the configured target environment
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { SystemDeptApi } from '#/api/system/dept';
|
||||
import type { SystemUserApi } from '#/api/system/user';
|
||||
|
||||
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
@@ -10,7 +11,12 @@ import { z } from '#/adapter/form';
|
||||
import { getDeptList } from '#/api/system/dept';
|
||||
import { getSimpleUserList } from '#/api/system/user';
|
||||
|
||||
const userList = await getSimpleUserList();
|
||||
let userList: SystemUserApi.User[] = [];
|
||||
async function getUserData() {
|
||||
userList = await getSimpleUserList();
|
||||
}
|
||||
|
||||
getUserData();
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { SystemTenantPackageApi } from '#/api/system/tenant-package';
|
||||
|
||||
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
@@ -8,7 +9,13 @@ import { z } from '#/adapter/form';
|
||||
import { getTenantPackageList } from '#/api/system/tenant-package';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
const tenantPackageList = await getTenantPackageList();
|
||||
let tenantPackageList: SystemTenantPackageApi.TenantPackage[] = [];
|
||||
|
||||
async function getTenantPackageData() {
|
||||
tenantPackageList = await getTenantPackageList();
|
||||
}
|
||||
|
||||
getTenantPackageData();
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
|
||||
Reference in New Issue
Block a user