stjdydayou 4 jaren geleden
bovenliggende
commit
286805222e

+ 252 - 246
src/main/java/com/zhiqiyun/open/router/apis/Oauth2Api.java

@@ -23,252 +23,258 @@ import java.util.Objects;
 @ServiceMethodBean
 public class Oauth2Api {
 
-	@Autowired
-	private OkHttpClient okHttpClient;
-
-	@Autowired
-	private SystemConfigService systemConfigService;
-
-	/**
-	 * 调试成功
-	 *
-	 * @param request
-	 * @return
-	 * @throws IOException
-	 */
-	@ServiceMethod(method = "oauth2.login", title = "用户密码登录")
-	public OapResponse login(Oauth2LoginRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Map<String, String> paramValues = new HashMap<>();
-		paramValues.put("grant_type", "password");
-		paramValues.put("scope", "all");
-		paramValues.put("username", request.getUserName());
-		paramValues.put("password", DigestUtils.md5Hex(request.getPassword()));
-		paramValues.put("login_type", "person");
-		paramValues.put("type", "account");
-
-		FormBody.Builder formBuilder = new FormBody.Builder();
-		paramValues.forEach(formBuilder::add);
-
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-auth/oauth/token", hostAddress));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Content-Type", "application/x-www-form-urlencoded");
-		builder.post(formBuilder.build());
-		Response resp = this.okHttpClient.newCall(builder.build()).execute();
-		if (resp.isSuccessful()) {
-			String result = Objects.requireNonNull(resp.body()).string();
-			JSONObject jsonObject = JSON.parseObject(result);
-			return OapResponse.success().setBody(jsonObject);
-		} else {
-			try {
-				String result = Objects.requireNonNull(resp.body()).string();
-				log.error(result);
-				JSONObject jsonObject = JSON.parseObject(result);
-				return OapResponse.fail(jsonObject.getString("error"), jsonObject.getString("error_description"));
-			} catch (Exception e) {
-				log.error("", e);
-				return OapResponse.fail("NETWORK_ERROR", "网络异常" + resp.message());
-			}
+    @Autowired
+    private OkHttpClient okHttpClient;
+
+    @Autowired
+    private SystemConfigService systemConfigService;
+
+    /**
+     * 调试成功
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     */
+    @ServiceMethod(method = "oauth2.login", title = "用户密码登录")
+    public OapResponse login(Oauth2LoginRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Map<String, String> paramValues = new HashMap<>();
+        paramValues.put("grant_type", "password");
+        paramValues.put("scope", "all");
+        paramValues.put("username", request.getUserName());
+        paramValues.put("password", DigestUtils.md5Hex(request.getPassword()));
+        paramValues.put("login_type", "person");
+        paramValues.put("type", "account");
+
+        FormBody.Builder formBuilder = new FormBody.Builder();
+        paramValues.forEach(formBuilder::add);
+
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-auth/oauth/token", hostAddress));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Content-Type", "application/x-www-form-urlencoded");
+        builder.post(formBuilder.build());
+        Response resp = this.okHttpClient.newCall(builder.build()).execute();
+        if (resp.isSuccessful()) {
+            String result = Objects.requireNonNull(resp.body()).string();
+            JSONObject jsonObject = JSON.parseObject(result);
+            return OapResponse.success().setBody(jsonObject);
+        } else {
+            try {
+                String result = Objects.requireNonNull(resp.body()).string();
+                log.error(result);
+                JSONObject jsonObject = JSON.parseObject(result);
+                return OapResponse.fail(jsonObject.getString("error"), jsonObject.getString("error_description"));
+            } catch (Exception e) {
+                log.error("", e);
+                return OapResponse.fail("NETWORK_ERROR", "网络异常" + resp.message());
+            }
+        }
+    }
+
+    /**
+     * 调试成功
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     */
+    @ServiceMethod(method = "oauth2.account.info", title = "获取用户信息")
+    public OapResponse userInfo(Oauth2UserInfoRequest request) throws IOException {
+
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-user/account/info", hostAddress));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Blade-Auth", "bearer " + request.getAccessToken());
+        builder.header("Content-Type", "application/x-www-form-urlencoded");
+
+        return this.getResponse(builder);
+    }
+
+    @ServiceMethod(method = "oauth2.validate.token", title = "验证登录状态")
+    public OapResponse validateToken(Oauth2ValidateTokenRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+        RequestBody requestBody = RequestBody.create("{}", MediaType.parse("application/json; charset=utf-8"));
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-auth/validate/token", hostAddress));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Blade-Auth", "bearer " + request.getAccessToken());
+        builder.header("Content-Type", "application/json");
+        builder.post(requestBody);
+
+        return this.getResponse(builder);
+    }
+
+    @ServiceMethod(method = "oauth2.wechat.mp.login", title = "微信公众号授权登录")
+    public OapResponse oauthWechatLogin(Oauth2WechatMpLoginRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Map<String, String> paramValues = new HashMap<>();
+        paramValues.put("code", request.getCode());
+        FormBody.Builder formBuilder = new FormBody.Builder();
+        paramValues.forEach(formBuilder::add);
+
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-auth/oauth/callback/%s", hostAddress, request.getSource()));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Content-Type", "application/x-www-form-urlencoded");
+        builder.post(formBuilder.build());
+
+        return this.getResponse(builder);
+    }
+
+    @ServiceMethod(method = "oauth2.wechat.mp.bind", title = "微信公众号账号绑定")
+    public OapResponse oauthWechatBind(Oauth2WechatMpBindRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Map<String, String> paramValues = new HashMap<>();
+        paramValues.put("uuid", request.getUuid());
+        paramValues.put("username", request.getUsername());
+        paramValues.put("password", request.getPassword());
+
+        RequestBody body = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-auth/oauth/bind/%s", hostAddress, request.getSource()));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Content-Type", "application/json");
+        builder.post(body);
+
+        return this.getResponse(builder);
+    }
+
+    @ServiceMethod(method = "oauth2.wechat.mp.register.bind", title = "微信公众号注册绑定")
+    public OapResponse oauthWechatRegisterBind(Oauth2WechatMpRegisterBindRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Map<String, String> paramValues = new HashMap<>();
+        paramValues.put("uuid", request.getUuid());
+        paramValues.put("username", request.getUsername());
+        paramValues.put("password", request.getPassword());
+
+        RequestBody body = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-auth/oauth/register/bind/%s", hostAddress, request.getSource()));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Content-Type", "application/json");
+        builder.post(body);
+
+        return this.getResponse(builder);
+    }
+
+    /**
+     * 已经对接成功
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     */
+    @ServiceMethod(method = "oauth2.register", title = "注册用户")
+    public OapResponse oauthRegister(Oauth2RegisterRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Map<String, String> paramValues = new HashMap<>();
+        paramValues.put("account", request.getAccount());
+        paramValues.put("password", request.getPassword());
+
+        RequestBody requestBody = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-user/account/submit", hostAddress));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Content-Type", "application/json");
+        builder.post(requestBody);
+
+        return this.getResponse(builder);
+    }
+
+    /**
+     * 已经对接成功
+     *
+     * @param request
+     * @return
+     * @throws IOException
+     */
+    @ServiceMethod(method = "oauth2.update.info", title = "更新用户信息")
+    public OapResponse oauthUpdateInfo(Oauth2UpdateInfoRequest request) throws IOException {
+
+        String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
+        String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
+
+        Map<String, String> paramValues = new HashMap<>();
+        paramValues.put("name", request.getName());
+        paramValues.put("realName", request.getRealName());
+        if (request.getSex() != null) {
+            paramValues.put("sex", request.getSex().toString());
+        }
+		if (StringUtils.isNotBlank(request.getEmail())){
+			paramValues.put("email", request.getEmail());
 		}
-	}
-
-	/**
-	 * 调试成功
-	 *
-	 * @param request
-	 * @return
-	 * @throws IOException
-	 */
-	@ServiceMethod(method = "oauth2.account.info", title = "获取用户信息")
-	public OapResponse userInfo(Oauth2UserInfoRequest request) throws IOException {
-
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-user/account/info", hostAddress));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Blade-Auth", "bearer " + request.getAccessToken());
-		builder.header("Content-Type", "application/x-www-form-urlencoded");
-
-		return this.getResponse(builder);
-	}
-
-	@ServiceMethod(method = "oauth2.validate.token", title = "验证登录状态")
-	public OapResponse validateToken(Oauth2ValidateTokenRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-		RequestBody requestBody = RequestBody.create("{}", MediaType.parse("application/json; charset=utf-8"));
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-auth/validate/token", hostAddress));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Blade-Auth", "bearer " + request.getAccessToken());
-		builder.header("Content-Type", "application/json");
-		builder.post(requestBody);
-
-		return this.getResponse(builder);
-	}
-
-	@ServiceMethod(method = "oauth2.wechat.mp.login", title = "微信公众号授权登录")
-	public OapResponse oauthWechatLogin(Oauth2WechatMpLoginRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Map<String, String> paramValues = new HashMap<>();
-		paramValues.put("code", request.getCode());
-		FormBody.Builder formBuilder = new FormBody.Builder();
-		paramValues.forEach(formBuilder::add);
-
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-auth/oauth/callback/%s", hostAddress, request.getSource()));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Content-Type", "application/x-www-form-urlencoded");
-		builder.post(formBuilder.build());
-
-		return this.getResponse(builder);
-	}
-
-	@ServiceMethod(method = "oauth2.wechat.mp.bind", title = "微信公众号账号绑定")
-	public OapResponse oauthWechatBind(Oauth2WechatMpBindRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Map<String, String> paramValues = new HashMap<>();
-		paramValues.put("uuid", request.getUuid());
-		paramValues.put("username", request.getUsername());
-		paramValues.put("password", request.getPassword());
-
-		RequestBody body = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-auth/oauth/bind/%s", hostAddress, request.getSource()));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Content-Type", "application/json");
-		builder.post(body);
-
-		return this.getResponse(builder);
-	}
-
-	@ServiceMethod(method = "oauth2.wechat.mp.register.bind", title = "微信公众号注册绑定")
-	public OapResponse oauthWechatRegisterBind(Oauth2WechatMpRegisterBindRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Map<String, String> paramValues = new HashMap<>();
-		paramValues.put("uuid", request.getUuid());
-		paramValues.put("username", request.getUsername());
-		paramValues.put("password", request.getPassword());
-
-		RequestBody body = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-auth/oauth/register/bind/%s", hostAddress, request.getSource()));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Content-Type", "application/json");
-		builder.post(body);
-
-		return this.getResponse(builder);
-	}
-
-	/**
-	 * 已经对接成功
-	 *
-	 * @param request
-	 * @return
-	 * @throws IOException
-	 */
-	@ServiceMethod(method = "oauth2.register", title = "注册用户")
-	public OapResponse oauthRegister(Oauth2RegisterRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Map<String, String> paramValues = new HashMap<>();
-		paramValues.put("account", request.getAccount());
-		paramValues.put("password", request.getPassword());
-
-		RequestBody requestBody = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-user/account/submit", hostAddress));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Content-Type", "application/json");
-		builder.post(requestBody);
-
-		return this.getResponse(builder);
-	}
-
-	/**
-	 * 已经对接成功
-	 *
-	 * @param request
-	 * @return
-	 * @throws IOException
-	 */
-	@ServiceMethod(method = "oauth2.update.info", title = "更新用户信息")
-	public OapResponse oauthUpdateInfo(Oauth2UpdateInfoRequest request) throws IOException {
-
-		String hostAddress = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "hostAddress");
-		String clientSecret = this.systemConfigService.getStringValue("OAUTH2_API_CONFIG", "clientSecret");
-
-		Map<String, String> paramValues = new HashMap<>();
-		paramValues.put("name", request.getName());
-		paramValues.put("realName", request.getRealName());
-		paramValues.put("sex", request.getSex().toString());
-		paramValues.put("email", request.getEmail());
-		paramValues.put("phone", request.getPhone());
-
-		RequestBody requestBody = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
-
-		Request.Builder builder = new Request.Builder();
-		builder.url(String.format("%s/blade-user/account/update-info", hostAddress));
-		builder.header("Authorization", "Basic " + clientSecret);
-		builder.header("Blade-Auth", "bearer " + request.getAccessToken());
-		builder.header("Content-Type", "application/json");
-		builder.post(requestBody);
-
-		return this.getResponse(builder);
-	}
-
-	private OapResponse getResponse(Request.Builder builder) throws IOException {
-		Response resp = this.okHttpClient.newCall(builder.build()).execute();
-		if (resp.isSuccessful()) {
-			String result = Objects.requireNonNull(resp.body()).string();
-			log.info(result);
-			JSONObject jsonObject = JSON.parseObject(result);
-			String code = jsonObject.getString("code");
-			String msg = jsonObject.getString("msg");
-			JSONObject data = jsonObject.getJSONObject("data");
-
-			if (StringUtils.equals("200", code)) {
-				return OapResponse.success().setBody(data);
-			}
-			return OapResponse.fail("REMOTE_ERROR_" + code, msg);
-		} else {
-			String body = Objects.requireNonNull(resp.body()).string();
-			log.info(body);
-			if (Arrays.asList(401, 400).contains(resp.code())) {
-				JSONObject object = JSON.parseObject(body);
-				String msg = object.getString("msg");
-				if (StringUtils.isBlank(msg)) {
-					msg = object.getString("error_description");
-				}
-				return OapResponse.fail("ERROR", msg);
-			} else {
-				return OapResponse.fail("NETWORK_ERROR", "网络异常" + resp.message());
-			}
+		if (StringUtils.isNotBlank(request.getPhone())){
+			paramValues.put("phone", request.getPhone());
 		}
-	}
+
+        RequestBody requestBody = RequestBody.create(JSON.toJSONString(paramValues), MediaType.parse("application/json; charset=utf-8"));
+
+        Request.Builder builder = new Request.Builder();
+        builder.url(String.format("%s/blade-user/account/update-info", hostAddress));
+        builder.header("Authorization", "Basic " + clientSecret);
+        builder.header("Blade-Auth", "bearer " + request.getAccessToken());
+        builder.header("Content-Type", "application/json");
+        builder.post(requestBody);
+
+        return this.getResponse(builder);
+    }
+
+    private OapResponse getResponse(Request.Builder builder) throws IOException {
+        Response resp = this.okHttpClient.newCall(builder.build()).execute();
+        if (resp.isSuccessful()) {
+            String result = Objects.requireNonNull(resp.body()).string();
+            log.info(result);
+            JSONObject jsonObject = JSON.parseObject(result);
+            String code = jsonObject.getString("code");
+            String msg = jsonObject.getString("msg");
+            JSONObject data = jsonObject.getJSONObject("data");
+
+            if (StringUtils.equals("200", code)) {
+                return OapResponse.success().setBody(data);
+            }
+            return OapResponse.fail("REMOTE_ERROR_" + code, msg);
+        } else {
+            String body = Objects.requireNonNull(resp.body()).string();
+            log.info(body);
+            if (Arrays.asList(401, 400).contains(resp.code())) {
+                JSONObject object = JSON.parseObject(body);
+                String msg = object.getString("msg");
+                if (StringUtils.isBlank(msg)) {
+                    msg = object.getString("error_description");
+                }
+                return OapResponse.fail("ERROR", msg);
+            } else {
+                return OapResponse.fail("NETWORK_ERROR", "网络异常" + resp.message());
+            }
+        }
+    }
 }

