-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aaa: 增加企业微信js sdk api get_jsapi_ticket
- Loading branch information
1 parent
4e2bb6e
commit d64c90b
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: 赵思贵 | ||
* Date: 2018/9/3 | ||
* Time: 11:01 | ||
*/ | ||
|
||
namespace Zwei\WorkWechat\JsSdk; | ||
|
||
use Zwei\WorkWechat\ApiBase; | ||
|
||
/** | ||
* js sdk api | ||
* | ||
* Class JsSdkApi | ||
* @package Zwei\WorkWechat\JsSdk | ||
*/ | ||
class JsSdkApi extends ApiBase implements JsSdkApiDefineInterface | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getJsApiTicket($accessToken) | ||
{ | ||
$url = sprintf(self::URL_JS_API_TICKET, $accessToken); | ||
$response = $this->client->request('get', $url, ['verify' => $this->sslVerify,]); | ||
return $this->parseApiResult($response); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: 赵思贵 | ||
* Date: 2018/9/3 | ||
* Time: 11:01 | ||
*/ | ||
|
||
namespace Zwei\WorkWechat\JsSdk; | ||
|
||
/** | ||
* js sdk api | ||
* | ||
* Interface JsSdkApiDefineInterface | ||
* @package Zwei\WorkWechat\JsSdk | ||
*/ | ||
interface JsSdkApiDefineInterface | ||
{ | ||
/** | ||
* 获取企业的 jsapi_ticket | ||
* 请求方式:GET(HTTPS) | ||
* @var string | ||
*/ | ||
const URL_JS_API_TICKET = 'https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=%s'; | ||
|
||
/** | ||
* 获取企业的jsapi_ticket | ||
* | ||
* @param string $accessToken 企业access_token | ||
* @return array | ||
* @throws WorkWechatApiErrorCodeException 企业微信接口返回错误码异常 | ||
*/ | ||
public function getJsApiTicket($accessToken); | ||
} |