| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpSession; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | public ResultUtil cancellation(HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | if (null == driverId) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Driver driver = driverService.selectById(driverId); |
| | |
| | | driverService.updateById(driver); |
| | | //开始验证当前账号是否在别处登录 |
| | | String value = redisUtil.getValue("DRIVER_" + driverId); |
| | | if(ToolUtil.isNotEmpty(value)){//将另外设备上的强迫下线 |
| | | if (ToolUtil.isNotEmpty(value)) {//将另外设备上的强迫下线 |
| | | //开始清除redis中无效的数据 |
| | | String key = redisUtil.getValue("DRIVER_" + driver.getPhone()); |
| | | redisUtil.remove(key);//删除个人信息数据 |
| | |
| | | redisUtil.remove("DRIVER_" + driverId);//清除存储的token |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/driver/getDriverInfo") |
| | | public void getDriverInfo(String lsu, String ssologinid, String ticket, HttpSession session) { |
| | | try { |
| | | String onconParam = edu.yale.its.tp.cas.client.Util.getOnconParam(session); |
| | | onconParam = new String(Base64.getDecoder().decode(onconParam), "UTF-8"); |
| | | System.err.println("lsu: " + lsu + ",ticket: " + ticket + ",ssologinid: " + ssologinid); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |