Multi users data [1/N]

Signed-off-by: Yuan Si <do4suki@gmail.com>
This commit is contained in:
2023-04-12 16:05:24 +08:00
parent fe1e012127
commit dd2da649c1
15 changed files with 1501 additions and 225 deletions
+9 -1
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"honoka-chan/database"
"honoka-chan/encrypt"
"honoka-chan/tools"
"honoka-chan/utils"
"io"
"net/http"
@@ -318,8 +319,13 @@ func AccountLoginHandler(ctx *gin.Context) {
defer stmt.Close()
var pass, autokey, ticket, userid string
err = stmt.QueryRow(phone).Scan(&pass, &autokey, &ticket, &userid)
rows, err := stmt.Query(phone)
CheckErr(err)
defer rows.Close()
for rows.Next() {
err = rows.Scan(&pass, &autokey, &ticket, &userid)
CheckErr(err)
}
loginResp := LoginResp{}
loginCode := 0
@@ -372,6 +378,8 @@ func AccountLoginHandler(ctx *gin.Context) {
panic(err)
}
tools.InitUserData(int(loginTime))
// Login Response
loginResp.Autokey = autokey
loginResp.HasRealInfo = 1