Pārlūkot izejas kodu

修改生产环境配置及修复富文本上传图片问题

ljx 5 mēneši atpakaļ
vecāks
revīzija
e6ad828802

+ 23 - 22
src/main/java/cc/iteachyou/cms/interceptor/UserAuthorizationInterceptor.java

@@ -37,28 +37,29 @@ public class UserAuthorizationInterceptor implements HandlerInterceptor{
 
 		System system = systemService.getSystem();
 
-		String referer = request.getHeader("referer");
-		if(StrUtil.isNotBlank(referer)) {
-			if (!referer.startsWith(system.getWebsite())) {
-				throw new UnauthorizedException("访问来源不合法");
-			}
-
-			if (referer.startsWith("http://cms.iteachyou.cc/") || referer.startsWith("https://cms.iteachyou.cc/")) {
-				if (handler instanceof HandlerMethod) {
-					HandlerMethod handlerMethod = (HandlerMethod) handler;
-					Log annotation = handlerMethod.getMethodAnnotation(Log.class);
-					if (annotation == null) {
-						return Boolean.TRUE;
-					}
-					OperatorType operType = annotation.operType();
-					if (!OperatorType.PAGE.equals(operType) && !OperatorType.SELECT.equals(operType) && !OperatorType.OTHER.equals(operType)) {
-						throw new UnauthorizedException("演示环境不允许操作");
-					}
-				}
-			}
-		}else{
-			throw new UnauthorizedException("访问来源不合法");
-		}
+//		String referer = request.getHeader("referer");
+//		if(StrUtil.isNotBlank(referer)) {
+//			if (!referer.startsWith(system.getWebsite())) {
+//				throw new UnauthorizedException("访问来源不合法");
+//			}
+//
+//			//if (referer.startsWith("http://localhost/") || referer.startsWith("https://localhost/")) {
+//			if (referer.startsWith("http://localhost:8888/") ) {
+//				if (handler instanceof HandlerMethod) {
+//					HandlerMethod handlerMethod = (HandlerMethod) handler;
+//					Log annotation = handlerMethod.getMethodAnnotation(Log.class);
+//					if (annotation == null) {
+//						return Boolean.TRUE;
+//					}
+//					OperatorType operType = annotation.operType();
+//					if (!OperatorType.PAGE.equals(operType) && !OperatorType.SELECT.equals(operType) && !OperatorType.OTHER.equals(operType)) {
+//						throw new UnauthorizedException("演示环境不允许操作");
+//					}
+//				}
+//			}
+//		}else{
+//			throw new UnauthorizedException("访问来源不合法");
+//		}
 		log.info("UserAuthorizationInterceptor:["+token+"]拦截通过...");
 		return Boolean.TRUE;
 	}

+ 4 - 4
src/main/resources/application-prd.yml

@@ -2,20 +2,20 @@ server:
   port: 8889
 
 web:
-  resource-path: /opt/resources/cms.iteachyou.cc/
+  resource-path: /opt/resources/samore/
 
 spring: 
   datasource: 
     name: prd
     url: jdbc:mysql://127.0.0.1:3306/dreamer-cms?serverTimezone=GMT%2B8&useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
     username: root
-    password: root3306!
+    password: Samore1129++
     driver-class-name: com.mysql.cj.jdbc.Driver
   redis:
     host: 127.0.0.1
     port: 6379
     timeout: 2000
-    password: U^i*M73\!FoL1TgFX
+    password: foobared
     jedis:
       pool:
         max-idle: 100
@@ -24,6 +24,6 @@ spring:
 
 # 日志配置
 logging:
-  path: /opt/resources/cms.iteachyou.cc/logs/
+  path: /opt/resources/samore/logs/
   level:
     root: info