|
|
@@ -215,6 +215,8 @@ OAuth.prototype.getAuthorizeURLForWebsite = function (redirect, state, scope) {
|
|
|
* @param {Function} callback 回调函数
|
|
|
*/
|
|
|
OAuth.prototype.getAccessTokenByCode = function (code, callback) {
|
|
|
+ // 存储用户名,用于刷新token传参
|
|
|
+ localStorage.setItem('username', this.username)
|
|
|
const args = {
|
|
|
url: OAUTH2_URL() + '/authentication/apply',
|
|
|
data: {
|
|
|
@@ -300,13 +302,14 @@ OAuth.prototype.getAccessTokenByPassword = function ({ username, password }, cal
|
|
|
* @param {Function} callback 回调函数
|
|
|
*/
|
|
|
OAuth.prototype.refreshAccessToken = function (refreshToken, callback) {
|
|
|
+ const username = localStorage.getItem('username')
|
|
|
const args = {
|
|
|
url: OAUTH2_URL() + '/authentication/apply',
|
|
|
data: {
|
|
|
client_id: this.clientId,
|
|
|
client_secret: this.clientSecret,
|
|
|
grant_type: 'refresh_token',
|
|
|
- username: this.username,
|
|
|
+ username,
|
|
|
refresh_token: refreshToken
|
|
|
},
|
|
|
method: 'post'
|