From 55fbcf072af3cba26b9946a3bab484e06b62ecc8 Mon Sep 17 00:00:00 2001 From: "zhiyong.ning" <354350178@qq.com> Date: Fri, 13 Nov 2020 12:11:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/msdw/tms/controller/UserController.java | 2 ++ .../java/com/msdw/tms/controller/UserInfoController.java | 7 +++---- src/main/java/com/msdw/tms/entity/UserEntity.java | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) 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; }