stjdydayou 4 سال پیش
والد
کامیت
a3a587b153

+ 6 - 0
pom.xml

@@ -41,6 +41,12 @@
 
     <dependencies>
         <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>com.dliyun</groupId>
             <artifactId>framework-sprint-boot</artifactId>
             <version>${framework.version}</version>

+ 366 - 290
src/main/java/com/zhiqiyun/open/router/apis/Oauth2Api.java

@@ -23,294 +23,370 @@ 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());
-            }
-        }
-    }
-
-    /**
-     * 调试成功
-     *
-     * @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.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");
-
-        Request.Builder builder = new Request.Builder();
-
-        HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(String.format("%s/blade-auth/oauth/auth-login/%s", hostAddress, request.getSource()))).newBuilder();
-        urlBuilder.addQueryParameter("uuid", request.getUuid());
-        urlBuilder.addQueryParameter("name", request.getName());
-        urlBuilder.addQueryParameter("realName", request.getRealName());
-        if (request.getSex() != null) {
-            urlBuilder.addQueryParameter("sex", request.getSex().toString());
-        }
-        urlBuilder.addQueryParameter("email", request.getEmail());
-        urlBuilder.addQueryParameter("phone", request.getPhone());
-
-        log.info(urlBuilder.build().toString());
-        builder.url(urlBuilder.build());
-        builder.header("Authorization", "Basic " + clientSecret);
-        builder.header("Content-Type", "application/x-www-form-urlencode");
-        builder.get();
-
-        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());
-        }
-        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);
-    }
-
-    /**
-     * 已经对接成功
-     *
-     * @param request
-     * @return
-     * @throws IOException
-     */
-    @ServiceMethod(method = "oauth2.update.password", title = "修改密码")
-    public OapResponse oauthUpdatePassword(Oauth2UpdatePasswordRequest 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("oldPassword", DigestUtils.md5Hex(request.getOldPassword()));
-        paramValues.put("newPassword", DigestUtils.md5Hex(request.getNewPassword()));
-
-        FormBody.Builder formBuilder = new FormBody.Builder();
-        paramValues.forEach(formBuilder::add);
-
-        Request.Builder builder = new Request.Builder();
-        builder.url(String.format("%s/blade-user/account/update-password", hostAddress));
-        builder.header("Authorization", "Basic " + clientSecret);
-        builder.header("Blade-Auth", "bearer " + request.getAccessToken());
-        builder.header("Content-Type", "application/x-www-form-urlencode");
-        builder.post(formBuilder.build());
-
-        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());
-            }
-        }
-    }
+	@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");
+
+		log.info(JSON.toJSONString(paramValues));
+
+		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);
+	}
+
+	/**
+	 * 已经对接成功
+	 *
+	 * @param request
+	 * @return
+	 * @throws IOException
+	 */
+	@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);
+	}
+
+	/**
+	 * 已经对接成功
+	 *
+	 * @param request
+	 * @return
+	 * @throws IOException
+	 */
+	@ServiceMethod(method = "oauth2.wechat.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");
+
+		Request.Builder builder = new Request.Builder();
+
+		HttpUrl.Builder urlBuilder = Objects.requireNonNull(HttpUrl.parse(String.format("%s/blade-auth/oauth/auth-login/%s", hostAddress, request.getSource()))).newBuilder();
+		urlBuilder.addQueryParameter("uuid", request.getUuid());
+		urlBuilder.addQueryParameter("name", request.getName());
+		urlBuilder.addQueryParameter("realName", request.getRealName());
+		if (request.getSex() != null) {
+			urlBuilder.addQueryParameter("sex", request.getSex().toString());
+		}
+		urlBuilder.addQueryParameter("email", request.getEmail());
+		urlBuilder.addQueryParameter("phone", request.getPhone());
+
+		log.info(urlBuilder.build().toString());
+		builder.url(urlBuilder.build());
+		builder.header("Authorization", "Basic " + clientSecret);
+		builder.header("Content-Type", "application/x-www-form-urlencode");
+		builder.get();
+
+		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());
+		}
+		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);
+	}
+
+	/**
+	 * 已经对接成功
+	 *
+	 * @param request
+	 * @return
+	 * @throws IOException
+	 */
+	@ServiceMethod(method = "oauth2.update.password", title = "修改密码")
+	public OapResponse oauthUpdatePassword(Oauth2UpdatePasswordRequest 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("oldPassword", DigestUtils.md5Hex(request.getOldPassword()));
+		paramValues.put("newPassword", DigestUtils.md5Hex(request.getNewPassword()));
+
+		FormBody.Builder formBuilder = new FormBody.Builder();
+		paramValues.forEach(formBuilder::add);
+
+		Request.Builder builder = new Request.Builder();
+		builder.url(String.format("%s/blade-user/account/update-password", hostAddress));
+		builder.header("Authorization", "Basic " + clientSecret);
+		builder.header("Blade-Auth", "bearer " + request.getAccessToken());
+		builder.header("Content-Type", "application/x-www-form-urlencode");
+		builder.post(formBuilder.build());
+
+		return this.getResponse(builder);
+	}
+
+	@ServiceMethod(method = "oauth2.social.submit", title = "新增用户")
+	public OapResponse oauthSocialSubmit(Oauth2SocialSubmitRequest 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", DigestUtils.md5Hex(request.getPassword()));
+		paramValues.put("name", request.getName());
+		paramValues.put("realName", request.getRealName());
+		if (request.getSex() != null) {
+			paramValues.put("sex", request.getSex().toString());
+		}
+		paramValues.put("email", request.getEmail());
+		paramValues.put("phone", request.getPhone());
+
+		log.debug(JSON.toJSONString(paramValues));
+		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/social/submit", 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.social.update", title = "修改用户")
+	public OapResponse oauthSocialUpdate(Oauth2SocialUpdateRequest 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("id", request.getId().toString());
+		paramValues.put("name", request.getName());
+		paramValues.put("realName", request.getRealName());
+		if (request.getSex() != null) {
+			paramValues.put("sex", request.getSex().toString());
+		}
+		paramValues.put("email", request.getEmail());
+		paramValues.put("phone", request.getPhone());
+
+		log.debug(JSON.toJSONString(paramValues));
+		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/social/update", 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.social.remove", title = "删除用户")
+	public OapResponse oauthSocialRemove(Oauth2SocialRemoveRequest 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("id", request.getId().toString());
+
+		log.debug(JSON.toJSONString(paramValues));
+
+		FormBody.Builder formBuilder = new FormBody.Builder();
+		paramValues.forEach(formBuilder::add);
+
+		Request.Builder builder = new Request.Builder();
+		builder.url(String.format("%s/blade-user/social/update", hostAddress));
+		builder.header("Authorization", "Basic " + clientSecret);
+		builder.header("Blade-Auth", "bearer " + request.getAccessToken());
+		builder.header("Content-Type", "application/x-www-form-urlencode");
+		builder.post(formBuilder.build());
+
+		return this.getResponse(builder);
+	}
+
+	@ServiceMethod(method = "oauth2.send.phone.validate.code", title = "发送短信验证码")
+	public OapResponse oauthSendPhoneValidateCode(Oauth2SendPhoneValidateCodeRequest 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("phone", request.getPhone());
+
+		FormBody.Builder formBuilder = new FormBody.Builder();
+		paramValues.forEach(formBuilder::add);
+
+		Request.Builder builder = new Request.Builder();
+		builder.url(String.format("%s/blade-resource/sms/endpoint/send-validate", hostAddress));
+		builder.header("Authorization", "Basic " + clientSecret);
+		builder.header("Content-Type", "application/x-www-form-urlencode");
+		builder.post(formBuilder.build());
+
+		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());
+			}
+		}
+	}
 }

