Commit 24b5de0c by chenweisong

更新

parent b8aba420
package com.keymobile.rest.service; package com.keymobile.rest.service;
import com.keymobile.rest.model.User; import com.keymobile.rest.model.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
...@@ -10,6 +11,7 @@ import java.util.Map; ...@@ -10,6 +11,7 @@ import java.util.Map;
@Service @Service
@Slf4j
public class SessionService { public class SessionService {
@Autowired @Autowired
...@@ -20,6 +22,7 @@ public class SessionService { ...@@ -20,6 +22,7 @@ public class SessionService {
String userName = "NO_USER"; String userName = "NO_USER";
if (auth != null) { if (auth != null) {
userName = auth.getName(); userName = auth.getName();
log.info("login user: {}", userName);
String[] info = userName.split(":"); String[] info = userName.split(":");
return User.builder().id(Long.parseLong(info[1])).name(info[0]).build(); return User.builder().id(Long.parseLong(info[1])).name(info[0]).build();
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment