fix: 前端树形按钮变更为右击显示,后端修复协程panic导致进程退出

This commit is contained in:
meilin.huang
2021-12-02 10:35:48 +08:00
parent d762d346e0
commit fb0fc274b4
10 changed files with 230 additions and 166 deletions

View File

@@ -117,6 +117,15 @@ func (d *Db) ExecSqlFile(rc *ctx.ReqCtx) {
dbId := GetDbId(g)
go func() {
defer func() {
if err := recover(); err != nil {
switch t := err.(type) {
case *biz.BizError:
d.MsgApp.CreateAndSend(rc.LoginAccount, ws.ErrMsg("sql脚本执行失败", fmt.Sprintf("[%s]执行失败: [%s]", filename, t.Error())))
}
}
}()
db := d.DbApp.GetDbInstance(dbId)
for _, sql := range sqls {
sql = strings.Trim(sql, " ")