diff --git a/packages/presets/nocobase/src/client/index.ts b/packages/presets/nocobase/src/client/index.ts index 4c6999be9..4c568f378 100644 --- a/packages/presets/nocobase/src/client/index.ts +++ b/packages/presets/nocobase/src/client/index.ts @@ -21,7 +21,16 @@ export class NocoBaseClientPresetPlugin extends Plugin { return config; }); this.app.pm.add(NocoBaseBuildInPlugin); - await this.loadRemotePlugin(); + try { + await this.loadRemotePlugin(); + } catch (error) { + if (401 === error?.response?.status) { + this.app.apiClient.auth.setRole(null); + window.location.reload(); + } else { + throw error; + } + } } // TODO: 现在是先远程加载远程组件的名称,然后再加载本地组件