File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,11 @@ func SolveCaptcha(c *gin.Context) {
129129}
130130
131131func FetchQrCode (c * gin.Context ) {
132+ if bot .Cli != nil && bot .Cli .Online {
133+ c .String (http .StatusBadRequest , "already online" )
134+ return
135+ }
136+
132137 log .Infof ("开始初始化设备信息" )
133138 bot .InitDevice (0 )
134139 log .Infof ("设备信息 %+v" , string (client .SystemDeviceInfo .ToJson ()))
@@ -153,18 +158,18 @@ func FetchQrCode(c *gin.Context) {
153158}
154159
155160func QueryQRCodeStatus (c * gin.Context ) {
161+ if bot .Cli != nil && bot .Cli .Online {
162+ c .String (http .StatusBadRequest , "already online" )
163+ return
164+ }
165+
156166 req := & dto.QueryQRCodeStatusReq {}
157167 err := c .Bind (req )
158168 if err != nil {
159169 c .String (http .StatusBadRequest , fmt .Sprintf ("failed to bind, %+v" , err ))
160170 return
161171 }
162172
163- if bot .Cli .Online {
164- c .String (http .StatusBadRequest , "already online" )
165- return
166- }
167-
168173 queryQRCodeStatusResp , err := bot .Cli .QueryQRCodeStatus (req .Sig )
169174 if err != nil {
170175 c .String (http .StatusInternalServerError , fmt .Sprintf ("failed to query qrcode status, %+v" , err ))
You can’t perform that action at this time.
0 commit comments