We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本:^1.8.1 设置的自定义请求头不起作用
import { data } from '../../../env'; import * as lark from '@larksuiteoapi/node-sdk'; const client = new lark.Client({ appId: data.appId, appSecret: data.appSecret, }); class Feishu { public accessToken = 't-g1041gdxODD4F2FX5VTFKDXFNG3DO24Z5MDPLBBF'; public getChatIdByRobotId() { return client.im.chat.list(undefined, { headers: { Authorization: `Bearer ${this.accessToken}`, }, } // lark.withTenantToken(`Bearer ${this.accessToken}`) ); } } const service = new Feishu(); service.getChatIdByRobotId();
The text was updated successfully, but these errors were encountered:
自己传token的话,需要在构造Client的参数中传递disableTokenCache: true禁用SDK获取token行为:
disableTokenCache: true
const client = new lark.Client({ appId: data.appId, appSecret: data.appSecret, disableTokenCache: true }); class Feishu { public accessToken = 't-g1041gdxODD4F2FX5VTFKDXFNG3DO24Z5MDPLBBF'; public getChatIdByRobotId() { return client.im.chat.list({}, lark.withTenantToken(`Bearer ${this.accessToken}`)); } }
或者也可以使用lark.withUserAccessToken()来传递自定义token:
lark.withUserAccessToken()
const client = new lark.Client({ appId: data.appId, appSecret: data.appSecret }); class Feishu { public accessToken = 't-g1041gdxODD4F2FX5VTFKDXFNG3DO24Z5MDPLBBF'; public getChatIdByRobotId() { return client.im.chat.list({}, lark.withUserAccessToken(`Bearer ${this.accessToken}`)); } }
Sorry, something went wrong.
No branches or pull requests
版本:^1.8.1
设置的自定义请求头不起作用
The text was updated successfully, but these errors were encountered: