🎨优化代码

This commit is contained in:
coward 2024-01-05 17:11:47 +08:00
parent 97774b303f
commit 2cf8d40c80

View File

@ -31,11 +31,11 @@ func NewWxHelper(host string, port uint) WxHelper {
// @param uri
// @return string
func (w *WxHelper) GetAddr(uri string) string {
if !strings.HasPrefix(w.Host, "http") && !strings.HasPrefix(w.Host, "https://") {
w.Host = fmt.Sprintf("http://%s", w.Host)
if !strings.HasPrefix(w.host, "http") && !strings.HasPrefix(w.host, "https://") {
w.host = fmt.Sprintf("http://%s", w.host)
}
return fmt.Sprintf("%s:%d%s", w.Host, w.Port, uri)
return fmt.Sprintf("%s:%d%s", w.host, w.port, uri)
}
// SetHook