v1.2.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dingtalk"
|
name = "dingtalk"
|
||||||
version = "1.2.0"
|
version = "1.2.1"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "DingTalk Robot Util, Send text/markdown/link messages using DingTalk robot, 钉钉机器人"
|
description = "DingTalk Robot Util, Send text/markdown/link messages using DingTalk robot, 钉钉机器人"
|
||||||
@@ -16,7 +16,6 @@ urlencoding = "1.0.0"
|
|||||||
futures = "0.3.1"
|
futures = "0.3.1"
|
||||||
hmac = "0.7.1"
|
hmac = "0.7.1"
|
||||||
sha2 = "0.8.1"
|
sha2 = "0.8.1"
|
||||||
maplit = "1.0.2"
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ dt.send_message(&DingTalkMessage::new_action_card("action card 002", "action car
|
|||||||
|
|
||||||
#### Changelog
|
#### Changelog
|
||||||
|
|
||||||
|
* v1.2.1
|
||||||
|
* Remove `maplit` crate
|
||||||
* v1.2.0
|
* v1.2.0
|
||||||
* Use `serde` and `serde_json` crates, replace `json` crate
|
* Use `serde` and `serde_json` crates, replace `json` crate
|
||||||
* v1.1.2
|
* v1.1.2
|
||||||
|
|||||||
@@ -383,16 +383,16 @@ impl <'a> DingTalk<'a> {
|
|||||||
// Just Ok
|
// Just Ok
|
||||||
} else if self.default_webhook_url.contains('?') {
|
} else if self.default_webhook_url.contains('?') {
|
||||||
if !self.default_webhook_url.ends_with('&') {
|
if !self.default_webhook_url.ends_with('&') {
|
||||||
signed_url.push_str("&");
|
signed_url.push('&');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
signed_url.push_str("?");
|
signed_url.push('?');
|
||||||
}
|
}
|
||||||
|
|
||||||
signed_url.push_str("access_token=");
|
signed_url.push_str("access_token=");
|
||||||
signed_url.push_str(&urlencoding::encode(self.access_token));
|
signed_url.push_str(&urlencoding::encode(self.access_token));
|
||||||
|
|
||||||
if self.sec_token != "" {
|
if !self.sec_token.is_empty() {
|
||||||
let timestamp = &format!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis());
|
let timestamp = &format!("{}", SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_millis());
|
||||||
let timestamp_and_secret = &format!("{}\n{}", timestamp, self.sec_token);
|
let timestamp_and_secret = &format!("{}\n{}", timestamp, self.sec_token);
|
||||||
let hmac_sha256 = base64::encode(&calc_hmac_sha256(self.sec_token.as_bytes(), timestamp_and_secret.as_bytes())?[..]);
|
let hmac_sha256 = base64::encode(&calc_hmac_sha256(self.sec_token.as_bytes(), timestamp_and_secret.as_bytes())?[..]);
|
||||||
|
|||||||
Reference in New Issue
Block a user