add
This commit is contained in:
36
src/main/java/com/demo/Interceptor.java
Normal file
36
src/main/java/com/demo/Interceptor.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.demo;
|
||||
|
||||
import com.utils.Utils;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import javax.servlet.http.*;
|
||||
|
||||
public class Interceptor implements HandlerInterceptor {
|
||||
@Override
|
||||
public boolean preHandle(
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
Object handler) throws Exception {
|
||||
|
||||
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
request.setCharacterEncoding("utf-8");
|
||||
|
||||
if(
|
||||
(Utils.getPeoperties("aliNotifyUrl")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("appid")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("private_key")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("public_key")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("pwd")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("dburl")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("dbport")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("dbname")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("dbusername")+"").replace("null","").trim().length()<1
|
||||
|| (Utils.getPeoperties("dbpassword")+"").replace("null","").trim().length()<1
|
||||
){
|
||||
response.sendRedirect("./install.html");
|
||||
return false;
|
||||
}else return true;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user