| | |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginBatteryUser") |
| | | public R loginBatteryUser(@RequestParam("account") String account, @RequestParam("password") String password) { |
| | | LoginReturnVO loginReturnVO = loginService.loginBatteryUser(account, password); |
| | | public R loginBatteryUser(@RequestParam("account") String account, @RequestParam("password") String password,@RequestParam("appid")String appid) { |
| | | LoginReturnVO loginReturnVO = loginService.loginBatteryUser(account, password,appid); |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.vos.LoginReturnVO; |
| | | import com.panzhihua.common.model.vos.LoginReturnsVO; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | * 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | LoginReturnVO loginBatteryUser(String account, String password); |
| | | LoginReturnVO loginBatteryUser(String account, String password,String appid); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.LoginReturnsVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.utlis.JWTTokenUtil; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import static java.util.Objects.nonNull; |
| | | |
| | |
| | | * @return 登录结果 |
| | | */ |
| | | @Override |
| | | public LoginReturnVO loginBatteryUser(String account, String password) { |
| | | Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account + "_20", password)); |
| | | public LoginReturnVO loginBatteryUser(String account, String password,String appid) { |
| | | Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account + "_20"+appid, password)); |
| | | LoginUserInfoVO loginUser = (LoginUserInfoVO)authentication.getPrincipal(); |
| | | String token = JWTTokenUtil.generateToken(loginUser); |
| | | String refeshToken = JWTTokenUtil.generateRefeshToken(loginUser); |
| | |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginBatteryUser") |
| | | R loginBatteryUser(@RequestParam("account") String account, @RequestParam("password") String password); |
| | | R loginBatteryUser(@RequestParam("account") String account, @RequestParam("password") String password,@RequestParam("appid")String appid); |
| | | } |
| | |
| | | if (empty || empty1) { |
| | | return R.fail("账户密码不能为空"); |
| | | } |
| | | R r = tokenService.loginBatteryUser(account, password); |
| | | R r = tokenService.loginBatteryUser(account, password,this.getAppId()); |
| | | return r; |
| | | } |
| | | |