Overhaul [1/n]

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2026-01-29 02:42:28 +08:00
parent 989acd6ff1
commit c77241a883
2267 changed files with 7158 additions and 5583 deletions
@@ -0,0 +1,33 @@
package account
import (
"encoding/base64"
"honoka-chan/internal/router"
"honoka-chan/internal/schema/ghome"
"honoka-chan/internal/session"
"github.com/gin-gonic/gin"
"github.com/go-think/openssl"
)
func reportRole(ctx *gin.Context) {
ss := session.New(ctx)
defer ss.Finalize()
randKey := ss.GetRandKey()
token := `{"message":"ok"}`
encryptedToken, err := openssl.Des3ECBEncrypt([]byte(token), randKey[0:24], openssl.PKCS7_PADDING)
if ss.CheckErr(err) {
return
}
ss.Respond(ghome.ReportRoleResp{
Code: 0,
Msg: "ok",
Data: base64.StdEncoding.EncodeToString(encryptedToken),
})
}
func init() {
router.AddHandler("v1", "POST", "/account/reportRole", reportRole)
}