| | |
| | | |
| | | import com.vci.ubcs.code.service.IPasswordFreeLoginService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @author ludc |
| | |
| | | @Resource |
| | | private IPasswordFreeLoginService passwordFreeLoginService; |
| | | |
| | | @GetMapping("/login") |
| | | public R passwordFreeLogin(String account) { |
| | | boolean resBoolean = passwordFreeLoginService.passwordFreeLogin(account); |
| | | return R.status(resBoolean); |
| | | @PostMapping("/login") |
| | | public R passwordFreeLogin(@RequestParam String username, HttpServletRequest request) { |
| | | boolean status; |
| | | try { |
| | | status = passwordFreeLoginService.passwordFreeLogin(username,request); |
| | | }catch (Exception e){ |
| | | throw new ServiceException("免密登录获取token失败:"+e.getMessage()); |
| | | } |
| | | return R.status(status); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |