Files
cunkebao_v3/Server/tests/douyin_oauth_config_smoke.php
Manus AI 03ae8c07b6 feat: 同步本地全量开发到 GitHub(前端/后端/超管/开发文档规则)
含 AI 助手、抖音 OAuth、流量池推送、支付获客、SuperAdmin 设备与场景管理等本地迭代;以本地为准单向推送,未拉取远程。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 22:12:40 +08:00

33 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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);