|
|
@@ -8,12 +8,15 @@ import com.mokamrp.privates.constant.RedisKey;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.utils.ServletUtils;
|
|
|
+import com.xxl.sso.core.conf.Conf;
|
|
|
+import com.xxl.sso.core.user.XxlSsoUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author leon token认证
|
|
|
@@ -49,6 +52,15 @@ public class AuthIntercepotor extends HandlerInterceptorAdapter {
|
|
|
// }
|
|
|
// User user = objectMapper.convertValue(userObj, User.class);
|
|
|
// request.setAttribute("auth-user", user);
|
|
|
+ XxlSsoUser xxlSsoUser = (XxlSsoUser) request.getAttribute(Conf.SSO_USER);
|
|
|
+ Map<String, String> plugininfo=xxlSsoUser.getPlugininfo();
|
|
|
+ User user=new User();
|
|
|
+ user.setId(Integer.getInteger(plugininfo.get("employeeNo")));
|
|
|
+ user.setName(xxlSsoUser.getUsername());
|
|
|
+ user.setGender(Integer.getInteger(plugininfo.get("employeeNo")));
|
|
|
+ user.setIsSuperAdmin(1);
|
|
|
+ request.setAttribute("auth-user", user);
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|