Skip to content

Commit

Permalink
fix: onedrive sharepoint refresh token
Browse files Browse the repository at this point in the history
  • Loading branch information
reruin committed Jan 26, 2021
1 parent b8bb7c2 commit 3402d9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
21 changes: 3 additions & 18 deletions docs/zh-cn/plugins/onedrive.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
# OneDrive

新版 [OneDrive V2](https://github.com/reruin/sharelist/tree/master/plugins/drive.onedrive.js) 插件提供多种方式的挂载,适用于 家庭版 和 商业版(企业版/教育版)。请将```挂载路径留空```,访问后会开启挂载向导。
新版 [OneDrive V2](https://github.com/reruin/sharelist/tree/master/plugins/drive.onedrive.js) 插件提供多种方式的挂载,适用于 家庭版 和 商业版(企业版/教育版)。请将```挂载路径留空```,访问后会开启挂载向导,按提示操作即可

![onedrive.png](https://i.loli.net/2020/10/12/KyeB3Ot7ZDfzdqv.png)

### API挂载
```选择地区```后,前往对应的Azure管理后台```注册应用```,获取应用ID(app_id)和应用机密(app_secret),并将```重定向URI```设置为
?> ShareList内置了应用ID和应用机密 用于自动挂载。感谢 [yushangcl](https://github.com/yushangcl]) 提供世纪互联挂载应用。
!> 使用自己提供的应用ID 和 应用机密 时,请将```重定向URI```设置为
```https://reruin.github.io/sharelist/redirect.html```, [查看中转页的代码](https://github.com/reruin/reruin.github.io/blob/master/sharelist/redirect.html)

?> 租户ID:商业版子账户需要填写租户ID(tenant_id),从```Azure管理后台``````概述```里可以找到此项。。

***

### 分享链接挂载
在OneDrive创建分享,获取分享链接一般是这样的:
```https://xxxx.sharepoint.com/:f:/g/personal/xxxxxxxx/mmmmmmmmm?e=XXXX```

***

### 自动挂载
与API挂载类似,但使用ShareList内置的一组app_id和app_secert。优点是不需要注册应用。
3 changes: 2 additions & 1 deletion plugins/drive.onedrive.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ class Manager {
client_secret,
zone,
tenant_id,
site_id,
redirect_uri,
refresh_token,
access_token,
Expand Down Expand Up @@ -766,7 +767,7 @@ class Driver {
return r
}
}

console.log('access_token',access_token)
let folder = path.endsWith('/')
//docs: https://docs.microsoft.com/zh-cn/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http
if (folder) {
Expand Down

0 comments on commit 3402d9c

Please sign in to comment.