mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-01 02:38:43 +08:00 
			
		
		
		
	兼容spring boot web 提供的上下文根路径的匹配
spring.servlet.content-path
This commit is contained in:
		| @@ -1,7 +1,6 @@ | |||||||
| package cn.iocoder.yudao.framework.web.core.util; | package cn.iocoder.yudao.framework.web.core.util; | ||||||
|  |  | ||||||
| import cn.hutool.core.util.NumberUtil; | import cn.hutool.core.util.NumberUtil; | ||||||
| import cn.hutool.core.util.StrUtil; |  | ||||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||||
| import cn.iocoder.yudao.framework.web.config.WebProperties; | import cn.iocoder.yudao.framework.web.config.WebProperties; | ||||||
| @@ -89,10 +88,10 @@ public class WebFrameworkUtils { | |||||||
|             return userType; |             return userType; | ||||||
|         } |         } | ||||||
|         // 2. 其次,基于 URL 前缀的约定 |         // 2. 其次,基于 URL 前缀的约定 | ||||||
|         if (request.getRequestURI().startsWith(properties.getAdminApi().getPrefix())) { |         if (request.getServletPath().startsWith(properties.getAdminApi().getPrefix())) { | ||||||
|             return UserTypeEnum.ADMIN.getValue(); |             return UserTypeEnum.ADMIN.getValue(); | ||||||
|         } |         } | ||||||
|         if (request.getRequestURI().startsWith(properties.getAppApi().getPrefix())) { |         if (request.getServletPath().startsWith(properties.getAppApi().getPrefix())) { | ||||||
|             return UserTypeEnum.MEMBER.getValue(); |             return UserTypeEnum.MEMBER.getValue(); | ||||||
|         } |         } | ||||||
|         return null; |         return null; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 苏云弘
					苏云弘