1
This commit is contained in:
@@ -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";
|
||||
|
||||
/**
|
||||
* 配置初始化后验证
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user