正在显示
1 个修改的文件
包含
1 行增加
和
12 行删除
@@ -94,17 +94,6 @@ class Index extends Api | @@ -94,17 +94,6 @@ class Index extends Api | ||
94 | */ | 94 | */ |
95 | public function senWxmsgToAgentUser($titdesc="", $remark="") | 95 | public function senWxmsgToAgentUser($titdesc="", $remark="") |
96 | { | 96 | { |
97 | - $appid = 'wxb7dd0c03865a94e0'; | ||
98 | - $appsecret = '6af75a6fb8211da45631630e34769f82'; | ||
99 | - $code = $_GET['code']; // 从回调URL中获取code参数 | ||
100 | - | ||
101 | -// 获取access_token | ||
102 | - $token_url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=$appid&secret=$appsecret&code=$code&grant_type=authorization_code"; | ||
103 | - $token_json = file_get_contents($token_url); | ||
104 | - $token_array = json_decode($token_json, true); | ||
105 | - print_r($token_array);return; | ||
106 | - | ||
107 | - | ||
108 | $wxopenid="ojyUX6oNFoQMqoCd1JWtfwQs-CeA"; | 97 | $wxopenid="ojyUX6oNFoQMqoCd1JWtfwQs-CeA"; |
109 | $sendInfo = array( | 98 | $sendInfo = array( |
110 | 'first' => array('value' => urlencode($titdesc), 'color' => "#743A3A"), | 99 | 'first' => array('value' => urlencode($titdesc), 'color' => "#743A3A"), |
@@ -149,7 +138,7 @@ class Index extends Api | @@ -149,7 +138,7 @@ class Index extends Api | ||
149 | ); | 138 | ); |
150 | 139 | ||
151 | $json_template = json_encode($template); | 140 | $json_template = json_encode($template); |
152 | - $url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" . $access_token; | 141 | + $url = "https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=" . $access_token; |
153 | $json = $this->http_request($url, urldecode($json_template)); | 142 | $json = $this->http_request($url, urldecode($json_template)); |
154 | print_r($json);return; | 143 | print_r($json);return; |
155 | 144 |
-
请 注册 或 登录 后发表评论