This commit is contained in:
xl
2023-11-14 12:39:28 +08:00
parent c3326a9b5a
commit f92fdab692
15 changed files with 245 additions and 272 deletions
+5 -5
View File
@@ -225,15 +225,15 @@ class Message extends SmallProgram
}
/**
* @param $filePath
* @param $type
* @param string $filePath
* @param string $type
* @param bool $isPermanent
* @param string $title
* @param string $introduction
* @return mixed
* @throws Exception
*/
public function upload($filePath, $type, bool $isPermanent = false, string $title = '', string $introduction = ''): Result
public function uploadFile(string $filePath, string $type, bool $isPermanent = false, string $title = '', string $introduction = ''): Result
{
if (!file_exists($filePath)) {
throw new Exception('文件不存在');
@@ -253,7 +253,7 @@ class Message extends SmallProgram
if ($isPermanent && $mime == 'video/mp3') {
$data = ['media' => $real_path, 'description[title]' => $title, 'description[introduction]' => $introduction];
}
return $this->post($url, $data);
return $this->post('api.weixin.qq.com', $url, $data);
}
@@ -273,6 +273,6 @@ class Message extends SmallProgram
private function sendKefuMsg()
{
$url = '/cgi-bin/message/custom/send?access_token=' . $this->payConfig->getAccessToken();
return $this->post($url, $this->msgData);
return $this->post('api.weixin.qq.com', $url, $this->msgData);
}
}