|
|
@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
@Slf4j
|
|
|
@@ -74,10 +76,13 @@ public class AuthenticationController {
|
|
|
|
|
|
@PostMapping("/maLogin")
|
|
|
@ApiOperation(value = "小程序登录")
|
|
|
- public String maLogin(String code, Long parent) {
|
|
|
+ public Map<String, String> maLogin(String code, Long parent) {
|
|
|
try {
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
User user = userService.loginMa(code, parent);
|
|
|
- return jwtTokenUtil.generateToken(JwtUserFactory.create(user));
|
|
|
+ map.put("token", jwtTokenUtil.generateToken(JwtUserFactory.create(user)));
|
|
|
+ map.put("sessionKey", user.getSessionKey());
|
|
|
+ return map;
|
|
|
} catch (Exception e) {
|
|
|
log.error("loginByCode", e);
|
|
|
throw new AuthenticationException("登陆错误", e);
|