File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ client_secret="a12f46c9eb633ad46b1f3bf845e2c6017705b62e16258f3ca05f51e4a03a9945"
44owner = "smartboot"
55repo = "smart-socket"
66// 获取url,不包含参数
7- const href = new URL ( location . href ) ;
7+ const href = new URL ( window . location . href ) ;
88const url = href . origin + href . pathname ;
99
1010//提取 cookie中存储的 access_token
@@ -27,14 +27,14 @@ if (access_token==null) {
2727 if ( resp . access_token != null ) {
2828 access_token = resp . access_token
2929 document . cookie = "access_token=" + resp . access_token + "; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/" ;
30- location . href = url ;
30+ window . location . href = url ;
3131 } else if ( "invalid_grant_accessibility" == resp . error ) {
32- location . href = 'https://gitee.com/oauth/authorize?client_id=' + client_id + '&redirect_uri=' + url + '&response_type=code' ;
32+ window . location . href = 'https://gitee.com/oauth/authorize?client_id=' + client_id + '&redirect_uri=' + url + '&response_type=code' ;
3333 }
3434 } )
3535 . catch ( error => console . error ( error ) ) ;
3636 } else {
37- location . href = 'https://gitee.com/oauth/authorize?client_id=' + client_id + '&redirect_uri=' + url + '&response_type=code' ;
37+ window . location . href = 'https://gitee.com/oauth/authorize?client_id=' + client_id + '&redirect_uri=' + url + '&response_type=code' ;
3838 }
3939} else {
4040 checkStar ( )
You can’t perform that action at this time.
0 commit comments