管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-12 9b4ea2631cc800c376116ed97aca11c8fac956d8
1
已修改16个文件
80 ■■■■■ 文件已修改
src/main/java/com/lf/server/entity/all/SettingData.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/DictEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/DirEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/StyleEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/data/VerEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/AuthEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/DepEntity.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/LoginEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/MenuEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/ResEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/RoleEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/sys/TokenEntity.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/Md5Helper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/PathHelper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/helper/WebHelper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/service/sys/TokenService.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/lf/server/entity/all/SettingData.java
@@ -6,27 +6,37 @@
 */
public class SettingData {
    /**
     * 排除路径:"/druid/",
     * 访问排除路径
     */
    public static String[] EXCLUDE_PATH = new String[]{"/swagger", "/sign/", "/proxy"};
    /**
     * 自动登出时间
     */
    public static Integer AUTO_LOGOUT = 15;
    public static int AUTO_LOGOUT = 15;
    /**
     * 令牌有效期
     */
    public static Integer TOKEN_EXPIRE = 240;
    public static int TOKEN_EXPIRE = 240;
    /**
     * 缓存有效期
     */
    public static Integer CACHE_EXPIRE = 240;
    public static int CACHE_EXPIRE = 240;
    /**
     * 最大文件数
     */
    public static int MAX_FILES = 2000;
    /**
     * Cookie有效期
     */
    public static int COOKIE_MAX_AGE = 4 * 60 * 60;
    /**
     * 附件大小
     */
    public static Integer MAX_FILE_SIZE = 20 * 1024 * 1024;
    public static long MAX_FILE_SIZE = 20 * 1024 * 1024;
}
src/main/java/com/lf/server/entity/data/DictEntity.java
@@ -10,7 +10,6 @@
 */
