@ddj-v2/user-management 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.ts +7 -0
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -281,6 +281,13 @@ export async function apply(ctx: Context) {
281
281
  };
282
282
  return DomainUserHandler;
283
283
  });
284
+ ctx.withHandlerClass('SwitchAccount', (SwitchAccountHandler : { prototype: any }) => {
285
+ SwitchAccountHandler.prototype.get = SwitchAccountHandler.prototype.post = async function() {
286
+ throw new PermissionError(`SwitchAccountHandler get called, but it should be overridden by user management plugin.
287
+ If you really need this feature, please contact the administrator to enable the user management plugin.`);
288
+ };
289
+ return SwitchAccountHandler;
290
+ });
284
291
  // 添加国际化支持
285
292
  ctx.i18n.load('zh', {
286
293
  'user_manage_main': '用户管理',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddj-v2/user-management",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "Advanced user management plugin for Hydro",
5
5
  "main": "index.ts",
6
6
  "author": "Grass_cat",