Browse Source

fix:#786

修复:生成表后无法回滚的bug
修复:api页面不能多删除的bug
main
蒋吉兆 3 years ago
parent
commit
53f0e83687
  1. 2
      server/service/system/sys_api.go
  2. 2
      server/service/system/sys_autocode_history.go
  3. 2
      web/src/view/superAdmin/api/api.vue

2
server/service/system/sys_api.go

@ -149,5 +149,5 @@ func (apiService *ApiService) DeleteApisByIds(ids request.IdsReq) (err error) {
} }
func (apiService *ApiService) DeleteApiByIds(ids []string) (err error) { func (apiService *ApiService) DeleteApiByIds(ids []string) (err error) {
return global.GVA_DB.Delete(system.SysApi{}, ids).Error
return global.GVA_DB.Delete(&system.SysApi{}, "id in ?", ids).Error
} }

2
server/service/system/sys_autocode_history.go

@ -125,5 +125,5 @@ func (autoCodeHistoryService *AutoCodeHistoryService) GetSysHistoryPage(info req
// DeletePage 删除历史数据 // DeletePage 删除历史数据
func (autoCodeHistoryService *AutoCodeHistoryService) DeletePage(id uint) error { func (autoCodeHistoryService *AutoCodeHistoryService) DeletePage(id uint) error {
return global.GVA_DB.Delete(system.SysAutoCodeHistory{}, id).Error
return global.GVA_DB.Delete(&system.SysAutoCodeHistory{}, id).Error
} }

2
web/src/view/superAdmin/api/api.vue

@ -211,7 +211,7 @@ export default {
this.apis = val this.apis = val
}, },
async onDelete() { async onDelete() {
const ids = this.apis.forEach(item => item.ID)
const ids = this.apis.map(item => item.ID)
const res = await deleteApisByIds({ ids }) const res = await deleteApisByIds({ ids })
if (res.code === 0) { if (res.code === 0) {
this.$message({ this.$message({

Loading…
Cancel
Save