Commit ad1b4dbd by Mark

修复生成代码报异常

parent 73f2c5fc
......@@ -51,12 +51,8 @@ public class SysGeneratorController {
* 生成代码
*/
@RequestMapping("/code")
public void code(HttpServletRequest request, HttpServletResponse response) throws IOException{
String[] tableNames = new String[]{};
String tables = request.getParameter("tables");
tableNames = JSON.parseArray(tables).toArray(tableNames);
byte[] data = sysGeneratorService.generatorCode(tableNames);
public void code(String tables, HttpServletResponse response) throws IOException{
byte[] data = sysGeneratorService.generatorCode(tables.split(","));
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=\"renren.zip\"");
......
......@@ -54,7 +54,7 @@ var vm = new Vue({
if(tableNames == null){
return ;
}
location.href = "sys/generator/code?tables=" + JSON.stringify(tableNames);
location.href = "sys/generator/code?tables=" + tableNames.join();
}
}
});
......
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