refactor(auth): replace dashboard sessions with stateless tokens and session control (#6329)

* refactor(auth): replace dashboard sessions with stateless tokens

* feat(auth): harden session issuance and distributed enforcement

* fix(proxy): preserve trusted proxy compatibility defaults

* refactor: address dashboard auth review feedback

* refactor: remove classic frontend and flatten web app
This commit is contained in:
Calcium-Ion
2026-07-20 16:48:43 +08:00
committed by GitHub
parent 5a6c53d496
commit 31d70fca39
1605 changed files with 17511 additions and 147913 deletions
+7 -7
View File
@@ -176,7 +176,7 @@ func SubscriptionEpayReturn(c *gin.Context) {
if c.Request.Method == "POST" {
// POST 请求:从 POST body 解析参数
if err := c.Request.ParseForm(); err != nil {
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail"))
return
}
params = lo.Reduce(lo.Keys(c.Request.PostForm), func(r map[string]string, t string, i int) map[string]string {
@@ -192,29 +192,29 @@ func SubscriptionEpayReturn(c *gin.Context) {
}
if len(params) == 0 {
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail"))
return
}
client := GetEpayClient()
if client == nil {
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail"))
return
}
verifyInfo, err := client.Verify(params)
if err != nil || !verifyInfo.VerifyStatus {
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail"))
return
}
if verifyInfo.TradeStatus == epay.StatusTradeSuccess {
LockOrder(verifyInfo.ServiceTradeNo)
defer UnlockOrder(verifyInfo.ServiceTradeNo)
if err := model.CompleteSubscriptionOrder(verifyInfo.ServiceTradeNo, common.GetJsonString(verifyInfo), model.PaymentProviderEpay, verifyInfo.Type); err != nil {
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=fail"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=fail"))
return
}
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=success"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=success"))
return
}
c.Redirect(http.StatusFound, paymentReturnPath("/console/topup?pay=pending"))
c.Redirect(http.StatusFound, paymentReturnPath("/wallet?pay=pending"))
}