diff --git a/packages/@steedos-widgets/amis-object/src/amis/AmisAppMenu.tsx b/packages/@steedos-widgets/amis-object/src/amis/AmisAppMenu.tsx index 4578f602d..657540ff0 100644 --- a/packages/@steedos-widgets/amis-object/src/amis/AmisAppMenu.tsx +++ b/packages/@steedos-widgets/amis-object/src/amis/AmisAppMenu.tsx @@ -2,7 +2,7 @@ * @Author: baozhoutao@steedos.com * @Date: 2022-09-01 14:44:57 * @LastEditors: baozhoutao@steedos.com - * @LastEditTime: 2024-09-25 10:52:17 + * @LastEditTime: 2024-09-25 15:41:48 * @Description: */ import './AmisAppMenu.less'; @@ -301,7 +301,7 @@ export const AmisAppMenu = async (props) => { "api": { "url": "/service/api/objects/create_by_design", "method": "post", - "adaptor": "window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`);return {}", + "adaptor": "window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`+'&retUrl='+window.location.href);return {}", "requestAdaptor": "api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel}; return api;", "messages": {} } @@ -418,7 +418,7 @@ export const AmisAppMenu = async (props) => { "api": { "url": "/service/api/pages/create_page_by_design", "method": "post", - "adaptor": "window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`);return {}", + "adaptor": "window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`+'&retUrl='+window.location.href);return {}", "requestAdaptor": "api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;", "messages": {} } @@ -893,7 +893,7 @@ export const AmisAppMenu = async (props) => { "actions": [ { "actionType": "custom", - "script": "window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +\`&assetUrls=\${Builder.settings.assetUrls}\`)" + "script": "window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +\`&assetUrls=\${Builder.settings.assetUrls}\`+'&retUrl='+window.location.href)" } ] } @@ -913,7 +913,7 @@ export const AmisAppMenu = async (props) => { "api": { "url": "/graphql", "method": "post", - "adaptor": "const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + pageId +\`&assetUrls=\${Builder.settings.assetUrls}\`)}catch(e){payload.error=e.message;} }; return payload;", + "adaptor": "const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + pageId +\`&assetUrls=\${Builder.settings.assetUrls}\`+'&retUrl='+window.location.href)}catch(e){payload.error=e.message;} }; return payload;", "requestAdaptor": "api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name page page__expand { _id } }}'}; return api;", "messages": {} } @@ -1333,7 +1333,7 @@ export const AmisAppMenu = async (props) => { "api": { "url": "/service/api/objects/create_by_design", "method": "post", - "adaptor": "window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`);return {}", + "adaptor": "window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`+'&retUrl='+window.location.href);return {}", "requestAdaptor": "api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel}; return api;", "messages": {} } @@ -1450,7 +1450,7 @@ export const AmisAppMenu = async (props) => { "api": { "url": "/service/api/pages/create_page_by_design", "method": "post", - "adaptor": "window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`);return {}", + "adaptor": "window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +\`&assetUrls=\${Builder.settings.assetUrls}\`+'&retUrl='+window.location.href);return {}", "requestAdaptor": "api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;", "messages": {} }