|
@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestAttribute;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -62,13 +63,14 @@ public class DriverApiController {
|
|
|
if (vehicleInfo == null){
|
|
|
throw new Exception("车牌号或激活码错误");
|
|
|
}
|
|
|
- if ("1".equals(vehicleInfo.getStatus())){
|
|
|
- throw new Exception("此车辆已被激活");
|
|
|
- }
|
|
|
+// if ("1".equals(vehicleInfo.getStatus())){
|
|
|
+// throw new Exception("此车辆已被激活");
|
|
|
+// }
|
|
|
vehicleInfo.setStatus("1");
|
|
|
+ vehicleInfo.setUpdateTime(new Date());
|
|
|
vehicleInfoService.update(vehicleInfo);
|
|
|
|
|
|
- String token = JwtUtil.createToken(jwtSecret, vehicleInfo.getId(), DateTime.now().plusHours(6).toDate());
|
|
|
+ String token = JwtUtil.createToken(jwtSecret, vehicleInfo.getId(), DateTime.now().plusYears(1).toDate());
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
map.put("token",token);
|