This commit is contained in:
麒麟
2023-09-11 22:05:19 +08:00
parent c7bb6c85e7
commit 63adb1653a
7 changed files with 272 additions and 30 deletions

View 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;
}
}