From eaa9bb0bd29067199d546ddbc9eea64f3d0ca7d1 Mon Sep 17 00:00:00 2001 From: sealday Date: Thu, 18 Jul 2024 13:11:31 +0800 Subject: [PATCH] fix: dingtalk server using tachbase/client (#1342) Co-authored-by: sealday Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1342 --- .../src/server/{auth.ts => dingtalk-auth.ts} | 4 ++-- .../src/server/{client.ts => dingtalk-client.ts} | 0 .../@tachybase/plugin-dingtalk/src/server/plugin.ts | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) rename packages/plugins/@tachybase/plugin-dingtalk/src/server/{auth.ts => dingtalk-auth.ts} (95%) rename packages/plugins/@tachybase/plugin-dingtalk/src/server/{client.ts => dingtalk-client.ts} (100%) diff --git a/packages/plugins/@tachybase/plugin-dingtalk/src/server/auth.ts b/packages/plugins/@tachybase/plugin-dingtalk/src/server/dingtalk-auth.ts similarity index 95% rename from packages/plugins/@tachybase/plugin-dingtalk/src/server/auth.ts rename to packages/plugins/@tachybase/plugin-dingtalk/src/server/dingtalk-auth.ts index 25430811f..fb6f51165 100644 --- a/packages/plugins/@tachybase/plugin-dingtalk/src/server/auth.ts +++ b/packages/plugins/@tachybase/plugin-dingtalk/src/server/dingtalk-auth.ts @@ -1,9 +1,9 @@ import { BaseAuth } from '@tachybase/auth'; import { namespace } from '../constants'; -import { DingtalkClient } from './client'; +import { DingtalkClient } from './dingtalk-client'; -export class Auth extends BaseAuth { +export class DingtalkAuth extends BaseAuth { constructor(config) { const { ctx } = config; super({ diff --git a/packages/plugins/@tachybase/plugin-dingtalk/src/server/client.ts b/packages/plugins/@tachybase/plugin-dingtalk/src/server/dingtalk-client.ts similarity index 100% rename from packages/plugins/@tachybase/plugin-dingtalk/src/server/client.ts rename to packages/plugins/@tachybase/plugin-dingtalk/src/server/dingtalk-client.ts diff --git a/packages/plugins/@tachybase/plugin-dingtalk/src/server/plugin.ts b/packages/plugins/@tachybase/plugin-dingtalk/src/server/plugin.ts index c8e98a30e..2d5432901 100644 --- a/packages/plugins/@tachybase/plugin-dingtalk/src/server/plugin.ts +++ b/packages/plugins/@tachybase/plugin-dingtalk/src/server/plugin.ts @@ -1,9 +1,8 @@ -import { tval } from '@tachybase/client'; import { Gateway, Plugin } from '@tachybase/server'; -import { authType, namespace } from '../constants'; +import { authType } from '../constants'; import { getAuthUrl, redirect } from './actions/dingding'; -import { Auth } from './auth'; +import { DingtalkAuth } from './dingtalk-auth'; export class PluginDingdingServer extends Plugin { async afterAdd() {} @@ -11,10 +10,8 @@ export class PluginDingdingServer extends Plugin { async beforeLoad() {} async load() { - console.log('hello world dingding'); this.app.authManager.registerTypes(authType, { - auth: Auth, - title: tval('DingTalk', { ns: namespace }), + auth: DingtalkAuth, }); this.app.resourcer.define({ name: 'dingtalk',