| | |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.company.api.RemoteCompanyUserService; |
| | | import com.ruoyi.company.api.domain.User; |
| | | import com.ruoyi.company.api.domain.dto.MgtCompanyDTO; |
| | | import com.ruoyi.company.api.model.RegisterUser; |
| | | import com.ruoyi.system.api.model.AppUser; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | } |
| | | |
| | | @Operation(summary = "管理端-修改密码") |
| | | @GetMapping("/modify-pwd") |
| | | @PostMapping("/modify-pwd") |
| | | public R<?> modifyPwd(@Valid @RequestBody MgtPasswordDTO dto) { |
| | | try { |
| | | sysLoginService.modifyPwd(dto); |
| | |
| | | |
| | | @PostMapping("companyRegister") |
| | | @Operation(summary = "用户注册接口",description = "用户注册接口") |
| | | public R<?> companyRegister(@RequestBody RegisterUser registerUser) |
| | | public R<?> companyRegister(@RequestBody MgtCompanyDTO registerUser) |
| | | { |
| | | // 用户注册 |
| | | sysLoginService.companyRegister(registerUser); |
| | |
| | | appUser.setAccountName(user.getAccountName()); |
| | | appUser.setPhone(user.getPhone()); |
| | | appUser.setLoginTime(System.currentTimeMillis()); |
| | | appUser.setExpireTime(appUser.getLoginTime() + CacheConstants.EXPIRATION * 60 * 1000L); |
| | | appUser.setToken(token); |
| | | |
| | | // 根据uuid将loginUser缓存 |
| | |
| | | return "login_tokens:" + token; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 公司校验 |
| | | */ |
| | | @PostMapping("check") |
| | | @Operation(summary = "公司校验",description = "公司校验") |
| | | public R<?> check(@RequestBody RegisterUser registerUser) |
| | | { |
| | | R<User> userR = sysLoginService.resetPwdCheck(registerUser); |
| | | if (userR == null){ |
| | | return R.fail("用户不存在"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 重置密码 |
| | | */ |