refactor(conf): 重构配置文件并添加偷卡配置开关

- 注释掉 Redis 会话提供者配置
- 更新 MySQL 和 Redis 主机地址为本地
- 添加 showStealConfig 配置项并设置为 false
- 移除 testExtraLink 配置节
This commit is contained in:
danial
2025-01-25 23:11:19 +08:00
parent f336ccfa44
commit 8f793aecd6
3 changed files with 27 additions and 16 deletions

View File

@@ -3,22 +3,22 @@ httpport = 12306
runmode = dev
HTTPAddr = 0.0.0.0
sessionon = true
sessionprovider = redis
; sessionprovider = redis
sessiongcmaxlifetime = 86400
sessioncookielifetime = 86400
sessionProviderConfig = redis:6379,100,astaxie
; sessionProviderConfig = 117.0.0.1:6379,100,astaxie
showStealConfig = false
[mysql]
dbhost = mysql
dbhost = 127.0.0.1
dbport = 3306
dbuser = root
dbpasswd = 123456
dbbase = kami
[redis]
host = redis
host = 127.0.0.1
port = 6379
password = ''
db = 10
[gateway]
@@ -27,10 +27,6 @@ host = http://kami_gateway:12309/
[portal]
host = http://127.0.0.1:12400
[testExtraLink]
; 测试连接
host = http://127.0.0.1:12305
[secret]
key = thisis32bitlongpassphraseimusing
iv = 1234567890123456

View File

@@ -17,15 +17,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["showStealConfig"] = web.AppConfig.DefaultBool("showStealConfig", true)
c.Data["title"] = web.AppConfig.DefaultString("baseSettings::subtitle", "聚合支付管理系统")
c.Data["extraAddr"] = testExtraLink
c.TplName = "index.html"
}
func (c *PageController) LoginPage() {
@@ -405,5 +401,21 @@ func (c *PageAuthController) AgentProfitPage() {
}
func (c *PageAuthController) StealRule() {
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 = "merchant/steal-rule.html"
}

View File

@@ -311,7 +311,10 @@
<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("/steal-rule.html")'>偷卡配置</a>-->
<!-- 判断是否展示偷卡配置-->
{{if .showStealConfig}}
<a href="#" onclick='loadMainContent("/steal-rule.html")'>偷卡配置</a>
{{end}}
<!-- <a href="#" onclick='loadMainContent("/card-user-management.html")'>卡片配置管理</a>-->
</div>
</div>