|
@@ -105,10 +105,24 @@ public class TenantController extends BaseController<EduTenant> implements Tena
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/getTenantById")
|
|
|
- @PreAuthorize("hasRole('超级管理员')")
|
|
|
- public BaseResponse<SysRoleVo> getTenantById(Long id) {
|
|
|
+// @PreAuthorize("hasRole('超级管理员')")
|
|
|
+ public BaseResponse<EduTenantVo> getTenantById(Long id) {
|
|
|
EduTenant tenant = tenantService.getTenantById(id);
|
|
|
- SysRoleVo eduTenantVo = BeanUtil.copyProperties(tenant, SysRoleVo.class);
|
|
|
+ EduTenantVo eduTenantVo = BeanUtil.copyProperties(tenant, EduTenantVo.class);
|
|
|
+ return PageResponse.out(200, "success", eduTenantVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询登录用户信息
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getLoginTenantInfo")
|
|
|
+// @PreAuthorize("hasRole('超级管理员')")
|
|
|
+ public BaseResponse<EduTenantVo> getLoginTenantInfo() {
|
|
|
+ EduTenant principal = (EduTenant) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
|
|
+ EduTenant tenant = tenantService.getTenantById(principal.getId());
|
|
|
+ EduTenantVo eduTenantVo = BeanUtil.copyProperties(tenant, EduTenantVo.class);
|
|
|
return PageResponse.out(200, "success", eduTenantVo);
|
|
|
}
|
|
|
|