generated from template/slidev-template
fix: add test
This commit is contained in:
1 parent
e81a475bba
commit
572f793061
4 files changed
+32
-1
No files matched your search
@@ -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