Skip to content

fix(func): 勾选使用 OpenList 提供的参数的时候,企业版Onedrive无法正常获取SharePoint Site ID的修改#73

Open
xiaoman1221 wants to merge 3 commits intoOpenListTeam:mainfrom
xiaoman1221:main
Open

fix(func): 勾选使用 OpenList 提供的参数的时候,企业版Onedrive无法正常获取SharePoint Site ID的修改#73
xiaoman1221 wants to merge 3 commits intoOpenListTeam:mainfrom
xiaoman1221:main

Conversation

@xiaoman1221
Copy link
Contributor

原因:勾选后无法正常填写自定义的uid和key(主要是都勾选了肯定没有或者嫌麻烦?)导致获取SharePoint Site ID时报错(请先填写客户端ID和应用机密)

传递一个参数(server_use_input.checked),然后对验证部分做了一些修改

目前在本人自己的API通过了测试,功能可用,本人能力有限希望大佬们多测测

部署此次PR的API:https://openlistapi.yhdzz.cn
(可以扔社区 APIPages里面嘛)

功能:
勾选`使用 OpenList 提供的参数`时,可在完成授权的情况下进行SiteID的读取

Signed-off-by: 小满1221 <im@manjiuqi.com>
`使用 OpenList 提供的参数`

Signed-off-by: 小满1221 <im@manjiuqi.com>
@xiaoman1221
Copy link
Contributor Author

PS:此API目前仅填写Onedrive国际版的UID和KEY到环境变量里

@jyxjjj jyxjjj requested a review from PIKACHUIM December 17, 2025 23:27
Copy link
Member

@jyxjjj jyxjjj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR标题

@PIKACHUIM PIKACHUIM changed the title 勾选使用 OpenList 提供的参数的时候,企业版Onedrive无法正常获取SharePoint Site ID的修改 fix(func): 勾选使用 OpenList 提供的参数的时候,企业版Onedrive无法正常获取SharePoint Site ID的修改 Dec 18, 2025
@xiaoman1221 xiaoman1221 requested a review from jyxjjj December 28, 2025 13:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复在勾选“使用 OpenList 提供的参数”时,OneDrive 企业版获取 SharePoint Site ID 会因为前端校验阻断而失败的问题,使获取 Site ID 的流程可以在不填写 ClientID/Secret 的情况下继续执行(依赖已有 Token)。

Changes:

  • getSiteID 新增参数 server_use_input,并调整 ClientID/Secret 的校验逻辑。
  • SharePoint 站点 ID 按钮改为传入 server_use_input.checked

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
public/static/spoid.js 调整获取 Site ID 的入参与校验逻辑,以支持“使用 OpenList 提供的参数”场景
public/index.html 更新按钮点击事件,调用 getSiteID(server_use_input.checked)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +95 to +107
// 使用服务器提供的uid和key获取站点ID
if (site_type.includes("onedrive")){
if (!client_uid || !client_key){
if (!server_use_input) {
idElement.value = ERROR_MESSAGES.MISSING_CREDENTIALS;
return;
}
}
}else{
idElement.value = ERROR_MESSAGES.NOT_SUPPORTED;
return;
}

}

// 验证
if (!access_token || !refresh_token) {
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pikachu Ren <40362270+PIKACHUIM@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants