初始化代码

This commit is contained in:
2025-08-11 10:22:05 +08:00
commit ebd8d85201
4206 changed files with 753018 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
<?php
namespace app\api\wxapi\request;
use app\api\wxapi\Base;
/* 获取常规access_token
* $AccessTokenRequest=new AccessTokenRequest();
* $AccessTokenRequest->setAppId($WxClient->appID);
* $AccessTokenRequest->setSecret($WxClient->appsecret);
* $AccessTokenRequest=$WxClient->execute($AccessTokenRequest);
* */
class AccessTokenRequest extends Base
{
private $apiParas = array();
private $appid;
private $secret;
private $code;
public function init(){
$this->apiParas['grant_type'] = 'client_credential';
$this->setAppId('');
$this->setSecret('');
}
public function getApiMethodName(){
return "cgi-bin/token";
}
public function getApiParas(){
return $this->apiParas;
}
public function putOtherTextParam($key, $value){
$this->apiParas[$key] = $value;
$this->$key = $value;
}
public function setAppId($appid){
$this->appid = $appid;
$this->apiParas["appid"] = $appid;
}
public function getAppId(){
return $this->appid;
}
public function setSecret($secret){
$this->secret = $secret;
$this->apiParas["secret"] = $secret;
}
public function getSecret(){
return $this->secret;
}
}