瀏覽代碼

修复bug

信 赵 5 年之前
父節點
當前提交
ef542c34cc

+ 7 - 2
pom.xml

@@ -52,7 +52,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 	</properties>
 	<dependencies>
-<!-- 如果使用的是mysql8.0需要使用8.0的驱动 -->	
+<!-- 如果使用的是mysql8.0需要使用8.0的驱动 -->
 <!--		<dependency>-->
 <!--			<groupId>mysql</groupId>-->
 <!--			<artifactId>mysql-connector-java</artifactId>-->
@@ -64,6 +64,11 @@
 		</dependency>
 		<dependency>
 			<groupId>net.mingsoft</groupId>
+			<artifactId>ms-basic</artifactId>
+			<version>1.0.23</version>
+		</dependency>
+		<dependency>
+			<groupId>net.mingsoft</groupId>
 			<artifactId>ms-upgrader</artifactId>
 		</dependency>
 	</dependencies>
@@ -288,4 +293,4 @@
 
 		<finalName>ms-mcms</finalName>
 	</build>
-</project>
+</project>

+ 3 - 1
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java

@@ -139,6 +139,7 @@ public class CmsParserUtil extends ParserUtil {
 					if (ParserUtil.hasMobileFile(column.getCategoryListUrl())) {
 						writer = new StringWriter();
 						mobileTemplate.process(null, writer);
+						parserParams.put(ParserUtil.MOBILE, BasicUtil.getApp().getAppMobileStyle());
 						tag = new TagParser(writer.toString(), parserParams);
 						// 将tag.getContent()写入路径
 						FileUtil.writeString(tag.rendering(), mobilePath, Const.UTF8);
@@ -170,6 +171,7 @@ public class CmsParserUtil extends ParserUtil {
 						if (ParserUtil.hasMobileFile(column.getCategoryListUrl())) {
 							writer = new StringWriter();
 							mobileTemplate.process(null, writer);
+							parserParams.put(ParserUtil.MOBILE, BasicUtil.getApp().getAppMobileStyle());
 							tag = new TagParser(writer.toString(),parserParams);
 							// 将tag.getContent()写入路径
 							FileUtil.writeString(tag.rendering(), mobilePath, Const.UTF8);
@@ -227,7 +229,7 @@ public class CmsParserUtil extends ParserUtil {
 			}
 
 			// 判断文件是否存在,若不存在弹出返回信息
-			if (!FileUtil.exist(ParserUtil.buildTempletPath(columnUrl))||StringUtils.isBlank(articleIdList.get(artId).getCategoryId())||articleIdList.get(artId).getCategoryType()==null) {
+			if (!FileUtil.exist(ParserUtil.buildTempletPath(columnUrl))||articleIdList.get(artId).getCategoryId()==null||articleIdList.get(artId).getCategoryType()==null) {
 				artId++;
 				continue;
 			}

+ 18 - 1
src/main/java/net/mingsoft/config/ShiroConfig.java

@@ -4,8 +4,10 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.shiro.mgt.SecurityManager;
+import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
 import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
 import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
+import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -20,6 +22,21 @@ public class ShiroConfig {
 	private String managerPath;
 
 	@Bean
+	public AuthorizationAttributeSourceAdvisor getAuthorizationAttributeSourceAdvisor(
+			DefaultWebSecurityManager securityManager) {
+		AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
+		advisor.setSecurityManager(securityManager);
+		return advisor;
+	}
+
+	@Bean
+	public DefaultAdvisorAutoProxyCreator getDefaultAdvisorAutoProxyCreator() {
+		DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator();
+		autoProxyCreator.setProxyTargetClass(true);
+		return autoProxyCreator;
+	}
+
+	@Bean
 	public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) {
 		ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
 		// 必须设置 SecurityManager
@@ -65,4 +82,4 @@ public class ShiroConfig {
 	public BaseAuthRealm customRealm() {
 		return new BaseAuthRealm();
 	}
-}
+}

+ 2 - 2
src/main/resources/application-dev.yml

@@ -2,6 +2,6 @@ spring:
   datasource:
     url: jdbc:mysql://localhost:3306/db-mcms-open?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
     username: root
-    password: root
+    password: 123456
     filters: wall,mergeStat
-    type: com.alibaba.druid.pool.DruidDataSource
+    type: com.alibaba.druid.pool.DruidDataSource

+ 2 - 2
src/main/webapp/WEB-INF/manager/cms/content/form.ftl

@@ -445,7 +445,7 @@
                 var that = this;
                 ms.http.get(ms.manager + "/cms/content/get.do", {"id": id}).then(function (res) {
                     if (res.result && res.data) {
-                        if (res.data.contentType) {
+                        if (res.data.contentType&&res.data.contentType!='') {
                             res.data.contentType = res.data.contentType.split(',');
                         }
                         else {
@@ -575,4 +575,4 @@
     #form {
         overflow: hidden;
     }
-</style>
+</style>

File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/static/plugins/babel-polyfill/7.8.3/polyfill.min.js


+ 20 - 0
src/main/webapp/static/plugins/ms/1.0.0/compatible.js

@@ -0,0 +1,20 @@
+if (typeof Object.assign != 'function') {
+    Object.assign = function(target) {
+        'use strict';
+        if (target == null) {
+            throw new TypeError('Cannot convert undefined or null to object');
+        }
+        target = Object(target);
+        for (var index = 1; index < arguments.length; index++) {
+            var source = arguments[index];
+            if (source != null) {
+                for (var key in source) {
+                    if (Object.prototype.hasOwnProperty.call(source, key)) {
+                        target[key] = source[key];
+                    }
+                }
+            }
+        }
+        return target;
+    };
+}

Some files were not shown because too many files changed in this diff