Fix a fatal bug.

This commit is contained in:
zicla
2018-07-26 01:35:16 +08:00
parent 9e9e548026
commit ed72eeee2d
2 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,10 @@ func (this *UserDao) FindByUuid(uuid string) *User {
//按照Id查询用户,找不到抛panic
func (this *UserDao) CheckByUuid(uuid string) *User {
if uuid == "" {
panic("uuid必须指定")
}
// Read
var user *User = &User{}
db := this.context.DB.Where(&User{Base: Base{Uuid: uuid}}).First(user)