mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-18 01:06:39 +08:00
chore: use config value for order pay timeout
This commit is contained in:
parent
b8e0d7760b
commit
061291cebb
@ -83,7 +83,7 @@ func (h *PaymentHandler) DoPay(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查二维码是否过期
|
||||
if time.Now().Unix()-int64(t) > 30 {
|
||||
if time.Now().Unix()-int64(t) > int64(h.App.SysConfig.OrderPayTimeout) {
|
||||
resp.ERROR(c, "支付二维码已过期,请重新生成!")
|
||||
return
|
||||
}
|
||||
@ -342,6 +342,8 @@ func (h *PaymentHandler) Mobile(c *gin.Context) {
|
||||
payWay = PayWayXunHu
|
||||
notifyURL = h.App.Config.HuPiPayConfig.NotifyURL
|
||||
returnURL = h.App.Config.HuPiPayConfig.ReturnURL
|
||||
parse, _ := url.Parse(h.App.Config.HuPiPayConfig.ReturnURL)
|
||||
baseURL := fmt.Sprintf("%s://%s", parse.Scheme, parse.Host)
|
||||
params := payment.HuPiPayReq{
|
||||
Version: "1.1",
|
||||
TradeOrderId: orderNo,
|
||||
@ -351,6 +353,7 @@ func (h *PaymentHandler) Mobile(c *gin.Context) {
|
||||
ReturnURL: returnURL,
|
||||
CallbackURL: returnURL,
|
||||
WapName: "极客学长",
|
||||
WapUrl: baseURL,
|
||||
Type: "WAP",
|
||||
}
|
||||
r, err := h.huPiPayService.Pay(params)
|
||||
|
@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"geekai/utils"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func main() {
|
||||
text := "https://nk.img.r9it.com/chatgpt-plus/1712709360012445.png 请简单描述一下这幅图上的内容 "
|
||||
imgURL := utils.ExtractImgURL(text)
|
||||
fmt.Println(imgURL)
|
||||
text := "https://nk.img.r9it.com/chatgpt-plus/1712709360012445.png"
|
||||
parse, _ := url.Parse(text)
|
||||
fmt.Println(fmt.Sprintf("%s://%s", parse.Scheme, parse.Host))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user