31 lines
539 B
Go
31 lines
539 B
Go
package user
|
|
|
|
import (
|
|
"f5"
|
|
"main/constant"
|
|
"main/common"
|
|
"main/model"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type UserApi struct {
|
|
}
|
|
|
|
func (this *UserApi) Login(c *gin.Context) {
|
|
s := c.MustGet(constant.SESSION_KEY).(common.Session)
|
|
if s == nil {
|
|
return
|
|
}
|
|
user := new(model.User)
|
|
var count int64 = 0
|
|
if f5.GetApp().GetOrmDb(constant.WHEEL_DB).Table(user.TableName()).Take(user,
|
|
"account_id = ?", s.GetAccountId()).Count(&count); count < 1 {
|
|
c.JSON(200, gin.H{
|
|
"code": 2,
|
|
"message": "mailid不存在",
|
|
})
|
|
return
|
|
}
|
|
|
|
}
|