Commit b3f42ba4 by fengshuonan

修复modularName为空生成代码错误的问题

parent fac01647
......@@ -14,6 +14,7 @@ import cn.stylefeng.guns.generator.modular.service.TableService;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import cn.stylefeng.roses.core.reqres.response.SuccessResponseData;
import cn.stylefeng.roses.core.util.HttpContext;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -165,7 +166,12 @@ public class GeneratorController {
contextParam.setJdbcUserName(databaseInfo.getUserName());
contextParam.setJdbcPassword(databaseInfo.getPassword());
contextParam.setJdbcUrl(databaseInfo.getJdbcUrl());
contextParam.setModularName(modularName);
//处理modularName,如果modularName传值不为空,则待上左斜杠路径
if (ToolUtil.isNotEmpty(modularName)) {
modularName = "/" + modularName;
contextParam.setModularName(modularName);
}
//获取临时目录
long fileName = IdWorker.getId();
......
......@@ -23,7 +23,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@RequestMapping("/${lowerEntity}")
public class ${entity}Controller extends BaseController {
private String PREFIX = "/${context.modularName}/${lowerEntity}";
private String PREFIX = "${context.modularName}/${lowerEntity}";
@Autowired
private ${entity}Service ${lowerEntityService};
......
@layout("/common/_container.html",{js:["/assets/${context.modularName}/${lowerEntity}/${lowerEntity}.js"]}){
@layout("/common/_container.html",{js:["/assets${context.modularName}/${lowerEntity}/${lowerEntity}.js"]}){
<div class="layui-body-header">
<span class="layui-body-header-title">${tableComment}管理</span>
......
@layout("/common/_container.html",{js:["/assets/${context.modularName}/${lowerEntity}/${lowerEntity}_add.js"]}){
@layout("/common/_container.html",{js:["/assets${context.modularName}/${lowerEntity}/${lowerEntity}_add.js"]}){
<div class="layui-body-header">
<span class="layui-body-header-title">添加</span>
......
@layout("/common/_container.html",{js:["/assets/${context.modularName}/${lowerEntity}/${lowerEntity}_edit.js"]}){
@layout("/common/_container.html",{js:["/assets${context.modularName}/${lowerEntity}/${lowerEntity}_edit.js"]}){
<div class="layui-body-header">
<span class="layui-body-header-title">修改</span>
......
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