Skip to content

Commit 82a71ca

Browse files
committed
更新文档
1 parent 4cf8ba8 commit 82a71ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/smart-socket/gitee.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ client_secret="a12f46c9eb633ad46b1f3bf845e2c6017705b62e16258f3ca05f51e4a03a9945"
44
owner="smartboot"
55
repo="smart-socket"
66
// 获取url,不包含参数
7-
const href = new URL(location.href);
7+
const href = new URL(window.location.href);
88
const 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()

0 commit comments

Comments
 (0)