Skip to content
New issue

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

Zhongjixiuxing patch 1 #43

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@
this.client = axios.create({
baseURL: config.url,
timeout: config.timeout || 60000,
headers: config.headers,
// headers: config.headers,
})
}
get(url: string, config?: AxiosRequestConfig<any>) {
return this.client.get(url, config)
}

post(url: string, data: any, config?: AxiosRequestConfig<any>) {
// 解决 /api/login/oauth/access_token 出现 “grant_type: is not supported in this application” 错误问题
// fixed issue: "grant_type: is not supported in this application"
config = config || {}
config.headers = config.headers || {}
config.headers = Object.assign(this.config.headers || {}, config.headers)
if (url === 'login/oauth/access_token') {
delete config.headers.Authorization

Check failure on line 39 in src/request.ts

View workflow job for this annotation

GitHub Actions / test (^16)

Delete `··`

Check failure on line 39 in src/request.ts

View workflow job for this annotation

GitHub Actions / test (^18)

Delete `··`

Check failure on line 39 in src/request.ts

View workflow job for this annotation

GitHub Actions / test (^20)

Delete `··`
}
return this.client.post(url, data, config)
}

Expand Down
Loading