Skip to content

Commit

Permalink
修复设置相对路径无效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcium-Ion committed Oct 14, 2024
1 parent ad38862 commit d8c8810
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion epay/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package epay

import (
"net/url"
"path"

"github.com/mitchellh/mapstructure"
)
Expand Down Expand Up @@ -48,10 +49,11 @@ func (c *Client) Purchase(args *PurchaseArgs) (string, map[string]string, error)
"sign": "",
}

u, err := c.BaseUrl.Parse(PurchaseUrl)
u, err := url.Parse(c.BaseUrl.String())
if err != nil {
return "", nil, err
}
u.Path = path.Join(u.Path, PurchaseUrl)

return u.String(), GenerateParams(requestParams, c.Config.Key), nil
}
Expand Down

0 comments on commit d8c8810

Please sign in to comment.