Commit afcdc30e authored by 赵啸非's avatar 赵啸非

添加初始化数据库脚本

parent d1ae3fb5
......@@ -8,6 +8,8 @@ import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.feign.user.IUserFeign;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
......@@ -18,6 +20,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.Base64;
......@@ -34,6 +37,10 @@ import java.util.Map;
@Order(1)
@Slf4j
public class AuthTokenServiceImpl implements IAuthTokenService {
@Autowired
private UserService userService;
// 令牌自定义标识
@Value("${token.header:Authorization}")
private String header;
......@@ -95,6 +102,12 @@ public class AuthTokenServiceImpl implements IAuthTokenService {
if (StringUtils.isNotEmpty(userStr)) {
UserEntity userEntity = JSONObject.parseObject(userStr, UserEntity.class);
userEntity.setToken(token);
UserEntity temp = userService.selectOne(new UserQuery().loginName(userEntity.getLoginName()));
if(!ObjectUtils.isEmpty(temp)){
userEntity.setId(temp.getId());
}
return userEntity;
}
} catch (Exception e) {
......
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