OAuth.php 617 字节
<?php

namespace Lackoxygen\TiktokOpen\Mini\OAuth;

use Lackoxygen\TiktokOpen\Base\ServiceManager;

class OAuth extends ServiceManager
{
    public function jsCode(string $code = '', string $anonymousCode = '')
    {
        return $this->app['client']->asJson()
            ->post(
                'api/apps/v2/jscode2session',
                [
                    'appid' => $this->app['config']->getAppKey(),
                    'secret' => $this->app['config']->getAppSecret(),
                    'code' => $code,
                    'anonymous_code' => $anonymousCode,
                ]
            );
    }
}