| | |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.dao.system.dto.DingLoginDTO; |
| | | import com.doumee.dao.system.dto.LoginDTO; |
| | | import com.doumee.dao.system.dto.UpdatePwdDto; |
| | | import com.doumee.service.system.SystemLoginService; |
| | | import com.taobao.api.ApiException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author dm |
| | |
| | | return ApiResponse.success(systemLoginService.loginByPassword(dto, request)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("钉钉授权登录") |
| | | // @EncryptionReq |
| | | // @EncryptionResp |
| | | @PostMapping("/loginByDingTalk") |
| | | public ApiResponse<Map<String,Object>> loginByDingTalk (@Validated @RequestBody DingLoginDTO dto, HttpServletRequest request) throws ApiException { |
| | | return ApiResponse.success(systemLoginService.loginByDingTalk(dto, request)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("退出登录") |
| | | @PostMapping("/logout") |
| | | public ApiResponse logout () { |
| | | systemUserBiz.cleanUnionId(this.getLoginUser().getId()); |
| | | Subject subject = SecurityUtils.getSubject(); |
| | | subject.logout(); |
| | | return ApiResponse.success(null); |