+ 0 - 3
src/main/java/com/zhiqiyun/open/router/request/oauth2/Oauth2UpdateInfoRequest.java

@@ -24,14 +24,11 @@ public class Oauth2UpdateInfoRequest extends AbstractOapRequest {
     private String realName;
 
     @ServiceParamField(describe = "性别(1,2)")
-    @NotNull
     private Integer sex;
 
     @ServiceParamField(describe = "邮箱")
-    @NotBlank
     private String email;
 
     @ServiceParamField(describe = "手机号码")
-    @NotBlank
     private String phone;
 }

+ 6 - 6
src/test/java/com/zhiqiyun/TestSdk.java

@@ -11,19 +11,19 @@ import java.util.Map;
 public class TestSdk {
 	public static void main(String[] args) throws Exception {
 		DefaultClient client = new DefaultClient(
-				"http://47.114.32.188:9800/router",
+				"http://127.0.0.1:9800/router",
 				"220228000020",
-				"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSTihNSHP5mqzMxkqxeEv150GWUcfdNy9eoD9wWhWO5re59vi8ownmfpcKOSHhqM09W+/jwC5xbqhYJN2kbCMWTyBHJ1BaoldX736aOPCmo0octyiq2N3Xx5JFnBh5asXdEO12lrOXGNqcwwq6iDuw2Na3H4u7p3QEIz6LKLcGJQIDAQAB",
+				"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzg5TgyojZDZpSpUhpXlk6wWOH0OuVjnrOKOl9jdpzgG2fgws59Ue8YMGJpVi7q32mh4cIbNi5YDnH9sIxbFKPAo8HrcopVQfQ3E+z7e4T1yErfzsNk+sWjA3piZMSZOxX/rAZetAXYAT8ZxXUDidpEnjE7QR3uNBtiTS9TvhKxwIDAQAB",
 				AlgorithmType.RSA
 		);
 		Map<String, Object> dataMap = new HashMap<>();
-		dataMap.put("userName", "stjdydayou");
-		dataMap.put("password", "123456");
-//		form1.put("realName", "测试realName");
+		dataMap.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOiLmtYvor5VyZWFsTmFtZSIsImF2YXRhciI6IiIsImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwiYWNjb3VudF9pZCI6IjE1MDAxMDA4MTc4MzIzMjEwMjYiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IiIsInJvbGVfaWQiOiIiLCJzY29wZSI6WyJhbGwiXSwibmlja19uYW1lIjoi5rWL6K-VbmFtZSIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2NDY3NDgyNTAsImRlcHRfaWQiOiIiLCJqdGkiOiI0Yzc4OTZiYy1kMGMxLTRjYzktOGEyYi03ODFkYWQ2M2E1NzgiLCJhY2NvdW50Ijoic3RqZHlkYXlvdSJ9.IMfsrcWrD0lKfddcQ3rD3Tug4d5o74u_AaYF__OxWmg");
+		dataMap.put("name", "测试Name");
+		dataMap.put("realName", "测试realName");
 //		form1.put("sex", "1");
 //		form1.put("email", "测试email");
 //		form1.put("phone", "测试phone");
-		Response<Map<String, Object>> response = client.execute("oauth2.login", "1.0.0", dataMap);
+		Response<Map<String, Object>> response = client.execute("oauth2.update.info", "1.0.0", dataMap);
 		System.out.println(JSON.toJSONString(response));
 	}
 }