diff --git a/src/main/java/com/msdw/tms/controller/UserController.java b/src/main/java/com/msdw/tms/controller/UserController.java index e36b8c7..7c8bf9b 100644 --- a/src/main/java/com/msdw/tms/controller/UserController.java +++ b/src/main/java/com/msdw/tms/controller/UserController.java @@ -63,6 +63,8 @@ public class UserController implements UserControllerApi { */ @PostMapping("/save") public R save(@RequestBody UserEntity userEntity){ + String token ="UT_"+ UUID.randomUUID().toString().replace("-", ""); + userEntity.setToken(token); userService.save(userEntity); return R.ok(); diff --git a/src/main/java/com/msdw/tms/controller/UserInfoController.java b/src/main/java/com/msdw/tms/controller/UserInfoController.java index 9982b63..dcce813 100644 --- a/src/main/java/com/msdw/tms/controller/UserInfoController.java +++ b/src/main/java/com/msdw/tms/controller/UserInfoController.java @@ -16,10 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @RestController @RequestMapping("tms/userInfo") @@ -61,6 +58,8 @@ public class UserInfoController implements UserInfoControllerApi { @Transactional @PostMapping("/add") public R save(@RequestBody UserInfoEntity userInfoEntity){ + String token ="UT_"+ UUID.randomUUID().toString().replace("-", ""); + userInfoEntity.setToken(token); userInfoEntity.setSchoolId(2105); Integer schoolId = userInfoEntity.getSchoolId(); Integer integer = userInfoService.queryStudentAccount(userInfoEntity.getAccount(),schoolId); diff --git a/src/main/java/com/msdw/tms/entity/UserEntity.java b/src/main/java/com/msdw/tms/entity/UserEntity.java index 9d30c1e..108ffcf 100644 --- a/src/main/java/com/msdw/tms/entity/UserEntity.java +++ b/src/main/java/com/msdw/tms/entity/UserEntity.java @@ -55,5 +55,7 @@ public class UserEntity implements Serializable { private String useravatars; //是否删除 private Integer isdel; + //token + private String token; }