Fix #5835, remove global params username. (#6014)

This commit is contained in:
杨翊 SionYang 2021-06-09 14:49:50 +08:00 committed by GitHub
parent cdc2e3409a
commit a5f1a5c2fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 157 additions and 154 deletions

View File

@ -503,7 +503,7 @@ const request = (function(_global) {
const { accessToken = '', username = '' } = token;
const [url, paramsStr = ''] = config.url.split('?');
const params = paramsStr.split('&');
params.push(`accessToken=${accessToken}&username=${username}`);
params.push(`accessToken=${accessToken}`);
return $.ajax(
Object.assign({}, config, {

View File

@ -49,7 +49,10 @@ const request = () => {
}
const { accessToken = '', username = '' } = token;
config.params.accessToken = accessToken;
config.params.username = username;
// support #3548 and fix #5835
if (!url.includes('auth')) {
config.params.username = username;
}
config.headers = Object.assign({}, headers, { accessToken });
}
if (data && isPlainObject(data) && ['post', 'put'].includes(method)) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long