From 558ffc4bcaf7aa5c683e7c9ce01e971feb9e4d95 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期一, 14 十月 2024 14:11:48 +0800 Subject: [PATCH] 模型打包租户隔离 备份文件租户隔离 --- iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/oauth2/OAuth2OpenController.java | 28 ++++++++++------------------ 1 files changed, 10 insertions(+), 18 deletions(-) diff --git a/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/oauth2/OAuth2OpenController.java b/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/oauth2/OAuth2OpenController.java index 44791bf..a1fe484 100644 --- a/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/oauth2/OAuth2OpenController.java +++ b/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/controller/admin/oauth2/OAuth2OpenController.java @@ -11,6 +11,7 @@ import com.iailab.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAccessTokenRespVO; import com.iailab.module.system.controller.admin.oauth2.vo.open.OAuth2OpenAuthorizeInfoRespVO; import com.iailab.module.system.controller.admin.oauth2.vo.open.OAuth2OpenCheckTokenRespVO; +import com.iailab.module.system.controller.admin.oauth2.vo.open.OAuth2OpenLoginReqVO; import com.iailab.module.system.convert.oauth2.OAuth2OpenConvert; import com.iailab.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import com.iailab.module.system.dal.dataobject.oauth2.OAuth2ApproveDO; @@ -84,25 +85,16 @@ @PostMapping("/token") @PermitAll @Operation(summary = "获得访问令牌", description = "适合 code 授权码模式,或者 implicit 简化模式;在 sso.vue 单点登录界面被【获取】调用") - @Parameters({ - @Parameter(name = "grant_type", required = true, description = "授权类型", example = "code"), - @Parameter(name = "code", description = "授权范围", example = "userinfo.read"), - @Parameter(name = "redirect_uri", description = "重定向 URI", example = "https://www.baidu.com"), - @Parameter(name = "state", description = "状态", example = "1"), - @Parameter(name = "username", example = "tudou"), - @Parameter(name = "password", example = "cai"), // 多个使用空格分隔 - @Parameter(name = "scope", example = "user_info"), - @Parameter(name = "refresh_token", example = "123424233"), - }) public CommonResult<OAuth2OpenAccessTokenRespVO> postAccessToken(HttpServletRequest request, - @RequestParam("grant_type") String grantType, - @RequestParam(value = "code", required = false) String code, // 授权码模式 - @RequestParam(value = "redirect_uri", required = false) String redirectUri, // 授权码模式 - @RequestParam(value = "state", required = false) String state, // 授权码模式 - @RequestParam(value = "username", required = false) String username, // 密码模式 - @RequestParam(value = "password", required = false) String password, // 密码模式 - @RequestParam(value = "scope", required = false) String scope, // 密码模式 - @RequestParam(value = "refresh_token", required = false) String refreshToken) { // 刷新模式 + @RequestBody OAuth2OpenLoginReqVO openLoginReqVO) { + String code = openLoginReqVO.getCode(); + String scope = openLoginReqVO.getScope(); + String grantType = openLoginReqVO.getGrantType(); + String redirectUri = openLoginReqVO.getRedirectUri(); + String state = openLoginReqVO.getState(); + String username = openLoginReqVO.getUsername(); + String password = openLoginReqVO.getPassword(); + String refreshToken = openLoginReqVO.getRefreshToken(); List<String> scopes = OAuth2Utils.buildScopes(scope); // 1.1 校验授权类型 OAuth2GrantTypeEnum grantTypeEnum = OAuth2GrantTypeEnum.getByGrantType(grantType); -- Gitblit v1.9.3