Class: Fuyou::Ca
Class Method Summary collapse
-
.sign_in ⇒ Object
CA 签到.
-
.sign_out ⇒ Object
CA 签退.
Methods included from Base
connection, format_response, http_get, http_post, refresh_token, sign
Class Method Details
.sign_in ⇒ Object
CA 签到
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fuyou/ca.rb', line 7 def sign_in pfx_string = read_pfx_string ca_key = Digest::MD5.hexdigest(Fuyou.config.ca_key) password_key = Digest::MD5.hexdigest(Fuyou.config.password_key) = { pfxstr: des_encrypt(pfx_string, ca_key), customId: Fuyou.config.custom_id, password: des_encrypt(Fuyou.config.ca_password, password_key) } response = http_post('/FuyouRest/sign/signIn', , skip_sign: true) Fuyou.config.token = response['data']['key'] Fuyou.config.expired_at = DateTime.now + 11.5.hour end |