lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb in imperituroard-1.1.17 vs lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb in imperituroard-1.1.18
- old
+ new
@@ -36,16 +36,16 @@
dd = str.split(",")
acc_token = ""
refr_token = ""
exp_in = ""
- access_token = /\"accessToken\":\"(\S+)\"/
- refresh_token = /\"refreshToken\":\"(.+)\"/
- expires_in = /\"expiresIn\":(\d+)/
+ access_token = /"accessToken":"(\S+)"/
+ refresh_token = /"refreshToken":"(.+)"/
+ expires_in = /"expiresIn":(\d+)/
for i in dd
- if i.to_s.include?("accessToken")
+ if i.to_s.include?('accessToken')
acc_token = access_token.match(i)
elsif i.to_s.include?("refreshToken")
refr_token = refresh_token.match(i)
elsif i.to_s.include?("expiresIn")
exp_in = expires_in.match(i)
@@ -62,11 +62,11 @@
out_resp = {}
fff = {}
data = {}
url_string = ""
begin
- path = "/iocm/app/sec/v1.1.0/login"
+ path = '/iocm/app/sec/v1.1.0/login'
url_string = "https://" + platformip + ":" + platformport + path
internal_func.printer_texter("get_token: start. Step2, url_string: #{url_string}", "debug")
uri = URI.parse url_string
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
@@ -616,10 +616,10 @@
end
#######################################
- def test()
+ def test
url_string = "https://134.17.93.4:8743/iocm/app/sec/v1.1.0/login"
headers = {
'Authorization' => 'Bearer ppeMsOq6zdb2fSUH4GoRooS_FgEa',
'Content-Type' => 'application/json',
\ No newline at end of file