♻️ 后台链接改为后台配置
🐛 修复配置链接 🐛 修复配置链接 🐛 修复配置链接 ♻️ 后台链接改为后台配置 ♻️ 后台链接改为后台配置 🐛 修复配置链接 🐛 修复配置链接
This commit is contained in:
@@ -24,6 +24,9 @@ db = 10
|
||||
[gateway]
|
||||
host = http://localhost:12309/
|
||||
|
||||
[portal]
|
||||
host = http://localhost:12400/
|
||||
|
||||
[testExtraLink]
|
||||
; 测试连接
|
||||
host = http://localhost:12305
|
||||
|
||||
@@ -19,6 +19,11 @@ func GetGatewayHost() string {
|
||||
return host
|
||||
}
|
||||
|
||||
func GetPortalHost() string {
|
||||
host, _ := web.AppConfig.String("portal::host")
|
||||
return host
|
||||
}
|
||||
|
||||
func GetRedisConfig() (*RedisConfig, error) {
|
||||
// 获取redis配置
|
||||
redisConfig := &RedisConfig{}
|
||||
|
||||
@@ -3,6 +3,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"boss/config"
|
||||
"boss/service"
|
||||
"boss/utils"
|
||||
"encoding/base64"
|
||||
"strconv"
|
||||
@@ -18,11 +19,11 @@ type PageController struct {
|
||||
func (c *PageController) Index() {
|
||||
c.TplName = "index.html"
|
||||
testExtraLink, err := web.AppConfig.String("testExtraLink::host")
|
||||
|
||||
if err != nil {
|
||||
testExtraLink = "http://127.0.0.1:12305"
|
||||
}
|
||||
|
||||
roadList := service.QueryRoad()
|
||||
c.Data["roadList"] = roadList
|
||||
c.Data["extraAddr"] = testExtraLink
|
||||
}
|
||||
|
||||
@@ -82,6 +83,7 @@ func (c *PageAuthController) MerchantV2Page() {
|
||||
token = base64.URLEncoding.EncodeToString(tokenB)
|
||||
}
|
||||
c.Data["token"] = token
|
||||
c.Data["portalHost"] = config.GetPortalHost()
|
||||
c.TplName = "merchant_v2.html"
|
||||
}
|
||||
|
||||
@@ -99,6 +101,7 @@ func (c *PageAuthController) RechargeAppleAccountPage() {
|
||||
token = base64.URLEncoding.EncodeToString(tokenB)
|
||||
}
|
||||
c.Data["token"] = token
|
||||
c.Data["portalHost"] = config.GetPortalHost()
|
||||
c.TplName = "apple-card/account.html"
|
||||
}
|
||||
|
||||
@@ -116,6 +119,7 @@ func (c *PageAuthController) OrderSummary() {
|
||||
token = base64.URLEncoding.EncodeToString(tokenB)
|
||||
}
|
||||
c.Data["token"] = token
|
||||
c.Data["portalHost"] = config.GetPortalHost()
|
||||
c.TplName = "order_summary.html"
|
||||
}
|
||||
|
||||
@@ -135,6 +139,7 @@ func (c *PageAuthController) RechargeAppleOrderPage() {
|
||||
token = base64.URLEncoding.EncodeToString(tokenB)
|
||||
}
|
||||
c.Data["token"] = token
|
||||
c.Data["portalHost"] = config.GetPortalHost()
|
||||
c.TplName = "apple-card/recharge-order.html"
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"boss/datas"
|
||||
"boss/models/order"
|
||||
"boss/models/payfor"
|
||||
"boss/models/road"
|
||||
"boss/models/user"
|
||||
"boss/utils/mfa"
|
||||
"fmt"
|
||||
@@ -279,14 +280,16 @@ func QueryTodaySummary(params map[string]string) order.Summary {
|
||||
|
||||
func ValidTotp(accountUid, totpCode string) bool {
|
||||
userInfo := user.GetUserInfoByUserID(accountUid)
|
||||
|
||||
if userInfo.Id == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
if userInfo.OtpSecret == "" {
|
||||
return true
|
||||
}
|
||||
|
||||
return mfa.ValidCode(totpCode, userInfo.OtpSecret)
|
||||
}
|
||||
|
||||
func QueryRoad() []road.RoadInfo {
|
||||
roadInfoList := road.GetAllRoad(map[string]string{})
|
||||
return roadInfoList
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</style>
|
||||
<script>
|
||||
// 构建链接
|
||||
const url = "http://" + window.location.hostname + ":12400" + "/iframe/appleAccount?token={{.token}}";
|
||||
const url = "{{.portalHost}}" + "/iframe/appleAccount?token={{.token}}";
|
||||
// 链接添加至到iframe中
|
||||
document.getElementsByTagName("iframe")[0].src = url;
|
||||
</script>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</style>
|
||||
<script>
|
||||
// 构建链接
|
||||
const url = "http://" + window.location.hostname + ":12400" + "/iframe/rechargeOrder?token={{.token}}";
|
||||
const url = "{{.portalHost}}" + "/iframe/rechargeOrder?token={{.token}}";
|
||||
// 链接添加至到iframe中
|
||||
document.getElementsByTagName("iframe")[0].src = url;
|
||||
</script>
|
||||
|
||||
@@ -344,20 +344,23 @@
|
||||
<a href="#" onclick='loadMainContent("/account_history.html")'><span>资金流水</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{range.roadList}}
|
||||
<div>
|
||||
<a href="#" class="first-menu">
|
||||
<span class="glyphicon glyphicon-book"></span>
|
||||
<span class="first-title">订单管理</span>
|
||||
<span class="first-title">订单管理({{RoadName}})</span>
|
||||
<span class="glyphicon glyphicon-plus last-glyphicon"></span>
|
||||
</a>
|
||||
<div class="second-menu">
|
||||
<a href="#" onclick='loadMainContent("/order_info.html")'><span>实时订单</span></a>
|
||||
<a href="#" onclick='loadMainContent("/order_profit.html")'><span>订单收益</span></a>
|
||||
<a href="#" onclick='loadMainContent("/order-summary-info.html")'><span>订单汇总</span></a>
|
||||
<a href="#"
|
||||
onclick='loadMainContent("/order_info.html?roadId={{{RoadUid}}")'><span>实时订单</span></a>
|
||||
<a href="#"
|
||||
onclick='loadMainContent("/order_profit.html?roadId={{{RoadUid}}")'><span>订单收益</span></a>
|
||||
<a href="#"
|
||||
onclick='loadMainContent("/order-summary-info.html?roadId={{{RoadUid}}")'><span>订单汇总</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
<div>
|
||||
<a href="#" class="first-menu">
|
||||
<span class="glyphicon glyphicon-piggy-bank"></span>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</style>
|
||||
<script>
|
||||
// 构建链接
|
||||
const url = "http://" + window.location.hostname + ":12400" + "/iframe/merchantConfig?token={{.token}}";
|
||||
const url = "{{.portalHost}}" + "/iframe/merchantConfig?token={{.token}}";
|
||||
// 链接添加至到iframe中
|
||||
document.getElementsByTagName("iframe")[0].src = url;
|
||||
</script>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</style>
|
||||
<script>
|
||||
// 构建链接
|
||||
const url = "http://" + window.location.hostname + ":12400" + "/iframe/orderSummary?token={{.token}}";
|
||||
const url = "{{.portalHost}}" + "/iframe/orderSummary?token={{.token}}";
|
||||
// 链接添加至到iframe中
|
||||
document.getElementsByTagName("iframe")[0].src = url;
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user