fix代码生成导入表问题
This commit is contained in:
parent
75bcc57608
commit
6b5ceafcdf
@ -160,14 +160,13 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
throw new CustomException("表不能为空");
|
||||
}
|
||||
string[] tableNames = tables.Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||
string userName = User.Identity.Name;
|
||||
|
||||
int result = 0;
|
||||
foreach (var tableName in tableNames)
|
||||
{
|
||||
var tabInfo = _CodeGeneraterService.GetTableInfo(dbName, tableName);
|
||||
if (tabInfo != null)
|
||||
{
|
||||
GenTable genTable = CodeGeneratorTool.InitTable(dbName, userName, tableName, tabInfo?.Description);
|
||||
GenTable genTable = CodeGeneratorTool.InitTable(dbName, HttpContext.GetName(), tableName, tabInfo?.Description);
|
||||
genTable.TableId = GenTableService.ImportGenTable(genTable);
|
||||
|
||||
if (genTable.TableId > 0)
|
||||
@ -179,13 +178,12 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
GenTableColumnService.DeleteGenTableColumnByTableName(tableName);
|
||||
GenTableColumnService.InsertGenTableColumn(genTableColumns);
|
||||
genTable.Columns = genTableColumns;
|
||||
|
||||
return SUCCESS(genTable);
|
||||
result++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ToResponse(ResultCode.FAIL, "生成失败");
|
||||
return ToResponse(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -215,8 +215,8 @@ export default {
|
||||
},
|
||||
/** 关闭按钮 */
|
||||
close() {
|
||||
this.$store.dispatch("tagsView/delView", this.$route);
|
||||
this.$router.push({ path: "/tool/gen", query: { t: Date.now() } });
|
||||
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
},
|
||||
/**
|
||||
* 排序保存
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user