public class DictEntity implements Serializable {
    private static final long serialVersionUID = -343890141066128689L;
    private int id;
src/main/java/com/lf/server/entity/data/DirEntity.java
@@ -17,7 +17,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class DirEntity implements Serializable {
    private static final long serialVersionUID = -2184993363389504088L;
    private int id;
src/main/java/com/lf/server/entity/data/StyleEntity.java
@@ -10,7 +10,6 @@
 */
public class StyleEntity implements Serializable {
    private static final long serialVersionUID = 2421229801055033955L;
    private int id;
src/main/java/com/lf/server/entity/data/VerEntity.java
@@ -9,7 +9,6 @@
 * @date 2022-09-29
 */
public class VerEntity implements Serializable {
    private static final long serialVersionUID = 4765222572551658531L;
    private int id;
src/main/java/com/lf/server/entity/sys/AuthEntity.java
@@ -9,7 +9,6 @@
 * @date 2022-09-28
 */
public class AuthEntity implements Serializable {
    private static final long serialVersionUID = 2590447372444367285L;
    private int id;
src/main/java/com/lf/server/entity/sys/DepEntity.java
@@ -17,7 +17,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class DepEntity implements Serializable {
    private static final long serialVersionUID = -3673810416800666364L;
    private int id;
@@ -36,7 +35,7 @@
    private String contact;
    private String fax ;
    private String fax;
    private String email;
@@ -48,7 +47,7 @@
    private int orderNum;
    private int  createUser;
    private int createUser;
    private Timestamp createTime;
src/main/java/com/lf/server/entity/sys/LoginEntity.java
@@ -10,7 +10,6 @@
 */
public class LoginEntity implements Serializable {
    private static final long serialVersionUID = 2156194736679188516L;
    private int id;
src/main/java/com/lf/server/entity/sys/MenuEntity.java
@@ -17,7 +17,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class MenuEntity implements Serializable {
    private static final long serialVersionUID = -4174396918804003518L;
    private int id;
src/main/java/com/lf/server/entity/sys/ResEntity.java
@@ -14,7 +14,6 @@
@AllArgsConstructor
@NoArgsConstructor
public class ResEntity implements Serializable {
    private static final long serialVersionUID = 9047079519693255710L;
    private int id;
src/main/java/com/lf/server/entity/sys/RoleEntity.java
@@ -9,7 +9,6 @@
 * @date 2022-09-29
 */
public class RoleEntity implements Serializable {
    private static final long serialVersionUID = -1738125301491645446L;
    private int id;
src/main/java/com/lf/server/entity/sys/TokenEntity.java
@@ -9,7 +9,6 @@
 * @date 2022-09-28
 */
public class TokenEntity implements Serializable {
    private static final long serialVersionUID = 1419309705830103150L;
    private int id;
src/main/java/com/lf/server/helper/Md5Helper.java
@@ -10,11 +10,11 @@
 * @author WWW
 */
public class Md5Helper {
    private final static int M3 = 3;
    private final static int M16 = 16;
    private final static int M48 = 48;
    private final static int M3 = 3;
    /**
     * 生成含有随机盐的密码
src/main/java/com/lf/server/helper/PathHelper.java
@@ -1,6 +1,7 @@
package com.lf.server.helper;
import com.lf.server.config.PropertiesConfig;
import com.lf.server.entity.all.SettingData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -14,8 +15,6 @@
public class PathHelper {
    @Autowired
    private PropertiesConfig config;
    private static int MAX_FILES = 2000;
    private static int importPath = 1;
@@ -66,7 +65,7 @@
            }
            File[] files = file.listFiles();
            if (files.length < MAX_FILES) {
            if (files.length < SettingData.MAX_FILES) {
                return subPath;
            }
src/main/java/com/lf/server/helper/WebHelper.java
@@ -1,5 +1,6 @@
package com.lf.server.helper;
import com.lf.server.entity.all.SettingData;
import com.lf.server.entity.all.StaticData;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -147,7 +148,7 @@
    public static void saveCookie(String key, String value, HttpServletResponse response) {
        Cookie cookie = new Cookie(key, value);
        // 设置cookie失效时间,单位为秒
        cookie.setMaxAge(4 * 60 * 60);
        cookie.setMaxAge(SettingData.COOKIE_MAX_AGE);
        cookie.setHttpOnly(false);
        cookie.setPath("/");
        //cookie.setDomain("*")
@@ -195,7 +196,7 @@
    /**
     * 根据键获取Cookie值
     */
    public static String getCookieByKey(String key,HttpServletRequest request) {
    public static String getCookieByKey(String key, HttpServletRequest request) {
        Cookie[] cookies = request.getCookies();
        if (cookies == null || cookies.length == 0) {
            return null;
src/main/java/com/lf/server/service/sys/TokenService.java
@@ -1,5 +1,6 @@
package com.lf.server.service.sys;
import com.lf.server.entity.all.SettingData;
import com.lf.server.entity.sys.LoginEntity;
import com.lf.server.entity.sys.TokenEntity;
import com.lf.server.entity.sys.UserEntity;
@@ -39,12 +40,12 @@
    @Override
    public Integer selectCount(String name, Integer type) {
        return tokenMapper.selectCount(name,type);
        return tokenMapper.selectCount(name, type);
    }
    @Override
    public List<TokenEntity> selectByPage(String name, Integer type, Integer limit, Integer offset) {
        return tokenMapper.selectByPage(name,type, limit, offset);
        return tokenMapper.selectByPage(name, type, limit, offset);
    }
    @Override
@@ -94,32 +95,21 @@
    /**
     * 获取新的令牌实体类
     *
     * @param userid
     * @param req
     * @return
     */
    public TokenEntity getNewToken(int userid, HttpServletRequest req) {
        int duration = 240;
        TokenEntity te = new TokenEntity();
        te.setToken(WebHelper.getGuid());
        te.setDuration(duration);
        te.setExpire(WebHelper.getTimestamp(duration));
        te.setDuration(SettingData.TOKEN_EXPIRE);
        te.setExpire(WebHelper.getTimestamp(SettingData.TOKEN_EXPIRE));
        te.setType(0);
        te.setIp(WebHelper.getIpAddress(req));
        te.setCreateUser(userid);
        return te;
    }
    /**
     * 是/否登录
     *
     * @param req
     * @param res
     * @return
     */
    public Boolean isLogin(HttpServletRequest req, HttpServletResponse res) {
        String token = WebHelper.getToken(req);
@@ -145,10 +135,6 @@
    /**
     * 登出
     *
     * @param token
     * @param req
     * @return
     */
    public Boolean logout(String token, HttpServletRequest req, HttpServletResponse res) {
        TokenEntity te = getEntityByToken(token);
@@ -187,9 +173,6 @@
    /**
     * 根据令牌获取实体
     *
     * @param token
     * @return
     */
    public TokenEntity getEntityByToken(String token) {
        if (StringHelper.isNull(token)) {
@@ -215,10 +198,6 @@
    /**
     * 保存token
     *
     * @param te
     * @param req
     * @param res
     */
    public void saveToken(UserEntity ue, TokenEntity te, HttpServletRequest req, HttpServletResponse res) {
        // 保存至Cookie