Skip to content

Commit 91e2800

Browse files
committed
fix: invoke in main thread
1 parent 6c6777d commit 91e2800

File tree

1 file changed

+8
-4
lines changed
  • modules/tool/packages/wecomCorpId/src

1 file changed

+8
-4
lines changed

modules/tool/packages/wecomCorpId/src/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { z } from 'zod';
2-
import { invoke } from '@/invoke';
3-
import type { getCorpTokenResult } from '@/invoke/wecom/getAuthToken';
2+
import { getCorpToken } from '@/invoke/wecom/getAuthToken';
3+
import type { RunToolSecondParamsType } from '@tool/type/req';
44

55
export const InputType = z.object({});
66

@@ -9,9 +9,13 @@ export const OutputType = z.object({
99
expires_in: z.number()
1010
});
1111

12-
export async function tool(): Promise<z.infer<typeof OutputType>> {
12+
export async function tool(
13+
_params: z.infer<typeof InputType>,
14+
{ systemVar }: RunToolSecondParamsType
15+
): Promise<z.infer<typeof OutputType>> {
1316
// 调用 wecom.getAuthToken 获取企业微信授权 token
14-
const result = await invoke<getCorpTokenResult>('wecom.getCorpToken');
17+
// const result = await invoke<getCorpTokenResult>('wecom.getCorpToken');
18+
const result = await getCorpToken({}, systemVar);
1519

1620
return {
1721
access_token: result.access_token,

0 commit comments

Comments
 (0)