|
@@ -39,30 +39,30 @@ public class TaPersonController extends BaseController {
|
39
|
39
|
@Autowired
|
40
|
40
|
public ITaPersonService iTaPersonService;
|
41
|
41
|
|
42
|
|
- @PostMapping("/ma/login")
|
43
|
|
- public ResponseBean login(String code) {
|
44
|
|
- // 用 code 去换 openid
|
45
|
|
- String openid = "";
|
46
|
|
-
|
47
|
|
- // 先查询人员是否存在
|
48
|
|
- TaPerson taPerson = iTaPersonService.getByOpenId(openid);
|
49
|
|
-
|
50
|
|
- // 如果人员不存在, 则新增
|
51
|
|
- if (null == taPerson) {
|
52
|
|
- taPerson = new TaPerson();
|
53
|
|
- taPerson.setOpenid(openid);
|
54
|
|
- iTaPersonService.save(taPerson);
|
55
|
|
-// taPerson = iTaPersonService.getById(taPerson.getPersonId());
|
56
|
|
- }
|
57
|
|
-
|
58
|
|
- // 生成 token
|
59
|
|
- Map<String, Object> claims = new HashMap<>();
|
60
|
|
- claims.put("personId", taPerson.getPersonId());
|
61
|
|
- String token = JWTUtils.encode(claims);
|
62
|
|
- taPerson.setToken(token);
|
63
|
|
-
|
64
|
|
- return ResponseBean.success(taPerson);
|
65
|
|
- }
|
|
42
|
+// @PostMapping("/ma/login")
|
|
43
|
+// public ResponseBean login(String code) {
|
|
44
|
+// // 用 code 去换 openid
|
|
45
|
+// String openid = "";
|
|
46
|
+//
|
|
47
|
+// // 先查询人员是否存在
|
|
48
|
+// TaPerson taPerson = iTaPersonService.getByOpenId(openid);
|
|
49
|
+//
|
|
50
|
+// // 如果人员不存在, 则新增
|
|
51
|
+// if (null == taPerson) {
|
|
52
|
+// taPerson = new TaPerson();
|
|
53
|
+// taPerson.setOpenid(openid);
|
|
54
|
+// iTaPersonService.save(taPerson);
|
|
55
|
+//// taPerson = iTaPersonService.getById(taPerson.getPersonId());
|
|
56
|
+// }
|
|
57
|
+//
|
|
58
|
+// // 生成 token
|
|
59
|
+// Map<String, Object> claims = new HashMap<>();
|
|
60
|
+// claims.put("personId", taPerson.getPersonId());
|
|
61
|
+// String token = JWTUtils.encode(claims);
|
|
62
|
+// taPerson.setToken(token);
|
|
63
|
+//
|
|
64
|
+// return ResponseBean.success(taPerson);
|
|
65
|
+// }
|
66
|
66
|
|
67
|
67
|
|
68
|
68
|
/**
|