含 AI 助手、抖音 OAuth、流量池推送、支付获客、SuperAdmin 设备与场景管理等本地迭代;以本地为准单向推送,未拉取远程。 Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.3 KiB
PHP
33 lines
1.3 KiB
PHP
<?php
|
||
/**
|
||
* 抖音 OAuth 配置冒烟(不输出 secret)
|
||
* 用法:docker exec cunkebao-server php /var/www/html/tests/douyin_oauth_config_smoke.php
|
||
*/
|
||
define('APP_PATH', __DIR__ . '/../application/');
|
||
require __DIR__ . '/../thinkphp/base.php';
|
||
|
||
\think\App::initCommon();
|
||
\think\facade\Config::set(include __DIR__ . '/../config/douyin.php', 'douyin');
|
||
|
||
$cfg = \think\facade\Config::get('douyin.');
|
||
$key = (string)($cfg['client_key'] ?? '');
|
||
$secret = (string)($cfg['client_secret'] ?? '');
|
||
$redirect = (string)($cfg['redirect_uri'] ?? '');
|
||
$scope = (string)($cfg['scope'] ?? '');
|
||
|
||
$ok = $key !== '' && $secret !== '' && $redirect !== '';
|
||
echo $ok ? "OK configured\n" : "FAIL missing credentials\n";
|
||
echo 'client_key: ' . ($key !== '' ? substr($key, 0, 4) . '***' . substr($key, -2) : '(empty)') . "\n";
|
||
echo 'client_secret: ' . ($secret !== '' ? 'set(' . strlen($secret) . ' chars)' : '(empty)') . "\n";
|
||
echo 'redirect_uri: ' . $redirect . "\n";
|
||
echo 'scope: ' . $scope . "\n";
|
||
|
||
if ($ok) {
|
||
require_once __DIR__ . '/../application/cunkebao/service/DouyinOAuthService.php';
|
||
$url = \app\cunkebao\service\DouyinOAuthService::buildAuthorizeUrl('smoke-test-state');
|
||
echo 'authorize_url_prefix: ' . substr($url, 0, 80) . "...\n";
|
||
echo \app\cunkebao\service\DouyinOAuthService::isConfigured() ? "isConfigured: true\n" : "isConfigured: false\n";
|
||
}
|
||
|
||
exit($ok ? 0 : 1);
|