feat(user): add customer user login log page

- Added new route for customer user login log page
- Created login log HTML template with iframe integration
- Implemented controller method to generate token and portal host for iframe
- Updated navigation menu to include link to customer user login log
- Renamed menu item text for better clarity
This commit is contained in:
danial
2025-11-14 22:46:24 +08:00
parent 82f5fa8500
commit 5550070ac8
4 changed files with 33 additions and 1 deletions

View File

@@ -212,6 +212,17 @@ func (c *PageAuthController) UserManagement() {
c.TplName = "user/management.html"
}
func (c *PageAuthController) UserLoginLog() {
userID, _ := c.GetSession("userID").(string)
// 获取当前时间的时间戳
ctx := c.Ctx.Request.Context()
tokenService := service.NewTokenService()
c.Data["token"] = tokenService.GetToken(ctx, userID)
c.Data["portalHost"] = config.GetPortalHost()
c.Data["roadUid"] = c.GetString("roadUid")
c.TplName = "user/login-log.html"
}
func (c *PageAuthController) RechargeAppleOrderPage() {
userID, _ := c.GetSession("userID").(string)
ctx := c.Ctx.Request.Context()

View File

@@ -22,6 +22,7 @@ func init() {
beego.Router("/merchant_v2.html", &controllers.PageAuthController{}, "*:MerchantV2Page")
beego.Router("/customerUserManagement.html", &controllers.PageAuthController{}, "*:UserManagement")
beego.Router("/customer-user-management.html", &controllers.PageAuthController{}, "*:UserLoginLog")
beego.Router("/order-summary-info.html", &controllers.PageAuthController{}, "*:OrderSummary")
beego.Router("/recharge-apple-card-account.html", &controllers.PageAuthController{}, "*:RechargeAppleAccountPage")

View File

@@ -295,7 +295,8 @@
<div class="second-menu">
<a href="#" onclick='loadMainContent("/merchant.html")'><span>商户配置</span></a>
<a href="#" onclick='loadMainContent("/merchant_v2.html")'><span>商户配置(V2)</span></a>
<a href="#" onclick='loadMainContent("/customerUserManagement.html")'>供销客户管理</a>
<a href="#" onclick='loadMainContent("/customerUserManagement.html")'>供销客户</a>
<a href="#" onclick='loadMainContent("/customer-user-log.html")'>供销客户登录日志</a>
<!-- 判断是否展示偷卡配置-->
{{if .showStealConfig}}
<a href="#" onclick='loadMainContent("/steal-rule.html")'>规则配置</a>

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