1
This commit is contained in:
@@ -67,13 +67,13 @@ wps365:
|
||||
# 注意:使用 /wps365-callback 路径,避免前端路由拦截
|
||||
redirect-uri: https://your-domain.com/wps365-callback
|
||||
# API基础地址(一般不需要修改)
|
||||
api-base-url: https://open.wps.cn/api/v1
|
||||
api-base-url: https://openapi.wps.cn/api/v1
|
||||
# OAuth授权地址(一般不需要修改)
|
||||
oauth-url: https://open.wps.cn/oauth2/v1/authorize
|
||||
oauth-url: https://openapi.wps.cn/oauth2/auth
|
||||
# 获取Token地址(一般不需要修改)
|
||||
token-url: https://open.wps.cn/oauth2/v1/token
|
||||
token-url: https://openapi.wps.cn/oauth2/token
|
||||
# 刷新Token地址(一般不需要修改)
|
||||
refresh-token-url: https://open.wps.cn/oauth2/v1/token
|
||||
refresh-token-url: https://openapi.wps.cn/oauth2/token
|
||||
```
|
||||
|
||||
**重要提示**:
|
||||
|
||||
@@ -17,12 +17,13 @@ wps365:
|
||||
# 应用密钥(AppKey)- 需要在WPS365开放平台申请,注意保密
|
||||
app-key: 4c58bc1642e5e8fa731f75af9370496a
|
||||
# 授权回调地址(需要在WPS365开放平台配置授权域名)
|
||||
redirect-uri: https://jarvis.van333.cn/jarvis/wps365/oauth/callback
|
||||
# 注意:使用 /wps365-callback 路径,避免前端路由拦截
|
||||
redirect-uri: https://jarvis.van333.cn/wps365-callback
|
||||
# API基础地址
|
||||
api-base-url: https://open.wps.cn/api/v1
|
||||
# OAuth授权地址
|
||||
oauth-url: https://open.wps.cn/oauth2/v1/authorize
|
||||
api-base-url: https://openapi.wps.cn/api/v1
|
||||
# OAuth授权地址(正确格式:https://openapi.wps.cn/oauth2/auth)
|
||||
oauth-url: https://openapi.wps.cn/oauth2/auth
|
||||
# 获取Token地址
|
||||
token-url: https://open.wps.cn/oauth2/v1/token
|
||||
token-url: https://openapi.wps.cn/oauth2/token
|
||||
# 刷新Token地址
|
||||
refresh-token-url: https://open.wps.cn/oauth2/v1/token
|
||||
refresh-token-url: https://openapi.wps.cn/oauth2/token
|
||||
|
||||
@@ -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