mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
support api token login
This commit is contained in:
parent
773a91f37c
commit
3e36845495
4
.gitignore
vendored
4
.gitignore
vendored
@ -26,3 +26,7 @@ config.json
|
||||
godns
|
||||
|
||||
vendor/*
|
||||
/.idea
|
||||
/godns.iml
|
||||
/godns.ipr
|
||||
/godns.iws
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"email": "",
|
||||
"password": "",
|
||||
"loginToken": "",
|
||||
"domain": "",
|
||||
"sub_domain": "",
|
||||
"ip_url": "http://members.3322.org/dyndns/getip",
|
||||
|
@ -29,8 +29,12 @@ func get_currentIP(url string) (string, error) {
|
||||
|
||||
func generate_header(content url.Values) url.Values {
|
||||
header := url.Values{}
|
||||
header.Add("login_email", Configuration.Email)
|
||||
header.Add("login_password", Configuration.Password)
|
||||
if(Configuration.LoginToken!=""){
|
||||
header.Add("login_token", Configuration.LoginToken)
|
||||
}else{
|
||||
header.Add("login_email", Configuration.Email)
|
||||
header.Add("login_password", Configuration.Password)
|
||||
}
|
||||
header.Add("format", "json")
|
||||
header.Add("lang", "en")
|
||||
header.Add("error_on_empty", "no")
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
type Settings struct {
|
||||
Email string
|
||||
Password string
|
||||
LoginToken string
|
||||
Domain string
|
||||
Sub_domain string
|
||||
IP_Url string
|
||||
|
Loading…
x
Reference in New Issue
Block a user