MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / ResetUserPasswordByEmail

Function ResetUserPasswordByEmail

model/user.go:501–511  ·  view source on GitHub ↗
(email string, password string)

Source from the content-addressed store, hash-verified

499}
500
501func ResetUserPasswordByEmail(email string, password string) error {
502 if email == "" || password == "" {
503 return errors.New("邮箱地址或密码为空!")
504 }
505 hashedPassword, err := common.Password2Hash(password)
506 if err != nil {
507 return err
508 }
509 err = DB.Model(&User{}).Where("email = ?", email).Update("password", hashedPassword).Error
510 return err
511}
512
513func IsAdmin(userId int) bool {
514 if userId == 0 {

Callers 1

ResetPasswordFunction · 0.92

Calls 2

Password2HashFunction · 0.92
UpdateMethod · 0.45

Tested by

no test coverage detected