| | |
| | | package com.xcong.farmer.cms.modules.system.controller; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.farmer.cms.common.contants.AppContants; |
| | | import com.xcong.farmer.cms.common.response.Result; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminLoginDto; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | |
| | | import java.util.Map; |
| | | |
| | | |
| | | @RestController |
| | |
| | | |
| | | @ApiOperation(value = "登陆接口", notes = "登陆接口") |
| | | @PostMapping("/login") |
| | | public Result login(@RequestBody AdminLoginDto adminLoginDto) { |
| | | |
| | | String username = adminLoginDto.getUsername(); |
| | | if(StrUtil.isEmpty(username)){ |
| | | return Result.fail("请输入用户名"); |
| | | } |
| | | String password = adminLoginDto.getPassword(); |
| | | if(StrUtil.isEmpty(password)){ |
| | | return Result.fail("请输入密码"); |
| | | } |
| | | public Result login(@RequestBody @Valid AdminLoginDto adminLoginDto) { |
| | | return iCommonService.login(adminLoginDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取验证码", notes = "获取验证码") |
| | | @GetMapping("/captcha") |
| | | public Result captcha() throws IOException { |
| | | return iCommonService.captchaCreator(); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="用户退出登录", notes="用户退出登录") |
| | | @GetMapping(value = "/Logout") |
| | | @PostMapping(value = "/Logout") |
| | | public Result memberLogout() { |
| | | return iCommonService.memberLogout(); |
| | | } |