管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-26 394935af53da986ae1108b3d08022279781f8f34
1
已添加1个文件
已修改8个文件
59 ■■■■■ 文件已修改
src/main/java/com/lf/server/config/WebConfig.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/interceptor/AuthInterceptor.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/SignService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/all/SysService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/StyleService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/data/VerService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/BlacklistService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/DepService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/TokenService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/config/WebConfig.java
@@ -4,7 +4,7 @@
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import com.lf.server.interceptor.AuthInterceptor;
import com.lf.server.service.sys.TokenService;
import com.lf.server.service.all.SysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
@@ -21,7 +21,7 @@
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
    @Autowired
    private TokenService tokenService;
    private SysService sysService;
    /**
     * èŽ·å–æ‹¦æˆªå™¨å¯¹è±¡
@@ -29,7 +29,7 @@
     * @return
     */
    public AuthInterceptor getAuthBean() {
        return new AuthInterceptor(tokenService);
        return new AuthInterceptor(sysService);
    }
    /**
src/main/java/com/lf/server/interceptor/AuthInterceptor.java
@@ -5,6 +5,7 @@
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.helper.WebHelper;
import com.lf.server.service.all.SysService;
import com.lf.server.service.sys.TokenService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -22,7 +23,7 @@
 */
@Configuration
public class AuthInterceptor implements HandlerInterceptor {
    private TokenService tokenService;
    private SysService sysService;
    private static final Log log = LogFactory.getLog(AuthInterceptor.class);
@@ -34,8 +35,8 @@
    private static final String NO_AUTH = JSON.toJSONString(new ResponseMsg<String>(HttpStatus.NO_AUTH_ERROR, "无权限访问"));
    public AuthInterceptor(TokenService tokenService) {
        this.tokenService = tokenService;
    public AuthInterceptor(SysService sysService) {
        this.sysService = sysService;
    }
    /**
@@ -55,12 +56,15 @@
                return WebHelper.write2Page(response, NO_TOKEN);
            }
            UserEntity ue = tokenService.getCurrentUser(request);
            //String ip = WebHelper.getIpAddress(request);
            //List<String> blackList=
            UserEntity ue = sysService.tokenService.getCurrentUser(request);
            if (ue == null) {
                return WebHelper.write2Page(response, NO_LOGIN);
            }
            if (tokenService.isUidDisable(ue)) {
            if (sysService.tokenService.isUidDisable(ue)) {
                return WebHelper.write2Page(response, USER_LOCK);
            }
@@ -95,7 +99,7 @@
     * æ£€æŸ¥æƒé™
     */
    private boolean checkPerms(UserEntity ue, HttpServletRequest request) {
        List<String> list = tokenService.permsService.selectPerms(ue.getUid());
        List<String> list = sysService.permsService.selectPerms(ue.getUid());
        if (list == null || list.size() == 0) {
            return false;
        }
src/main/java/com/lf/server/service/all/SignService.java
@@ -25,7 +25,7 @@
 * ç­¾åæœåŠ¡ç±»
 * @author WWW
 */
@Service("sysService")
@Service
public class SignService {
    @Autowired
    PropertiesConfig propertiesConfig;
src/main/java/com/lf/server/service/all/SysService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package com.lf.server.service.all;
import com.lf.server.service.sys.BlacklistService;
import com.lf.server.service.sys.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * ç³»ç»ŸæœåŠ¡ç±»
 * @author WWW
 */
@Service
public class SysService {
    @Autowired
    public TokenService tokenService;
    @Autowired
    public RedisService redisService;
    @Autowired
    public PermsService permsService;
    @Autowired
    public BlacklistService blacklistService;
}
src/main/java/com/lf/server/service/data/StyleService.java
@@ -13,7 +13,6 @@
 * @author sws
 * @date 2022-09-26
 */
@Service
public class StyleService implements StyleMapper {
    @Autowired
src/main/java/com/lf/server/service/data/VerService.java
@@ -12,7 +12,6 @@
 * @author sws
 * @date 2022-09-29
 */
@Service
public class VerService implements VerMapper {
    @Autowired
src/main/java/com/lf/server/service/sys/BlacklistService.java
@@ -1,6 +1,5 @@
package com.lf.server.service.sys;
import com.lf.server.entity.all.MenusAuthEntity;
import com.lf.server.entity.all.RedisCacheKey;
import com.lf.server.entity.all.SettingData;
import com.lf.server.entity.sys.BlacklistEntity;
src/main/java/com/lf/server/service/sys/DepService.java
@@ -12,7 +12,6 @@
 * @author sws
 * @date   2022-09-23
 */
@Service
public class DepService implements DepMapper {
    @Autowired
src/main/java/com/lf/server/service/sys/TokenService.java
@@ -8,7 +8,6 @@
import com.lf.server.helper.StringHelper;
import com.lf.server.helper.WebHelper;
import com.lf.server.mapper.sys.TokenMapper;
import com.lf.server.service.all.PermsService;
import com.lf.server.service.all.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -37,10 +36,7 @@
    LoginService loginService;
    @Autowired
    public RedisService redisService;
    @Autowired
    public  PermsService permsService;
    RedisService redisService;
    @Override
    public Integer selectCount(String name, Integer type) {