Quik
10 月 15 日
async function getJson(url) {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`请求失败:HTTP ${response.status} (${url})`);
}
return response.json();
}
getJson('/api/organizations')
.then(organizations => {
if (!Array.isArray(organizations) || !organizations[0]?.uuid) {
throw new Error('组织列表为空或返回格式不符合预期');
}
const uuid = encodeURIComponent(organizations[0].uuid);
return getJson(`/api/organizations/${uuid}/kyc_status`);
})
.then(data => {
const messages = {
not_required: '✅ 无需 KYC ,可直接升级',
pending: '⏳ 审核中',
approved: '✅ 已通过,可升级',
denied: '❌ 被拒'
};
console.log(
'KYC 状态:',
data.status,
messages[data.status] ?? '未知 KYC 状态'
);
})
.catch(error => {
console.error('查询失败:', error);
});
楼上的代码一些符号被吞了。看看还能不能发出来。
实在不行发给 GPT 让它改一下就行,刚才我的账号提示不需要 KYC ,虽然仍然不敢升级。