34 lines
607 B
Go
34 lines
607 B
Go
package user_center
|
|
|
|
import (
|
|
"context"
|
|
"kami/internal/dao"
|
|
"kami/internal/model/entity"
|
|
)
|
|
|
|
type sUserCenter struct {
|
|
}
|
|
|
|
func (c *sUserCenter) Login(ctx context.Context, userInfo entity.User) (err error) {
|
|
// 登录
|
|
var resUserInfo *entity.User
|
|
err = dao.User.Ctx(ctx).
|
|
Where(dao.User.Columns().Username, userInfo.Username).
|
|
WhereOr(dao.User.Columns().Phone, userInfo.Phone).Scan(&resUserInfo)
|
|
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
if resUserInfo.Id == "" {
|
|
return
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
func (c *sUserCenter) checkPassword(oldPassword, newPassword string) {
|
|
// 检查新密码和旧密码是不是想同
|
|
}
|
