Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
149f4ab061 | ||
|
|
a22c08738a | ||
|
|
d28f3250e3 |
22
pom.xml
22
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>springboot-parent</name>
|
<name>springboot-parent</name>
|
||||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||||
@@ -57,55 +57,55 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.tiesheng.springboot-plugin</groupId>
|
<groupId>com.tiesheng.springboot-plugin</groupId>
|
||||||
<artifactId>tiesheng-maven-plugin</artifactId>
|
<artifactId>tiesheng-maven-plugin</artifactId>
|
||||||
<version>0.0.4</version>
|
<version>0.0.5</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-ademo</artifactId>
|
<artifactId>springboot-ademo</artifactId>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.tiesheng.demo.config;
|
package com.tiesheng.demo.config;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.tiesheng.core.pojos.CurrentWebUser;
|
import com.tiesheng.core.pojos.RequestUserInfo;
|
||||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||||
import com.tiesheng.core.service.TieshengWebConfigurer;
|
import com.tiesheng.core.service.TieshengWebConfigurer;
|
||||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||||
@@ -19,7 +19,7 @@ public class DemoWebConfigurer implements TieshengWebConfigurer {
|
|||||||
GlobalConfig globalConfig;
|
GlobalConfig globalConfig;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CurrentWebUser getCurrentUserName(TokenBean tokenBean) {
|
public RequestUserInfo getCurrentUserName(TokenBean tokenBean) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-annotation</artifactId>
|
<artifactId>springboot-annotation</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-database</artifactId>
|
<artifactId>springboot-database</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-encrypt</artifactId>
|
<artifactId>springboot-encrypt</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-login</artifactId>
|
<artifactId>springboot-login</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-message</artifactId>
|
<artifactId>springboot-message</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-platform</artifactId>
|
<artifactId>springboot-platform</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-poi</artifactId>
|
<artifactId>springboot-poi</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-util</artifactId>
|
<artifactId>springboot-util</artifactId>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||||
<artifactId>springboot-parent</artifactId>
|
<artifactId>springboot-parent</artifactId>
|
||||||
<version>0.6.2</version>
|
<version>0.7.1</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>springboot-web</artifactId>
|
<artifactId>springboot-web</artifactId>
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.tiesheng.core.config.desensitize;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ClassUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.serializer.ValueFilter;
|
||||||
|
import com.tiesheng.annotation.desensitize.Desensitize;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 脱敏过滤类
|
||||||
|
*
|
||||||
|
* @author hao
|
||||||
|
*/
|
||||||
|
public class DesensitizeValueFilter implements ValueFilter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object process(Object object, String name, Object value) {
|
||||||
|
if (ObjectUtil.isEmpty(value) || !(value instanceof String)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Field field = ClassUtil.getDeclaredField(object.getClass(), name);
|
||||||
|
if (ObjectUtil.isEmpty(field)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
Desensitize desensitize = field.getAnnotation(Desensitize.class);
|
||||||
|
if (String.class != field.getType() || ObjectUtil.isEmpty(desensitize)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
String originVal = String.valueOf(value);
|
||||||
|
return StrUtil.hide(originVal, desensitize.prefix(),
|
||||||
|
StrUtil.length(originVal) - desensitize.suffix());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.tiesheng.core.config.desensitize;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.alibaba.fastjson.serializer.ValueFilter;
|
|
||||||
import com.tiesheng.annotation.desensitize.Desensitize;
|
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
public class ValueDesensitizeFilter implements ValueFilter {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object process(Object object, String name, Object value) {
|
|
||||||
if (ObjectUtil.isEmpty(value) || !(value instanceof String)) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
Field field = object.getClass().getDeclaredField(name);
|
|
||||||
Desensitize desensitize = field.getAnnotation(Desensitize.class);
|
|
||||||
if (String.class != field.getType() || ObjectUtil.isEmpty(desensitize)) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
String originVal = String.valueOf(value);
|
|
||||||
return StrUtil.hide(originVal, desensitize.prefix(), StrUtil.length(originVal) - desensitize.suffix());
|
|
||||||
} catch (NoSuchFieldException ignored) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,7 @@ package com.tiesheng.core.config.json;
|
|||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||||
import com.tiesheng.core.config.desensitize.ValueDesensitizeFilter;
|
import com.tiesheng.core.config.desensitize.DesensitizeValueFilter;
|
||||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -31,7 +31,7 @@ public class FastJsonMessageConverter {
|
|||||||
SerializerFeature.WriteNullStringAsEmpty,
|
SerializerFeature.WriteNullStringAsEmpty,
|
||||||
SerializerFeature.WriteEnumUsingName);
|
SerializerFeature.WriteEnumUsingName);
|
||||||
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
config.setDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
config.setSerializeFilters(new ValueDesensitizeFilter());
|
config.setSerializeFilters(new DesensitizeValueFilter());
|
||||||
|
|
||||||
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
|
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
|
||||||
fastConverter.setFastJsonConfig(config);
|
fastConverter.setFastJsonConfig(config);
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
package com.tiesheng.core.pojos;
|
package com.tiesheng.core.pojos;
|
||||||
|
|
||||||
public class CurrentWebUser {
|
/**
|
||||||
|
* 当前token的数据
|
||||||
|
*
|
||||||
|
* @author hao
|
||||||
|
*/
|
||||||
|
public class RequestUserInfo {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
@@ -6,7 +6,7 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.tiesheng.core.mapper.CoreLogLoginMapper;
|
import com.tiesheng.core.mapper.CoreLogLoginMapper;
|
||||||
import com.tiesheng.core.mapper.CoreLogMessageMapper;
|
import com.tiesheng.core.mapper.CoreLogMessageMapper;
|
||||||
import com.tiesheng.core.mapper.CoreLogOperationMapper;
|
import com.tiesheng.core.mapper.CoreLogOperationMapper;
|
||||||
import com.tiesheng.core.pojos.CurrentWebUser;
|
import com.tiesheng.core.pojos.RequestUserInfo;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||||
@@ -55,9 +55,9 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
|||||||
*/
|
*/
|
||||||
public void addOperationLog(String title, String subject, Object params) {
|
public void addOperationLog(String title, String subject, Object params) {
|
||||||
CoreLogOperation operation = new CoreLogOperation();
|
CoreLogOperation operation = new CoreLogOperation();
|
||||||
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName(TsTokenConfig.get());
|
RequestUserInfo requestUserInfo = tieshengWebConfigurer.getCurrentUserName(TsTokenConfig.get());
|
||||||
operation.setUserId(currentWebUser.getId());
|
operation.setUserId(requestUserInfo.getId());
|
||||||
operation.setUserName(currentWebUser.getName());
|
operation.setUserName(requestUserInfo.getName());
|
||||||
operation.setTitle(title);
|
operation.setTitle(title);
|
||||||
operation.setSubject(subject);
|
operation.setSubject(subject);
|
||||||
if (params != null) {
|
if (params != null) {
|
||||||
@@ -85,8 +85,8 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
|
|||||||
login.setUserId(platformUnique.getUserId());
|
login.setUserId(platformUnique.getUserId());
|
||||||
login.setPlatform(platformUnique.getPlatform());
|
login.setPlatform(platformUnique.getPlatform());
|
||||||
|
|
||||||
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName(tokenBean);
|
RequestUserInfo requestUserInfo = tieshengWebConfigurer.getCurrentUserName(tokenBean);
|
||||||
login.setUserName(currentWebUser.getName());
|
login.setUserName(requestUserInfo.getName());
|
||||||
|
|
||||||
login.setIp(ip);
|
login.setIp(ip);
|
||||||
login.setAddress(ip2regionConfig.search(login.getIp()));
|
login.setAddress(ip2regionConfig.search(login.getIp()));
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.tiesheng.core.service;
|
package com.tiesheng.core.service;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.tiesheng.core.mapper.CorePlatformUniqueMapper;
|
import com.tiesheng.core.mapper.CorePlatformUniqueMapper;
|
||||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||||
@@ -11,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hao
|
* @author hao
|
||||||
@@ -35,15 +33,12 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
|||||||
platformUnique.setUniqueId(loginInfo.getUnique());
|
platformUnique.setUniqueId(loginInfo.getUnique());
|
||||||
}
|
}
|
||||||
platformUnique.setInfo(loginInfo.getInfo());
|
platformUnique.setInfo(loginInfo.getInfo());
|
||||||
|
saveOrUpdate(platformUnique);
|
||||||
|
|
||||||
TokenBean tokenBean = tieshengWebConfigurer.loginConfigurer().doLogin(platformUnique, loginInfo.getTo());
|
TokenBean tokenBean = tieshengWebConfigurer.loginConfigurer().doLogin(platformUnique, loginInfo.getTo());
|
||||||
if (tokenBean != null) {
|
if (tokenBean != null) {
|
||||||
platformUnique.setUserId(tokenBean.getId());
|
|
||||||
platformUnique.setIsDeleted(0);
|
|
||||||
saveOrUpdate(platformUnique);
|
|
||||||
|
|
||||||
// 添加登录日志
|
// 添加登录日志
|
||||||
coreLogService.addLoginLog(platformUnique,tokenBean);
|
coreLogService.addLoginLog(platformUnique, tokenBean);
|
||||||
}
|
}
|
||||||
return tokenBean;
|
return tokenBean;
|
||||||
}
|
}
|
||||||
@@ -55,22 +50,18 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过平台和用户id查询
|
* 更新用户id
|
||||||
*
|
*
|
||||||
* @param platform
|
* @param uniqueId
|
||||||
* @param userIds
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<CorePlatformUnique> getByPlatformAndUser(String platform, List<String> userIds) {
|
public boolean updateUserId(String uniqueId, String userId) {
|
||||||
if (CollUtil.isEmpty(userIds)) {
|
return update(new UpdateWrapper<CorePlatformUnique>().eq("unique_id", uniqueId)
|
||||||
return CollUtil.newArrayList();
|
.set("user_id", userId)
|
||||||
}
|
.set("is_deleted", 0)
|
||||||
|
);
|
||||||
QueryWrapper<CorePlatformUnique> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.in("user_id", userIds);
|
|
||||||
queryWrapper.eq("platform", platform);
|
|
||||||
queryWrapper.last("limit 1");
|
|
||||||
return list(queryWrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.tiesheng.core.service;
|
package com.tiesheng.core.service;
|
||||||
|
|
||||||
import cn.hutool.log.LogFactory;
|
import cn.hutool.log.LogFactory;
|
||||||
import com.tiesheng.core.pojos.CurrentWebUser;
|
import com.tiesheng.core.pojos.RequestUserInfo;
|
||||||
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||||
import com.tiesheng.util.exception.ApiRespEnum;
|
import com.tiesheng.util.exception.ApiRespEnum;
|
||||||
@@ -22,7 +22,7 @@ public interface TieshengWebConfigurer {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CurrentWebUser getCurrentUserName(TokenBean userId);
|
RequestUserInfo getCurrentUserName(TokenBean userId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user