+ 1 - 4
src/main/java/com/zhiqiyun/open/router/request/UploaderBase64Request.java

@@ -1,7 +1,4 @@
-/**
- * 版权声明:中图一购网络科技有限公司 版权所有 违者必究 2012
- * 日    期:12-7-14
- */
+
 package com.zhiqiyun.open.router.request;
 
 import com.dliyun.oap.framework.annotation.ServiceParamField;

+ 1 - 4
src/main/java/com/zhiqiyun/open/router/request/oauth2/Oauth2LoginRequest.java

@@ -1,7 +1,4 @@
-/**
- * 版权声明:中图一购网络科技有限公司 版权所有 违者必究 2012
- * 日    期:12-7-14
- */
+
 package com.zhiqiyun.open.router.request.oauth2;
 
 import com.dliyun.oap.framework.annotation.ServiceParamField;

+ 17 - 0
src/main/java/com/zhiqiyun/open/router/request/oauth2/Oauth2SendPhoneValidateCodeRequest.java

@@ -0,0 +1,17 @@
+package com.zhiqiyun.open.router.request.oauth2;
+
+import com.dliyun.oap.framework.annotation.ServiceParamField;
+import com.dliyun.oap.framework.request.AbstractOapRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Oauth2SendPhoneValidateCodeRequest extends AbstractOapRequest {
+
+	@ServiceParamField(describe = "手机号码")
+	@NotBlank
+	private String phone;
+}

+ 24 - 0
src/main/java/com/zhiqiyun/open/router/request/oauth2/Oauth2SocialRemoveRequest.java

@@ -0,0 +1,24 @@
+
+package com.zhiqiyun.open.router.request.oauth2;
+
+import com.dliyun.oap.framework.annotation.ServiceParamField;
+import com.dliyun.oap.framework.request.AbstractOapRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Oauth2SocialRemoveRequest extends AbstractOapRequest {
+
+	@ServiceParamField(describe = "admin登录的Token")
+	@NotBlank
+	private String accessToken;
+
+	@ServiceParamField(describe = "用户id")
+	@NotNull
+	private Long id;
+}
+

+ 42 - 0
src/main/java/com/zhiqiyun/open/router/request/oauth2/Oauth2SocialSubmitRequest.java

@@ -0,0 +1,42 @@
+
+package com.zhiqiyun.open.router.request.oauth2;
+
+import com.dliyun.oap.framework.annotation.ServiceParamField;
+import com.dliyun.oap.framework.request.AbstractOapRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Oauth2SocialSubmitRequest extends AbstractOapRequest {
+
+	@ServiceParamField(describe = "admin登录的Token")
+	@NotBlank
+	private String accessToken;
+
+	@ServiceParamField(describe = "用户名")
+	@NotBlank
+	private String account;
+
+	@ServiceParamField(describe = "密码")
+	@NotBlank
+	private String password;
+
+	@ServiceParamField(describe = "姓名")
+	private String name;
+
+	@ServiceParamField(describe = "真实姓名")
+	private String realName;
+
+	@ServiceParamField(describe = "性别(1,2)")
+	private Integer sex;
+
+	@ServiceParamField(describe = "邮箱")
+	private String email;
+
+	@ServiceParamField(describe = "手机号码")
+	private String phone;
+}
+

+ 39 - 0
src/main/java/com/zhiqiyun/open/router/request/oauth2/Oauth2SocialUpdateRequest.java

@@ -0,0 +1,39 @@
+
+package com.zhiqiyun.open.router.request.oauth2;
+
+import com.dliyun.oap.framework.annotation.ServiceParamField;
+import com.dliyun.oap.framework.request.AbstractOapRequest;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Oauth2SocialUpdateRequest extends AbstractOapRequest {
+
+	@ServiceParamField(describe = "admin登录的Token")
+	@NotBlank
+	private String accessToken;
+
+	@ServiceParamField(describe = "用户id")
+	@NotNull
+	private Long id;
+
+	@ServiceParamField(describe = "姓名")
+	private String name;
+
+	@ServiceParamField(describe = "真实姓名")
+	private String realName;
+
+	@ServiceParamField(describe = "性别(1,2)")
+	private Integer sex;
+
+	@ServiceParamField(describe = "邮箱")
+	private String email;
+
+	@ServiceParamField(describe = "手机号码")
+	private String phone;
+}
+

+ 68 - 57
src/test/java/com/zhiqiyun/TestSdk.java

@@ -5,74 +5,85 @@ import com.dliyun.AlgorithmType;
 import com.dliyun.ClientException;
 import com.dliyun.DefaultClient;
 import com.dliyun.Response;
