feat: 添加京东页面链接

This commit is contained in:
danial
2024-10-22 23:18:39 +08:00
parent b90a962ec0
commit 88ad9cf2ad
6 changed files with 98 additions and 4 deletions

View File

@@ -9,6 +9,10 @@ type BaseController struct {
beego.Controller
}
type PageAuthController struct {
beego.Controller
}
func (c *BaseController) GenerateJSON(dataJSON interface{}) {
c.Data["json"] = dataJSON
_ = c.ServeJSON()
@@ -29,10 +33,6 @@ func (c *BaseController) Prepare() {
}
}
type PageAuthController struct {
beego.Controller
}
func (c *PageAuthController) Prepare() {
userID, ok := c.GetSession("userID").(string)
if !ok || userID == "" {

View File

@@ -143,6 +143,42 @@ func (c *PageAuthController) RechargeTMallGameOrderPage() {
c.TplName = "t-mall-game/recharge-order.html"
}
func (c *PageAuthController) JDOrderPage() {
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-card/order.html"
}
func (c *PageAuthController) JDAccountPage() {
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-card/account.html"
}
func (c *PageAuthController) RechargeTMallGameShopOrderPage() {
token := ""
// 获取当前时间的时间戳

View File

@@ -28,6 +28,9 @@ func init() {
beego.Router("/recharge-apple-card-order.html", &controllers.PageAuthController{}, "*:RechargeAppleOrderPage")
beego.Router("/card-user-management.html", &controllers.PageAuthController{}, "*:StealOrderPage")
beego.Router("/recharge-jd-account.html", &controllers.PageAuthController{}, "*:JDAccountPage")
beego.Router("/recharge-jd-order.html", &controllers.PageAuthController{}, "*:JDOrderPage")
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")

View File

@@ -348,6 +348,21 @@
</a>
</div>
</div>
<div>
<a href="#" class="first-menu">
<span class="glyphicon glyphicon-user"></span>
<span class="first-title">京东充值管理</span>
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
</a>
<div class="second-menu">
<a href="#" onclick='loadMainContent("/recharge-jd-account.html")'>
<span>账号管理</span>
</a>
<a href="#" onclick='loadMainContent("/recharge-jd-order.html")'>
<span>订单管理</span>
</a>
</div>
</div>
<!-- <div>-->
<!-- <a href="#" class="first-menu">-->
<!-- <span class="glyphicon glyphicon-console"></span>-->

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/JDAccount?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>

21
views/jd-card/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/JDOrder?token={{.token}}";
// 链接添加至到iframe中
document.getElementsByTagName("iframe")[0].src = url;
</script>
</html>