This commit is contained in:
Ray.Hao
2025-03-01 00:16:28 +08:00
3 changed files with 6 additions and 9 deletions

View File

@@ -2,15 +2,12 @@ package com.youlai.boot.core.security.exception;
import com.youlai.boot.common.result.ResultCode; import com.youlai.boot.common.result.ResultCode;
import com.youlai.boot.common.util.ResponseUtils; import com.youlai.boot.common.util.ResponseUtils;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import jakarta.servlet.ServletException; import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import java.io.IOException; import java.io.IOException;

View File

@@ -188,7 +188,7 @@ public class JwtTokenManager implements TokenManager {
* *
* @param authentication 认证信息 * @param authentication 认证信息
* @param ttl 过期时间 * @param ttl 过期时间
* @return * @return JWT Token
*/ */
private String generateToken(Authentication authentication, int ttl) { private String generateToken(Authentication authentication, int ttl) {

View File

@@ -241,13 +241,13 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
MenuTypeEnum menuType = menuForm.getType(); MenuTypeEnum menuType = menuForm.getType();
if (menuType == MenuTypeEnum.CATALOG) { // 如果是外链 if (menuType == MenuTypeEnum.CATALOG) { // 如果是目录
String path = menuForm.getRoutePath(); String path = menuForm.getRoutePath();
if (menuForm.getParentId() == 0 && !path.startsWith("/")) { if (menuForm.getParentId() == 0 && !path.startsWith("/")) {
menuForm.setRoutePath("/" + path); // 一级目录需以 / 开头 menuForm.setRoutePath("/" + path); // 一级目录需以 / 开头
} }
menuForm.setComponent("Layout"); menuForm.setComponent("Layout");
} else if (menuType == MenuTypeEnum.EXTLINK) { // 如果是目录 } else if (menuType == MenuTypeEnum.EXTLINK) { // 如果是外链
menuForm.setComponent(null); menuForm.setComponent(null);
} }