()
| 55 | } |
| 56 | |
| 57 | func (this *CommonController) LoginedBindWechat() { |
| 58 | username := this.GetString("username") //username or email |
| 59 | password := this.GetString("password") |
| 60 | member, err := models.NewMember().GetByUsername(username) |
| 61 | |
| 62 | if err != nil { |
| 63 | if err == orm.ErrNoRows { |
| 64 | this.Response(http.StatusBadRequest, messageUsernameOrPasswordError) |
| 65 | } |
| 66 | beego.Error(err) |
| 67 | this.Response(http.StatusInternalServerError, messageInternalServerError) |
| 68 | } |
| 69 | if err != nil { |
| 70 | beego.Error(err) |
| 71 | this.Response(http.StatusInternalServerError, messageInternalServerError) |
| 72 | } |
| 73 | if ok, _ := utils.PasswordVerify(member.Password, password); !ok { |
| 74 | beego.Error(err) |
| 75 | this.Response(http.StatusBadRequest, messageUsernameOrPasswordError) |
| 76 | } |
| 77 | this.login(member) |
| 78 | } |
| 79 | |
| 80 | func (this *CommonController) LoginBindWechat() { |
| 81 | form := &WechatBindForm{} |
nothing calls this directly
no test coverage detected