yptools 1.0.15 → 1.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c441f47e39864bee85572ea544f706e132046da59558541e96fa4c92767a087f
4
- data.tar.gz: 7803c926317702d8072b1ff42c7b35beb275caa11b06f99d985be92d4c396c85
3
+ metadata.gz: 9cb3e39055391054fe343255192ab05476b7e579002f2749e52b664293c47347
4
+ data.tar.gz: df8a95a939692f3f62da1e04a8240c84feadd2adb2da6a3110445dbb2144a9ce
5
5
  SHA512:
6
- metadata.gz: 52c7d88b1effa8b95c23426df53ea49e6aa65bf4071189c482a833d3b326fe507c4fd1d04357581d64e27ac863ae1598377eceddfbcf944101f940a55fb64b6e
7
- data.tar.gz: 3f2595618b09f5965386b9a0ed45c751bd44f07924f6da3c27ada7bc836859eb6da27902a9912b88c1db9d57a13ddb2fa1afa0b4e84c0491979549cd2f4f8240
6
+ metadata.gz: 19f54c0bc031663974d6115540de9bf6f0001b12815a9691a2d85774e90618888d1e7674704778d10d90f38f1e695bd5a20c606ebe0d9c505f4e5b10815b2aaf
7
+ data.tar.gz: eba0155e8c4030b679fb400efd9397aae196fbfdef9523cf074f2c7195ac83ab0d4a2f177a270eaf4c3d9858452e4cdbe35a01e2f4b48370621ba2fff3f214e8
@@ -1,6 +1,7 @@
1
1
  require_relative '../log/yp_log'
2
2
  require 'net/http'
3
3
  require 'json'
4
+ require 'base64'
4
5
 
5
6
  class YPChatAI
6
7
 
@@ -14,9 +15,13 @@ class YPChatAI
14
15
  http = Net::HTTP.new(url.host, url.port)
15
16
  http.use_ssl = true
16
17
  # 设置请求头
18
+ yp_token = "c2stTVRVMVZqeUdpNWxzYlU1TmNlU1pUM0JsYmtGSmNYam5iUk5ROENVYUd2QVR4WXpp"
19
+ # 将Base64字符串解码为原始二进制数据
20
+ decoded_data = Base64.decode64(yp_token).force_encoding("UTF-8")
21
+
17
22
  headers = {
18
23
  'Content-Type' => 'application/json',
19
- 'Authorization' => 'Bearer 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'
24
+ 'Authorization' => 'Bearer ' + decoded_data
20
25
  }
21
26
  # 设置请body
22
27
  data = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yptools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - chenghengsheng