This commit is contained in:
Leo
2026-01-15 20:13:15 +08:00
parent f044417d8d
commit 2fb283c3f3
5 changed files with 18 additions and 15 deletions

View File

@@ -30,16 +30,16 @@ public class WPS365Config {
private String redirectUri;
/** API基础地址 */
private String apiBaseUrl = "https://open.wps.cn/api/v1";
private String apiBaseUrl = "https://openapi.wps.cn/api/v1";
/** OAuth授权地址 */
private String oauthUrl = "https://open.wps.cn/oauth2/v1/authorize";
private String oauthUrl = "https://openapi.wps.cn/oauth2/auth";
/** 获取Token地址 */
private String tokenUrl = "https://open.wps.cn/oauth2/v1/token";
private String tokenUrl = "https://openapi.wps.cn/oauth2/token";
/** 刷新Token地址 */
private String refreshTokenUrl = "https://open.wps.cn/oauth2/v1/token";
private String refreshTokenUrl = "https://openapi.wps.cn/oauth2/token";
/**
* 配置初始化后验证

View File

@@ -29,6 +29,7 @@ public class WPS365ApiServiceImpl implements IWPS365ApiService {
@Override
public JSONObject getUserInfo(String accessToken) {
try {
// WPS365用户信息API: GET /api/v1/user/info
String url = wps365Config.getApiBaseUrl() + "/user/info";
return WPS365ApiUtil.httpRequest("GET", url, accessToken, null);
} catch (Exception e) {

View File

@@ -69,7 +69,8 @@ public class WPS365OAuthServiceImpl implements IWPS365OAuthService {
}
authUrl.append("&response_type=code");
// WPS365的scope根据官方文档设置
authUrl.append("&scope=file.readwrite,user.info");
// 注意scope参数可能需要根据实际申请的权限调整
authUrl.append("&scope=file.read,ksheet.read,user.info");
// 添加state参数
if (state == null || state.trim().isEmpty()) {