mirror of https://gitee.com/y_project/RuoYi.git
修复批量生成代码异常问题
parent
b8b49209ca
commit
e55a42c21f
|
@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.ruoyi.common.support.Convert;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||||
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
|
import com.ruoyi.framework.aspectj.lang.constant.BusinessType;
|
||||||
import com.ruoyi.framework.web.controller.BaseController;
|
import com.ruoyi.framework.web.controller.BaseController;
|
||||||
|
@ -77,8 +77,7 @@ public class GenController extends BaseController
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
||||||
{
|
{
|
||||||
String[] tableNames = new String[] {};
|
String[] tableNames = Convert.toStrArray(tables);
|
||||||
tableNames = JSON.parseArray(tables).toArray(tableNames);
|
|
||||||
byte[] data = genService.generatorCode(tableNames);
|
byte[] data = genService.generatorCode(tableNames);
|
||||||
response.reset();
|
response.reset();
|
||||||
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$.modal.confirm("确认要生成选中的" + rows.length + "条数据吗?", function() {
|
$.modal.confirm("确认要生成选中的" + rows.length + "条数据吗?", function() {
|
||||||
location.href = prefix + "/batchGenCode?tables=" + JSON.stringify(rows);
|
location.href = prefix + "/batchGenCode?tables=" + rows;
|
||||||
layer.msg('执行成功,正在生成代码请稍后…', { icon: 1 });
|
layer.msg('执行成功,正在生成代码请稍后…', { icon: 1 });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue