update
This commit is contained in:
parent
7a52d87558
commit
1ecfd00433
|
@ -1,5 +1,8 @@
|
|||
package com.ydool.boot.api.filter;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ydool.boot.common.result.Ret;
|
||||
import com.ydool.boot.core.exception.ResultException;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
@ -32,9 +35,9 @@ public class ReferInterceptor implements HandlerInterceptor {
|
|||
|
||||
String requestRefer = request.getHeader("Referer");
|
||||
System.out.println("------------------------------>refer:" + requestRefer);
|
||||
// if (requestRefer == null || (StrUtil.isNotBlank(refer) && !requestRefer.contains(refer))) {
|
||||
// throw new ResultException(Ret.fail("非法访问!"));
|
||||
// }
|
||||
if (requestRefer == null || (StrUtil.isNotBlank(refer) && !requestRefer.contains(refer))) {
|
||||
throw new ResultException(Ret.fail("非法访问!"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue