Skip to content

Commit 5b5ced1

Browse files
author
关红福
committed
- 查询通讯录接口由使用通讯录 secret 变为应用 secret
1 parent 8cda528 commit 5b5ced1

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
RELEASE 1.0.5
1+
# Changelog
2+
3+
## [Unreleased]
4+
5+
## [1.0.5] - 2021-02-22
6+
### Added
7+
- 增加 registerAsync 以支持异步配置
8+
9+
### Changed
10+
- 由于异步配置无法在中间件中使用,所以中间的的适用路由放开到所有
11+
- 配置的注入方式由 Class 改为 Inject
12+
- 查询通讯录接口由使用通讯录 secret 变为应用 secret

src/services/wechat-work-base.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class WechatWorkBaseService {
120120
HttpStatus.BAD_REQUEST,
121121
);
122122
}
123-
const accessToken = await this.getAccessToken(AgentType.Contacts);
123+
const accessToken = await this.getAccessToken(AgentType.Custom);
124124
const result = await this.httpService
125125
.get(
126126
`${

src/services/wechat-work-contacts.servic.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class WechatWorkContactsService {
2727
this.logger.log(`[getUserInfo] userId cannot be empty`);
2828
throw new HttpException('[getUserInfo] userId cannot be empty', HttpStatus.BAD_REQUEST);
2929
}
30-
const accessToken = await this.wechatWorkBaseService.getAccessToken(AgentType.Contacts);
30+
const accessToken = await this.wechatWorkBaseService.getAccessToken(AgentType.Custom);
3131
const result = await this.httpService.get(
3232
`${this.apiServer}/cgi-bin/user/get?access_token=${accessToken}&userid=${userId}`
3333
).toPromise();
@@ -52,7 +52,7 @@ export class WechatWorkContactsService {
5252
this.logger.log(`[getDepartmentList] userId cannot be empty`);
5353
throw new HttpException('[getDepartmentList] userId cannot be empty', HttpStatus.BAD_REQUEST);
5454
}
55-
const accessToken = await this.wechatWorkBaseService.getAccessToken(AgentType.Contacts);
55+
const accessToken = await this.wechatWorkBaseService.getAccessToken(AgentType.Custom);
5656
const result = await this.httpService.get(
5757
`${this.apiServer}/cgi-bin/department/list?access_token=${accessToken}&id=${id}`
5858
).toPromise();
@@ -72,7 +72,7 @@ export class WechatWorkContactsService {
7272
}
7373

7474
async getAllDepartmentList(): Promise<Result & WechatWorkData> {
75-
const accessToken = await this.wechatWorkBaseService.getAccessToken(AgentType.Contacts);
75+
const accessToken = await this.wechatWorkBaseService.getAccessToken(AgentType.Custom);
7676
const result = await this.httpService.get(
7777
`${this.apiServer}/cgi-bin/department/list?access_token=${accessToken}`
7878
).toPromise();

0 commit comments

Comments
 (0)