@@ -110,21 +110,22 @@ class Wechat
110110 const MEDIA_VIDEO_UPLOAD = '/media/uploadvideo? ' ;
111111 const OAUTH_PREFIX = 'https://open.weixin.qq.com/connect/oauth2 ' ;
112112 const OAUTH_AUTHORIZE_URL = '/authorize? ' ;
113+ ///多客服相关地址
114+ const CUSTOM_SERVICE_GET_RECORD = '/customservice/getrecord? ' ;
115+ const CUSTOM_SERVICE_GET_KFLIST = '/customservice/getkflist? ' ;
116+ const CUSTOM_SERVICE_GET_ONLINEKFLIST = '/customservice/getonlinekflist? ' ;
113117 const API_BASE_URL_PREFIX = 'https://api.weixin.qq.com ' ; //以下API接口URL需要使用此前缀
114118 const OAUTH_TOKEN_URL = '/sns/oauth2/access_token? ' ;
115119 const OAUTH_REFRESH_URL = '/sns/oauth2/refresh_token? ' ;
116120 const OAUTH_USERINFO_URL = '/sns/userinfo? ' ;
117121 const OAUTH_AUTH_URL = '/sns/auth? ' ;
118122 ///多客服相关地址
119- const CUSTOM_SERVICE_GET_RECORD = '/customservice/getrecord? ' ;
120- const CUSTOM_SERVICE_GET_KFLIST = '/customservice/getkflist? ' ;
121- const CUSTOM_SERVICE_GET_ONLINEKFLIST = '/customservice/getonlinekflist? ' ;
122- const CUSTOM_SEESSION_CREATE = '/customservice/kfsession/create? ' ;
123- const CUSTOM_SEESSION_CLOSE = '/customservice/kfsession/close? ' ;
124- const CUSTOM_SEESSION_SWITCH = '/customservice/kfsession/switch? ' ;
125- const CUSTOM_SEESSION_GET = '/customservice/kfsession/getsession? ' ;
126- const CUSTOM_SEESSION_GET_LIST = '/customservice/kfsession/getsessionlist? ' ;
127- const CUSTOM_SEESSION_GET_WAIT = '/customservice/kfsession/getwaitcase? ' ;
123+ const CUSTOM_SESSION_CREATE = '/customservice/kfsession/create? ' ;
124+ const CUSTOM_SESSION_CLOSE = '/customservice/kfsession/close? ' ;
125+ const CUSTOM_SESSION_SWITCH = '/customservice/kfsession/switch? ' ;
126+ const CUSTOM_SESSION_GET = '/customservice/kfsession/getsession? ' ;
127+ const CUSTOM_SESSION_GET_LIST = '/customservice/kfsession/getsessionlist? ' ;
128+ const CUSTOM_SESSION_GET_WAIT = '/customservice/kfsession/getwaitcase? ' ;
128129 const CS_KF_ACCOUNT_ADD_URL = '/customservice/kfaccount/add? ' ;
129130 const CS_KF_ACCOUNT_UPDATE_URL = '/customservice/kfaccount/update? ' ;
130131 const CS_KF_ACCOUNT_DEL_URL = '/customservice/kfaccount/del? ' ;
@@ -1758,7 +1759,7 @@ public function getQRCode($scene_id,$type=0,$expire=1800){
17581759 * @return string url 返回http地址
17591760 */
17601761 public function getQRUrl ($ ticket ) {
1761- return self ::QRCODE_IMG_URL .$ ticket ;
1762+ return self ::QRCODE_IMG_URL .urlencode ( $ ticket) ;
17621763 }
17631764
17641765 /**
@@ -2342,11 +2343,11 @@ public function getCustomServiceOnlineKFlist(){
23422343 public function createKFSession ($ openid ,$ kf_account ,$ text ='' ){
23432344 $ data =array (
23442345 "openid " =>$ openid ,
2345- "nickname " => $ kf_account
2346+ "kf_account " => $ kf_account
23462347 );
23472348 if ($ text ) $ data ["text " ] = $ text ;
23482349 if (!$ this ->access_token && !$ this ->checkAuth ()) return false ;
2349- $ result = $ this ->http_post (self ::API_URL_PREFIX .self ::CUSTOM_SEESSION_CREATE .'access_token= ' .$ this ->access_token ,self ::json_encode ($ data ));
2350+ $ result = $ this ->http_post (self ::API_BASE_URL_PREFIX .self ::CUSTOM_SESSION_CREATE .'access_token= ' .$ this ->access_token ,self ::json_encode ($ data ));
23502351 if ($ result )
23512352 {
23522353 $ json = json_decode ($ result ,true );
@@ -2379,7 +2380,7 @@ public function closeKFSession($openid,$kf_account,$text=''){
23792380 );
23802381 if ($ text ) $ data ["text " ] = $ text ;
23812382 if (!$ this ->access_token && !$ this ->checkAuth ()) return false ;
2382- $ result = $ this ->http_post (self ::API_URL_PREFIX .self ::CUSTOM_SEESSION_CLOSE .'access_token= ' .$ this ->access_token ,self ::json_encode ($ data ));
2383+ $ result = $ this ->http_post (self ::API_BASE_URL_PREFIX .self ::CUSTOM_SESSION_CLOSE .'access_token= ' .$ this ->access_token ,self ::json_encode ($ data ));
23832384 if ($ result )
23842385 {
23852386 $ json = json_decode ($ result ,true );
@@ -2406,7 +2407,7 @@ public function closeKFSession($openid,$kf_account,$text=''){
24062407 */
24072408 public function getKFSession ($ openid ){
24082409 if (!$ this ->access_token && !$ this ->checkAuth ()) return false ;
2409- $ result = $ this ->http_get (self ::API_URL_PREFIX .self ::CUSTOM_SEESSION_GET .'access_token= ' .$ this ->access_token .'&openid= ' .$ openid );
2410+ $ result = $ this ->http_get (self ::API_BASE_URL_PREFIX .self ::CUSTOM_SESSION_GET .'access_token= ' .$ this ->access_token .'&openid= ' .$ openid );
24102411 if ($ result )
24112412 {
24122413 $ json = json_decode ($ result ,true );
@@ -2439,7 +2440,7 @@ public function getKFSession($openid){
24392440 */
24402441 public function getKFSessionlist ($ kf_account ){
24412442 if (!$ this ->access_token && !$ this ->checkAuth ()) return false ;
2442- $ result = $ this ->http_get (self ::API_URL_PREFIX .self ::CUSTOM_SEESSION_GET_LIST .'access_token= ' .$ this ->access_token .'&kf_account= ' .$ kf_account );
2443+ $ result = $ this ->http_get (self ::API_BASE_URL_PREFIX .self ::CUSTOM_SESSION_GET_LIST .'access_token= ' .$ this ->access_token .'&kf_account= ' .$ kf_account );
24432444 if ($ result )
24442445 {
24452446 $ json = json_decode ($ result ,true );
@@ -2475,7 +2476,7 @@ public function getKFSessionlist($kf_account){
24752476 */
24762477 public function getKFSessionWait (){
24772478 if (!$ this ->access_token && !$ this ->checkAuth ()) return false ;
2478- $ result = $ this ->http_get (self ::API_URL_PREFIX .self ::CUSTOM_SEESSION_GET_WAIT .'access_token= ' .$ this ->access_token );
2479+ $ result = $ this ->http_get (self ::API_BASE_URL_PREFIX .self ::CUSTOM_SESSION_GET_WAIT .'access_token= ' .$ this ->access_token );
24792480 if ($ result )
24802481 {
24812482 $ json = json_decode ($ result ,true );
0 commit comments