系统

## 概述 > 系统描述 keyId:相当于用户的id keySecret:用户的二次开发密码 类名 ` SystemApi.java ` 成员方法 名称 | 方法 | Method | Path ------------- | ------------- | ------------- | ------------- [用户登录](#login) | [**login**](#login) | POST | /api-uaa/oauth/token [退出登录](#logout) | [**logout**](#logout) | POST | /api-uaa/oauth/remove/token [发送手机注册验证码](#sendPhoneRegisterCode) | [**sendPhoneRegisterCode**](#sendPhoneRegisterCode) | POST | /api-uaa/validate/sendPhoneRegisterCode [发送手机验证码](#sendPhoneVerificationCode) | [**sendPhoneVerificationCode**](#sendPhoneVerificationCode) | POST | /api-uaa/validate/sendPhoneVerificationCode <a id="login"></a> ## **用户登录** > ResultTokenInfo login(keyId, keySecret, grantType, clientId, clientSecret) ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **keyId** | **String**| 对应用户的uid | **keySecret** | **String**| 对应用户的sid | **grantType** | **String**| 固定为key_secret | **clientId** | **String**| 固定为webApp | **clientSecret** | **String**| 固定为webApp | ### 返回参数 ResultTokenInfo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | | - **data** | **TokenInfo** | | - **msg** | **String** | | - **time** | **OffsetDateTime** | | - TokenInfo 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **accessToken** | **String** | | - **tokenType** | **String** | | - **refreshToken** | **String** | | - **expiresIn** | **Integer** | | - **scope** | **String** | | - ### java-sdk 调用示例 ```java //实例化api类,传入token SystemApi apiInstance = new SystemApi(token); //实例化请求参数 String keyId = "keyId_example"; String keySecret = "keySecret_example"; String grantType = "grantType_example"; String clientId = "clientId_example"; String clientSecret = "clientSecret_example"; try { ResultTokenInfo result = apiInstance.login(keyId, keySecret, grantType, clientId, clientSecret); System.out.println(result); } catch (ApiException e) { System.err.println("调用SystemApi.login异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-uaa/oauth/token| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "keyId":"", "client_secret":"", "keySecret":"", "grant_type":"", "client_id":"" } ``` <a id="logout"></a> ## **退出登录** > logout() ### 请求参数 请求参数为空. ### 返回参数 返回参数为空 ### java-sdk 调用示例 ```java //实例化api类,传入token SystemApi apiInstance = new SystemApi(token); try { apiInstance.logout(); } catch (ApiException e) { System.err.println("调用SystemApi.logout异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-uaa/oauth/remove/token| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json {} ``` <a id="sendPhoneRegisterCode"></a> ## **发送手机注册验证码** > Result sendPhoneRegisterCode(phone) ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **phone** | **String**| 手机号 | ### 返回参数 Result 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | | - **data** | **Object** | | - **msg** | **String** | | - **time** | **OffsetDateTime** | | - ### java-sdk 调用示例 ```java //实例化api类,传入token SystemApi apiInstance = new SystemApi(token); //实例化请求参数 String phone = "phone_example"; try { Result result = apiInstance.sendPhoneRegisterCode(phone); System.out.println(result); } catch (ApiException e) { System.err.println("调用SystemApi.sendPhoneRegisterCode异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-uaa/validate/sendPhoneRegisterCode| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "phone":"" } ``` <a id="sendPhoneVerificationCode"></a> ## **发送手机验证码** > Result sendPhoneVerificationCode(phone) ### 请求参数 名称 | 类型 | 描述 | 备注 ------------- | ------------- | ------------- | ------------- **phone** | **String**| 手机号(不指定时使用当前登录用户的手机号) | - ### 返回参数 Result 名称 | 类型 | 描述 | 备注 ------------ | ------------- | ------------- | ------------- **code** | **String** | | - **data** | **Object** | | - **msg** | **String** | | - **time** | **OffsetDateTime** | | - ### java-sdk 调用示例 ```java //实例化api类,传入token SystemApi apiInstance = new SystemApi(token); //实例化请求参数 String phone = "phone_example"; try { Result result = apiInstance.sendPhoneVerificationCode(phone); System.out.println(result); } catch (ApiException e) { System.err.println("调用SystemApi.sendPhoneVerificationCode异常: " + e.getMessage()); e.printStackTrace(); } ``` ### HTTP 调用示例 | 属性 | 名称 | | --------------- | ------------------------ | | HTTP请求地址 | http://[server]:[port]/api-uaa/validate/sendPhoneVerificationCode| | 请求方式 | POST | | Content-Type | application/json | | header:key | Authorization| | header:value |Bearer *YOUR_ACCESS_TOKEN*| 请求参数: ```json { "phone":"" } ```