import { IApi } from '@umijs/types'; export default function(api: IApi) { api.addHTMLHeadScripts(() => { return [ { content: ` window.defaultOpen = window.open; window.open = function(url, name) { let formatUrl = url; if (url.startsWith('/console')) { formatUrl = '/launcher' + url; } else { formatUrl = '/launcher/console' + url; } window.defaultOpen(formatUrl, name); }; `, }, ]; }); }