update: used gormv2 to handle permission process

This commit is contained in:
zhangwenjian committed 2020-08-29 23:25:53 +08:00
1 parent d53ba4ed7a
commit 671291d024
10 files changed
+64 -55

No files matched your search

+4
View File
@@ -1,6 +1,8 @@
package tools
import (
"log"
"runtime"
"strconv"
"golang.org/x/crypto/bcrypt"
@@ -50,6 +52,8 @@ func HasError(err error, msg string, code ...int) {
if msg == "" {
msg = err.Error()
}
_, file, line, _ := runtime.Caller(1)
log.Printf("%s:%v",file, line)
panic("CustomError#" + strconv.Itoa(statusCode) + "#" + msg)
}
}