feat内部管理: 添加京东卡查勘页面

- 新增京东卡查勘账户和订单页面
- 实现京东卡查勘 token生成逻辑
- 添加页面路由
This commit is contained in:
danial
2025-03-31 22:15:36 +08:00
parent 2e97b0e1fa
commit a88468aac7
4 changed files with 83 additions and 0 deletions

View File

@@ -462,3 +462,43 @@ func (c *PageAuthController) StealRule() {
c.Data["portalHost"] = config.GetPortalHost()
c.TplName = "merchant/steal-rule.html"
}
func (c *PageAuthController) JdCardCkAccount() {
token := ""
// 获取当前时间的时间戳
currentTime := time.Now()
targetMinute := (currentTime.Minute() / 10) * 10
targetTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), currentTime.Hour(), targetMinute, 0, 0, currentTime.Location())
now := strconv.Itoa(int(targetTime.Unix()))
secretCfg := config.GetSecret()
tokenB, err := utils.AesCBCEncrypt([]byte(now), []byte(secretCfg.Key), []byte(secretCfg.IV))
if err == nil {
//base64编码
token = base64.URLEncoding.EncodeToString(tokenB)
}
c.Data["token"] = token
c.Data["portalHost"] = config.GetPortalHost()
c.TplName = "jd-ck/account.html"
}
func (c *PageAuthController) JdCardCkOrder() {
token := ""
// 获取当前时间的时间戳
currentTime := time.Now()
targetMinute := (currentTime.Minute() / 10) * 10
targetTime := time.Date(currentTime.Year(), currentTime.Month(), currentTime.Day(), currentTime.Hour(), targetMinute, 0, 0, currentTime.Location())
now := strconv.Itoa(int(targetTime.Unix()))
secretCfg := config.GetSecret()
tokenB, err := utils.AesCBCEncrypt([]byte(now), []byte(secretCfg.Key), []byte(secretCfg.IV))
if err == nil {
//base64编码
token = base64.URLEncoding.EncodeToString(tokenB)
}
c.Data["token"] = token
c.Data["portalHost"] = config.GetPortalHost()
c.TplName = "jd-ck/order.html"
}

View File

@@ -37,6 +37,9 @@ func init() {
beego.Router("/recharge-c-trip-account.html", &controllers.PageAuthController{}, "*:CTripAccountPage")
beego.Router("/recharge-c-trip-order.html", &controllers.PageAuthController{}, "*:CTripOrderPage")
beego.Router("/jd-card-ck-account.html", &controllers.PageAuthController{}, "*:JdCardCkAccount")
beego.Router("/jd-card-ck-order.html", &controllers.PageAuthController{}, "*:JdCardCkOrder")
beego.Router("/recharge-t-mall-game-account.html", &controllers.PageAuthController{}, "*:RechargeTMallGameAccountPage")
beego.Router("/recharge-t-mall-game-order.html", &controllers.PageAuthController{}, "*:RechargeTMallGameOrderPage")
beego.Router("/recharge-t-mall-game-shop-order.html", &controllers.PageAuthController{}, "*:RechargeTMallGameShopOrderPage")

19
views/jd-ck/account.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="zh">
<body>
<iframe src="">
</iframe>
</body>
<style>
iframe {
width: 100%;
height: 90vh;
}
</style>
<script>
// 构建链接
const url = "{{.portalHost}}" + "/iframe/AdminJdAccount?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>

21
views/jd-ck/order.html Normal file
View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="zh">
<body>
<iframe src="">
</iframe>
</body>
<style>
iframe {
width: 100%;
height: 90vh;
}
</style>
<script>
// 构建链接
const url = "{{.portalHost}}" + "/iframe/AdminJdOrder?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>