diff --git a/src/MiniProgram/Application.php b/src/MiniProgram/Application.php index 29e0633..e775b46 100644 --- a/src/MiniProgram/Application.php +++ b/src/MiniProgram/Application.php @@ -12,14 +12,17 @@ * @property Auth\AccessToken $accessToken * @property Auth\Client $auth * @property AppCode\Client $appCode + * @property UrlScheme\Client $urlScheme */ class Application extends ServiceContainer { const Auth = 'auth'; const AppCode = 'appCode'; + const UrlScheme = 'urlScheme'; protected $providers = [ Auth\ServiceProvider::class, - AppCode\ServiceProvider::class + AppCode\ServiceProvider::class, + UrlScheme\ServiceProvider::class ]; } diff --git a/src/MiniProgram/UrlScheme/Client.php b/src/MiniProgram/UrlScheme/Client.php new file mode 100644 index 0000000..47504d3 --- /dev/null +++ b/src/MiniProgram/UrlScheme/Client.php @@ -0,0 +1,36 @@ +getClient() + ->setMethod('POST') + ->setBody($this->jsonDataToStream($param)) + ->send($this->buildUrl( + '/wxa/generatescheme', + ['access_token' => $this->app[ServiceProviders::AccessToken]->getToken()]) + ); + + $this->checkResponse($response, $parseData); + + return $parseData; + } +} diff --git a/src/MiniProgram/UrlScheme/ServiceProvider.php b/src/MiniProgram/UrlScheme/ServiceProvider.php new file mode 100644 index 0000000..e3cf8d5 --- /dev/null +++ b/src/MiniProgram/UrlScheme/ServiceProvider.php @@ -0,0 +1,21 @@ +