...
|
...
|
@@ -89,7 +89,7 @@ public class YtThirdPlatformController extends BaseController { |
89
|
89
|
|
90
|
90
|
@GetMapping("login/{loginCode}")
|
91
|
91
|
@ApiOperation("第三方登录")
|
92
|
|
- public YtLoginResponse login(@PathVariable("loginCode") String loginCode)
|
|
92
|
+ public YtLoginResponse codeLogin(@PathVariable("loginCode") String loginCode)
|
93
|
93
|
throws ThingsboardException {
|
94
|
94
|
String thirdUserId = thirdService.thirdLogin(loginCode);
|
95
|
95
|
UserDTO userDto = thirdService.login(thirdUserId);
|
...
|
...
|
@@ -99,6 +99,17 @@ public class YtThirdPlatformController extends BaseController { |
99
|
99
|
return buildJwtToken(userDto, thirdUserId);
|
100
|
100
|
}
|
101
|
101
|
|
|
102
|
+ @GetMapping("login/id/{userId}")
|
|
103
|
+ @ApiOperation("组态用户认证")
|
|
104
|
+ public YtLoginResponse unionidLogin(@PathVariable("userId") String userId)
|
|
105
|
+ throws ThingsboardException {
|
|
106
|
+ UserDTO userDto = ytUserService.findUserInfoById(userId);
|
|
107
|
+ if (userDto == null) {
|
|
108
|
+ return new YtLoginResponse().setThirdUserId(userId);
|
|
109
|
+ }
|
|
110
|
+ return buildJwtToken(userDto, userId);
|
|
111
|
+ }
|
|
112
|
+
|
102
|
113
|
@NotNull
|
103
|
114
|
private YtLoginResponse buildJwtToken(UserDTO userDto, String thirdUserId) {
|
104
|
115
|
String accessToken = "";
|
...
|
...
|
|