Abort requests when session transactions cannot start
Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
|
||||
func getCode(ctx *gin.Context) {
|
||||
ss := session.Attach(ctx)
|
||||
if ss.Done() {
|
||||
return
|
||||
}
|
||||
defer ss.FinalizeOrRollback()
|
||||
|
||||
codeArray := `{"codeArray":[{"btntext":"好的","code":"-10264022","msg_from":2,"text":"","title":"短信验证码被阻止","type":1},{"btntext":"","code":"-10869623","msg_from":2,"text":"","title":"网络连接失败,无法一键登录","type":2},{"btntext":"","code":"10298300","msg_from":2,"text":"","title":"","type":3},{"btntext":"","code":"10298311","msg_from":2,"text":"","title":"","type":3},{"btntext":"","code":"10298312","msg_from":2,"text":"","title":"","type":3},{"btntext":"","code":"10298313","msg_from":2,"text":"","title":"","type":1},{"btntext":"","code":"10298321","msg_from":2,"text":"","title":"","type":3},{"btntext":"","code":"10298322","msg_from":2,"text":"","title":"","type":3}],"codeVersion":"1.0.5"}`
|
||||
|
||||
Reference in New Issue
Block a user