generated from template/slidev-template
fix: add test
This commit is contained in:
@@ -32,6 +32,14 @@ export class CloudflareDDNS {
|
||||
if(!result.success) {
|
||||
throw new Error(`更新失败: ${JSON.stringify(result.errors)}`);
|
||||
}
|
||||
console.log(`更新成功: ${domain} -> ${new_ip}`);
|
||||
return result;
|
||||
}
|
||||
async getList(zone_id: string, api_token: string) {
|
||||
const url = `https://api.cloudflare.com/client/v4/zones/${zone_id}/dns_records`;
|
||||
return fetch(url, {
|
||||
method: 'GET',
|
||||
headers: this.makeHeader(api_token),
|
||||
}).then(res => res.json());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user