fix: 修复小米 Mimo API 端点问题并添加调试日志

- 移除无效的默认端点 api.mimo.xiaomi.com(DNS 无法解析)
- 小米 Mimo 现在要求用户在 API 端点字段中填写平台提供的自定义端点
- 添加针对小米 Mimo 的友好错误提示,引导用户访问 platform.xiaomimimo.com
- 在 JavaScript 中添加 console.log 调试输出,便于排查问题
- 改进错误处理,显示完整的 xhr 响应信息
This commit is contained in:
2026-01-26 14:20:10 +08:00
parent 4b0c5c159a
commit 8ba2cae1a1
2 changed files with 9 additions and 3 deletions

View File

@@ -2451,6 +2451,7 @@ function themeoptions_page(){
nonce: '<?php echo wp_create_nonce('argon_test_unified_api'); ?>',
api_id: apiId
}, function(response) {
console.log('Response:', response);
if (response.success) {
alert('✓ ' + response.data.message);
} else {
@@ -2461,7 +2462,8 @@ function themeoptions_page(){
$btn.prop('disabled', false).html(originalHtml);
}).fail(function(xhr, status, error) {
// AJAX 请求本身失败
console.error('AJAX Error:', status, error);
console.error('AJAX Error:', xhr, status, error);
console.error('Response Text:', xhr.responseText);
alert('<?php _e('请求失败,请重试', 'argon'); ?>');
$btn.prop('disabled', false).html(originalHtml);
});