From a03b14a32d20f9657ec371d776acfcb1ad85ebad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E5=B0=8F=E5=A4=A9?= <1638245306@qq.com> Date: Thu, 9 May 2024 10:20:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG:=20=E4=BF=AE=E5=A4=8Ddemo?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E6=96=87=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/settings.ts | 4 ++-- web/src/views/system/demo/crud.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/settings.ts b/web/src/settings.ts index 552352a..cbef494 100644 --- a/web/src/settings.ts +++ b/web/src/settings.ts @@ -21,10 +21,10 @@ export default { app.use(FastCrud, { //i18n, //i18n配置,可选,默认使用中文,具体用法请看demo里的 src/i18n/index.js 文件 // 此处配置公共的dictRequest(字典请求) - async dictRequest({dict}: any) { + async dictRequest({dict,url}: any) { const {isTree} = dict //根据dict的url,异步返回一个字典数组 - return await request({url: dict.url, params: dict.params || {}}).then((res: any) => { + return await request({url: url, params: dict.params || {}}).then((res: any) => { if (isTree) { return XEUtils.toArrayTree(res.data, {parentKey: 'parent'}) } diff --git a/web/src/views/system/demo/crud.tsx b/web/src/views/system/demo/crud.tsx index cb6d0ac..b18ce69 100644 --- a/web/src/views/system/demo/crud.tsx +++ b/web/src/views/system/demo/crud.tsx @@ -111,7 +111,9 @@ export const createCrudOptions = function ({ username: { title: '测试自定义组件', dict:dict({ - url:'/api/system/role/', + url({form}){ + return '/api/system/role/' + }, label:'name', value:'id' }),