MCPcopy Index your code
hub / github.com/TruthHun/BookStack / LoginedBindWechat

Method LoginedBindWechat

controllers/api/CommonController.go:57–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57func (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
80func (this *CommonController) LoginBindWechat() {
81 form := &WechatBindForm{}

Callers

nothing calls this directly

Calls 5

loginMethod · 0.95
NewMemberFunction · 0.92
PasswordVerifyFunction · 0.92
GetByUsernameMethod · 0.80
ResponseMethod · 0.80

Tested by

no test coverage detected