Commit e72f88a2 authored by killfen's avatar killfen

Merge branch 'master' of https://git.oschina.net/mingSoft/MCMS.git

Conflicts:
	src/main/java/com/mingsoft/basic/action/AppAction.java
parents 83c95d79 8fbe0fb7
......@@ -314,7 +314,6 @@ public class ManagerAction extends BaseAction {
this.outJson(response, ModelCode.ROLE, false, getResString("err.exist",this.getResString("managerName")));
return;
}
System.out.println("============" + managerBiz.countManagerName(manager.getManagerName()));
//验证表单
if (!this.checkForm(manager, response)) {
return;
......
......@@ -769,7 +769,7 @@ public class GeneraterAction extends BaseAction {
//获取应用实体信息
AppEntity app = this.getApp(request);
//组织主页预览地址
String indexPosition = app.getAppHostUrl() + File.separator + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator + position;
String indexPosition = app.getAppHostUrl() + (app.getAppHostUrl().lastIndexOf("/")>-1?"":File.separator) + IParserRegexConstant.HTML_SAVE_PATH + File.separator + app.getAppId() + File.separator + position;
return "redirect:" + indexPosition;
}
......
......@@ -291,7 +291,10 @@ public class TempletsAction extends BaseAction {
List<String> fileNameList = new ArrayList<String>();
for (int i = 0; i < files.length; i++) {
File currFile = files[i];
String temp = currFile.getPath().replace(this.getRealPath(request, ""),"").replace(IParserRegexConstant.REGEX_SAVE_TEMPLATE+Const.SEPARATOR+this.getAppId(request)+Const.SEPARATOR, "");
String filter = IParserRegexConstant.REGEX_SAVE_TEMPLATE+"/"+this.getAppId(request)+"/";
String temp = currFile.getPath().replace(this.getRealPath(request, ""),"").replace(filter, "");
filter = IParserRegexConstant.REGEX_SAVE_TEMPLATE+"\\"+this.getAppId(request)+"\\";
temp = temp.replace(filter, "");
if(currFile.isDirectory()){
folderNameList.add(temp);
}else {
......@@ -321,6 +324,7 @@ public class TempletsAction extends BaseAction {
model.addAttribute("fileContent", FileUtil.readFile(this.getRealPath(request, fileName)));
}
model.addAttribute("name",new File(this.getRealPath(request, fileName)).getName());
model.addAttribute("fileName", fileName);
model.addAttribute("fileNamePrefix", fileName.substring(0,fileName.lastIndexOf(File.separator)+1));
return "/manager/cms/templets/templets_edit_file";
......
......@@ -13,7 +13,12 @@
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:property-placeholder location="classpath:config.properties" />
<context:component-scan
base-package="com.mingsoft.**.biz.impl,com.mingsoft.**.aop,com.**.parser">
</context:component-scan>
<!-- 打开aop 注解 -->
<aop:aspectj-autoproxy proxy-target-class="true" />
<!-- 自动扫描controller包下的所有类,使其认为spring mvc的控制器 -->
<context:component-scan base-package="com.mingsoft.**.action" />
<mvc:annotation-driven conversion-service="conversionService" />
......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
">
<context:property-placeholder location="classpath:config.properties" />
<context:component-scan
base-package="com.mingsoft.**.biz.impl,com.mingsoft.**.aop,com.**.parser">
</context:component-scan>
<!-- 打开aop 注解 -->
<aop:aspectj-autoproxy proxy-target-class="true" />
</beans>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<display-name>mybatis</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml,classpath:spring-mybatis.xml,classpath:spring-shiro.xml</param-value>
<param-value>classpath:spring-mvc.xml,classpath:spring-mybatis.xml,classpath:spring-shiro.xml</param-value>
</context-param>
<filter>
<description>字符集过滤器</description>
......@@ -60,8 +60,6 @@
</welcome-file-list>
<!-- 配置session超时时间,单位分钟 -->
<error-page>
<error-code>404</error-code>
<location>/error/404.do</location>
......
<@ms.html5>
<@ms.nav title="编辑模版文件" back=true>
<@ms.savebutton id="update" value="修改"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="form" id="editFileForm">
<!--文件名称-->
<@ms.text label="文件名称" value="${name}" readonly="readonly"/>
<@ms.hidden value="${fileName}" name="fileName" />
<!--文件内容-->
<@ms.textarea name="fileContent" label="文件内容" wrap="Soft" rows="21" size="" value="${fileContent}"/>
<@ms.hidden id="fileName" value="${fileName}" />
<@ms.hidden id="fileNamePrefix" value="${fileNamePrefix}" />
</@ms.form>
</@ms.panel>
</@ms.html5>
<script type="text/javascript">
$(function () {
//修改文件
$("#update").on("click",function(){
var formData = $("#editFileForm").serialize();
var URL="${base}/manager/cms/templet/writeFileContent.do"
var oldFileName = $("#fileName").val();
var fileNamePrefix = $("#fileNamePrefix").val();
$(this).text("修改中");
$(this).attr("disabled",true);
$(this).request({url:URL,type:"json",method:"post",data:formData+"&oldFileName="+oldFileName+"&fileNamePrefix="+fileNamePrefix,func:function(msg) {
//回调处理方式
if(msg.result){
alert("修改模版文件成功");
} else {
alert("修改模版文件失败");
}
var fileNameUrl = $(".fileNamePrefix").val();
$("#update").text("修改");
$("#update").attr("disabled",false);
//location.href = base+"/manager/cms/templet/showChildFileAndFolder.do?skinFolderName=" + fileNameUrl;
}});
});
});
</script>
<@ms.html5>
<@ms.nav title="编辑模版文件" back=true>
<@ms.savebutton id="update" value="修改"/>
</@ms.nav>
<@ms.panel>
<@ms.form name="form" id="editFileForm">
<!--文件名称-->
<@ms.text label="文件名称" value="${name?default('')}" readonly="readonly"/>
<@ms.hidden value="${fileName}" name="fileName" />
<!--文件内容-->
<@ms.textarea name="fileContent" label="文件内容" wrap="Soft" rows="21" size="" value="${fileContent}"/>
<@ms.hidden id="fileName" value="${fileName}" />
<@ms.hidden id="fileNamePrefix" value="${fileNamePrefix}" />
</@ms.form>
</@ms.panel>
</@ms.html5>
<script type="text/javascript">
$(function () {
//修改文件
$("#update").on("click",function(){
var formData = $("#editFileForm").serialize();
var URL="${base}/manager/cms/templet/writeFileContent.do"
var oldFileName = $("#fileName").val();
var fileNamePrefix = $("#fileNamePrefix").val();
$(this).text("修改中");
$(this).attr("disabled",true);
$(this).request({url:URL,type:"json",method:"post",data:formData+"&oldFileName="+oldFileName+"&fileNamePrefix="+fileNamePrefix,func:function(msg) {
//回调处理方式
if(msg.result){
alert("修改模版文件成功");
} else {
alert("修改模版文件失败");
}
var fileNameUrl = $(".fileNamePrefix").val();
$("#update").text("修改");
$("#update").attr("disabled",false);
//location.href = base+"/manager/cms/templet/showChildFileAndFolder.do?skinFolderName=" + fileNameUrl;
}});
});
});
</script>
......@@ -12,7 +12,7 @@
<td style="width:35%" class="name">${fileName}</td>
<td class="text-center type"></td>
<td style="width:10%;text-align:center">
<a class="btn btn-xs tooltips deleteIcon" data-toggle="tooltip" data-title="templets/${websiteId}/${fileName}" data-original-title="删除">
<a class="btn btn-xs tooltips deleteIcon" data-toggle="tooltip" data-title="${fileName}" data-original-title="删除">
<i class="glyphicon glyphicon-trash" style="color:#428BCA"></i>
</a>
<a class="btn btn-xs tooltips editFileBtn" data-toggle="tooltip" data-title="templets/${websiteId}/${fileName}" data-original-title="编辑">
......
......@@ -36,7 +36,7 @@
<p class="gform-box" style="margin-bottom:0px">
<input type="hidden" name="isImgCode" value="true" />
<input class="gbtxt" id="rand_code" maxlength="4" style="width: 259px;" name="rand_code" placeholder="验证码" type="text" value="" />
<img id="yzmimg" class="ms-w32 ms-h16" style="position: relative;top: 9px;height:26px;width:86px;" src="/code" onclick="this.src='/code?t='+new Date().getTime()"/>
<img id="yzmimg" class="ms-w32 ms-h16" style="position: relative;top: 9px;height:26px;width:86px;" src="{ms:global.host/}/code" onclick="this.src='{ms:global.host/}/code?t='+new Date().getTime()"/>
</p>
<div class="infor-tips"></div>
<p class="gform-box">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment