Commit b98b9626 authored by xiaoguang.xu's avatar xiaoguang.xu

登陆返回增加uuid属性

parent c629cc5a
package cn.quantgroup.xyqb.model; package cn.quantgroup.xyqb.model;
import lombok.Getter;
import lombok.Setter;
import java.security.Principal; import java.security.Principal;
/** /**
* Created by Miraculous on 15/7/9. * Created by Miraculous on 15/7/9.
*/ */
@Getter
@Setter
public class AuthBean { public class AuthBean {
private String token; private String token;
private String phoneNo; private String phoneNo;
private String uuid;
public AuthBean(String token, Principal user) { public AuthBean(String token, Principal user) {
this.token = token; this.token = token;
...@@ -19,19 +25,4 @@ public class AuthBean { ...@@ -19,19 +25,4 @@ public class AuthBean {
} }
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
} }
package cn.quantgroup.xyqb.service.session.impl; package cn.quantgroup.xyqb.service.session.impl;
import java.sql.Timestamp;
import java.util.*;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.AuthBean; import cn.quantgroup.xyqb.model.AuthBean;
...@@ -29,6 +11,20 @@ import cn.quantgroup.xyqb.service.session.ISessionService; ...@@ -29,6 +11,20 @@ import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.session.aspect.UserBtRegisterFill; import cn.quantgroup.xyqb.service.session.aspect.UserBtRegisterFill;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.MqUtils; import cn.quantgroup.xyqb.util.MqUtils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.*;
import java.util.concurrent.TimeUnit;
/** /**
* session创建和续期 * session创建和续期
...@@ -69,9 +65,11 @@ public class SessionServiceImpl implements ISessionService { ...@@ -69,9 +65,11 @@ public class SessionServiceImpl implements ISessionService {
} else { } else {
sessionStruct = createSessionAndPersist(user, properties); sessionStruct = createSessionAndPersist(user, properties);
} }
String uuid = user.getUuid();
AuthBean authBean = new AuthBean(); AuthBean authBean = new AuthBean();
authBean.setPhoneNo(user.getPhoneNo()); authBean.setPhoneNo(user.getPhoneNo());
authBean.setToken(sessionStruct.getSid()); authBean.setToken(sessionStruct.getSid());
authBean.setUuid(uuid);
log.info("用户登录成功, loginFrom:{}, phoneNo:{},appChannel:{},channelId:{}", properties.getCreatedFrom(), user.getPhoneNo(), properties.getAppChannel(), properties.getChannelId()); log.info("用户登录成功, loginFrom:{}, phoneNo:{},appChannel:{},channelId:{}", properties.getCreatedFrom(), user.getPhoneNo(), properties.getAppChannel(), properties.getChannelId());
return authBean; return authBean;
} }
......
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