+import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.Map;
 
 public class TestSdk {
-    public static void main(String[] args) throws Exception {
-        DefaultClient client = new DefaultClient(
-                "http://127.0.0.1:9800/router",
-                "220228000020",
-                "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzg5TgyojZDZpSpUhpXlk6wWOH0OuVjnrOKOl9jdpzgG2fgws59Ue8YMGJpVi7q32mh4cIbNi5YDnH9sIxbFKPAo8HrcopVQfQ3E+z7e4T1yErfzsNk+sWjA3piZMSZOxX/rAZetAXYAT8ZxXUDidpEnjE7QR3uNBtiTS9TvhKxwIDAQAB",
-                AlgorithmType.RSA
-        );
-//		Map<String, Object> dataMap = new HashMap<>();
-//		dataMap.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOiLmtYvor5VyZWFsTmFtZSIsImF2YXRhciI6IiIsImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwiYWNjb3VudF9pZCI6IjE1MDAxMDA4MTc4MzIzMjEwMjYiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IiIsInJvbGVfaWQiOiIiLCJzY29wZSI6WyJhbGwiXSwibmlja19uYW1lIjoi5rWL6K-VbmFtZSIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2NDY3NDgyNTAsImRlcHRfaWQiOiIiLCJqdGkiOiI0Yzc4OTZiYy1kMGMxLTRjYzktOGEyYi03ODFkYWQ2M2E1NzgiLCJhY2NvdW50Ijoic3RqZHlkYXlvdSJ9.IMfsrcWrD0lKfddcQ3rD3Tug4d5o74u_AaYF__OxWmg");
-//		dataMap.put("oldPassword", "123456");
-//		dataMap.put("newPassword", "654321");
-////		form1.put("sex", "1");
-////		form1.put("email", "测试email");
-////		form1.put("phone", "测试phone");
-//		Response<Map<String, Object>> response = client.execute("oauth2.update.password", "1.0.0", dataMap);
-//		System.out.println(JSON.toJSONString(response));
-        TestSdk.testWechatLogin(client);
-    }
+	private DefaultClient getClient() {
+		return new DefaultClient(
+				"http://127.0.0.1:9800/router",
+				"220228000020",
+				"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCzg5TgyojZDZpSpUhpXlk6wWOH0OuVjnrOKOl9jdpzgG2fgws59Ue8YMGJpVi7q32mh4cIbNi5YDnH9sIxbFKPAo8HrcopVQfQ3E+z7e4T1yErfzsNk+sWjA3piZMSZOxX/rAZetAXYAT8ZxXUDidpEnjE7QR3uNBtiTS9TvhKxwIDAQAB",
+				AlgorithmType.RSA
+		);
+	}
 
-    public static void testlogin(DefaultClient client) throws ClientException {
+	@Test
+	public void testlogin() throws ClientException {
+		Map<String, Object> dataMap = new HashMap<>();
+		dataMap.put("userName", "stjdydayou");
+		dataMap.put("password", "654321");
+		Response<Map<String, Object>> response = this.getClient().execute("oauth2.login", "1.0.0", dataMap);
+		System.out.println(JSON.toJSONString(response));
+	}
 
-        Map<String, Object> dataMap = new HashMap<>();
-        dataMap.put("userName", "stjdydayou");
-        dataMap.put("password", "123456");
-        Response<Map<String, Object>> response = client.execute("oauth2.login", "1.0.0", dataMap);
-        System.out.println(JSON.toJSONString(response));
-    }
+	@Test
+	public void testUpdatePassword() throws ClientException {
+		Map<String, Object> dataMap = new HashMap<>();
+		dataMap.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOiI2NTQzMjEiLCJhdmF0YXIiOiIiLCJjbGllbnRfaWQiOiJzYWJlciIsInJvbGVfbmFtZSI6IiIsImxpY2Vuc2UiOiJwb3dlcmVkIGJ5IGJsYWRleCIsImFjY291bnRfaWQiOiIxNTAwMTAwODE3ODMyMzIxMDI2IiwicG9zdF9pZCI6IiIsInVzZXJfaWQiOiIiLCJyb2xlX2lkIjoiIiwic2NvcGUiOlsiYWxsIl0sIm5pY2tfbmFtZSI6IjEyMzQ1NiIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2NDcwMTcyNTMsImRlcHRfaWQiOiIiLCJqdGkiOiI5N2NhZTAxMS0yYjcwLTRlMzQtYWM2ZC02YWM4ZWY1YWIyMzEiLCJhY2NvdW50Ijoic3RqZHlkYXlvdSJ9.nvXxZ_qlfLYFsL3WEwi5J26nGv7u_PHPnchEHNKs384");
+		dataMap.put("oldPassword", "654321");
+		dataMap.put("newPassword", "123456");
+		Response<Map<String, Object>> response = this.getClient().execute("oauth2.update.password", "1.0.0", dataMap);
+		System.out.println(JSON.toJSONString(response));
+	}
 
-    public static void testUpdatePassword(DefaultClient client) throws ClientException {
+	@Test
+	public void testUpdateInfo() throws ClientException {
 
-        Map<String, Object> dataMap = new HashMap<>();
-        dataMap.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOiLmtYvor5VyZWFsTmFtZSIsImF2YXRhciI6IiIsImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwiYWNjb3VudF9pZCI6IjE1MDAxMDA4MTc4MzIzMjEwMjYiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IiIsInJvbGVfaWQiOiIiLCJzY29wZSI6WyJhbGwiXSwibmlja19uYW1lIjoi5rWL6K-VTmFtZSIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2NDY3NTkzNzAsImRlcHRfaWQiOiIiLCJqdGkiOiJkMTJiY2JhZC0xNGUzLTQ3MzQtOTJjOC01ZGNkNjhjODU4NGEiLCJhY2NvdW50Ijoic3RqZHlkYXlvdSJ9.AkmVj1GJZctly2e5cBlmv4YQOAJgevSiLJoIxye85Ko");
-        dataMap.put("oldPassword", "123456");
-        dataMap.put("newPassword", "654321");
-        Response<Map<String, Object>> response = client.execute("oauth2.update.password", "1.0.0", dataMap);
-        System.out.println(JSON.toJSONString(response));
-    }
+		Map<String, Object> dataMap = new HashMap<>();
+		dataMap.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOiI2NTQzMjEiLCJhdmF0YXIiOiIiLCJjbGllbnRfaWQiOiJzYWJlciIsInJvbGVfbmFtZSI6IiIsImxpY2Vuc2UiOiJwb3dlcmVkIGJ5IGJsYWRleCIsImFjY291bnRfaWQiOiIxNTAwMTAwODE3ODMyMzIxMDI2IiwicG9zdF9pZCI6IiIsInVzZXJfaWQiOiIiLCJyb2xlX2lkIjoiIiwic2NvcGUiOlsiYWxsIl0sIm5pY2tfbmFtZSI6IjEyMzQ1NiIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2NDcwMTcyNTMsImRlcHRfaWQiOiIiLCJqdGkiOiI5N2NhZTAxMS0yYjcwLTRlMzQtYWM2ZC02YWM4ZWY1YWIyMzEiLCJhY2NvdW50Ijoic3RqZHlkYXlvdSJ9.nvXxZ_qlfLYFsL3WEwi5J26nGv7u_PHPnchEHNKs384");
+		dataMap.put("name", "123456");
+		dataMap.put("realName", "654321");
+		dataMap.put("sex", "1");
+		dataMap.put("email", "stjdydayou@163.com");
+		dataMap.put("phone", "18073113117");
+		Response<Map<String, Object>> response = this.getClient().execute("oauth2.update.info", "1.0.0", dataMap);
+		System.out.println(JSON.toJSONString(response));
+	}
 
-    public static void testUpdateInfo(DefaultClient client) throws ClientException {
+	@Test
+	public void testWechatLogin() throws ClientException {
 
-        Map<String, Object> dataMap = new HashMap<>();
-        dataMap.put("accessToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOiLmtYvor5VyZWFsTmFtZSIsImF2YXRhciI6IiIsImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwiYWNjb3VudF9pZCI6IjE1MDAxMDA4MTc4MzIzMjEwMjYiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IiIsInJvbGVfaWQiOiIiLCJzY29wZSI6WyJhbGwiXSwibmlja19uYW1lIjoi5rWL6K-VTmFtZSIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjpudWxsLCJleHAiOjE2NDY3NTkzNzAsImRlcHRfaWQiOiIiLCJqdGkiOiJkMTJiY2JhZC0xNGUzLTQ3MzQtOTJjOC01ZGNkNjhjODU4NGEiLCJhY2NvdW50Ijoic3RqZHlkYXlvdSJ9.AkmVj1GJZctly2e5cBlmv4YQOAJgevSiLJoIxye85Ko");
-        dataMap.put("name", "123456");
-        dataMap.put("realName", "654321");
-        dataMap.put("sex", "1");
-        dataMap.put("email", "stjdydayou@163.com");
-        dataMap.put("phone", "18073113117");
-        Response<Map<String, Object>> response = client.execute("oauth2.update.info", "1.0.0", dataMap);
-        System.out.println(JSON.toJSONString(response));
-    }
+		Map<String, Object> dataMap = new HashMap<>();
+		dataMap.put("source", "WECHAT_MP");
+		dataMap.put("uuid", "wxc01ea0423e91d9e0");
+		dataMap.put("name", "wxc01ea0423e91d9e0");
+		dataMap.put("realName", "wxc01ea0423e91d9e0");
+		Response<Map<String, Object>> response = this.getClient().execute("oauth2.wechat.login", "1.0.0", dataMap);
+		System.out.println(JSON.toJSONString(response));
+	}
 
-    public static void testWechatLogin(DefaultClient client) throws ClientException {
+	@Test
+	public void sendPhoneValidateCode() throws ClientException {
+		Map<String, Object> dataMap = new HashMap<>();
+		dataMap.put("phone", "18073113117");
+		Response<Map<String, Object>> response = this.getClient().execute("oauth2.send.phone.validate.code", "1.0.0", dataMap);
+		System.out.println(JSON.toJSONString(response));
+	}
 
-        Map<String, Object> dataMap = new HashMap<>();
-        dataMap.put("source", "WECHAT_MP");
-        dataMap.put("uuid", "wxc01ea0423e91d9e0");
-        dataMap.put("name", "wxc01ea0423e91d9e0");
-        dataMap.put("realName", "wxc01ea0423e91d9e0");
-        Response<Map<String, Object>> response = client.execute("oauth2.wechat.login", "1.0.0", dataMap);
-        System.out.println(JSON.toJSONString(response));
-    }
+	@Test
+	public void socialSubmit() throws ClientException {
+		Map<String, Object> dataMap = new HashMap<>();
+		dataMap.put("account", "zxcc123");
+		dataMap.put("password", "123456");
+		dataMap.put("name", "Jtoms");
+		dataMap.put("realName", "Jtoms.Shen");
+		dataMap.put("sex", "1");
+		dataMap.put("email", "stjdydayou@163.com");
+		dataMap.put("phone", "18073113117");
+		Response<Map<String, Object>> response = this.getClient().execute("oauth2.social.submit", "1.0.0", dataMap);
+		System.out.println(JSON.toJSONString(response));
+	}
 }
-
-/*
-  {"body":{"user_name":"stjdydayou","avatar":"","token_type":"bearer","client_id":"saber","access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOm51bGwsImF2YXRhciI6IiIsImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwiYWNjb3VudF9pZCI6IjE1MDAxMDA4MTc4MzIzMjEwMjYiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IiIsInJvbGVfaWQiOiIiLCJzY29wZSI6WyJhbGwiXSwibmlja19uYW1lIjpudWxsLCJvYXV0aF9pZCI6IiIsImRldGFpbCI6bnVsbCwiZXhwIjoxNjQ2NjU0ODk2LCJkZXB0X2lkIjoiIiwianRpIjoiZjFjZDYxNzctNmZiNC00MDQxLWE3MjYtZTk2MGFiYjIzMzlhIiwiYWNjb3VudCI6InN0amR5ZGF5b3UifQ.dgG0-TiC9Y_gHshMQKQOsrum7PjqnpdGtWqZtydR_8c","role_name":"","refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOm51bGwsInVzZXJfbmFtZSI6InN0amR5ZGF5b3UiLCJyZWFsX25hbWUiOm51bGwsImF2YXRhciI6IiIsImNsaWVudF9pZCI6InNhYmVyIiwicm9sZV9uYW1lIjoiIiwibGljZW5zZSI6InBvd2VyZWQgYnkgYmxhZGV4IiwiYWNjb3VudF9pZCI6IjE1MDAxMDA4MTc4MzIzMjEwMjYiLCJwb3N0X2lkIjoiIiwidXNlcl9pZCI6IiIsInJvbGVfaWQiOiIiLCJzY29wZSI6WyJhbGwiXSwibmlja19uYW1lIjpudWxsLCJhdGkiOiJmMWNkNjE3Ny02ZmI0LTQwNDEtYTcyNi1lOTYwYWJiMjMzOWEiLCJvYXV0aF9pZCI6IiIsImRldGFpbCI6bnVsbCwiZXhwIjoxNjQ3MjIzNjk2LCJkZXB0X2lkIjoiIiwianRpIjoiYjc5OTc0NWQtYzk5NC00MzYxLWI5M2ItNTMwOThiZDQyYmU5IiwiYWNjb3VudCI6InN0amR5ZGF5b3UifQ.qYCYRULZqqn9JJKkMepYCLLNH9cqDty0L_hi0qEqh90","license":"powered by bladex","account_id":"1500100817832321026","post_id":"","user_id":"","role_id":"","scope":"all","oauth_id":"","dept_id":"","expires_in":35999,"account":"stjdydayou","jti":"f1cd6177-6fb4-4041-a726-e960abb2339a"},"code":"SUCCESS","msg":"请求成功","successful":true}
- */