yptools 1.0.14 → 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: f3c5473ec775d2207469ca880a82a6f519c56ec05f47025397427aa2ba829981
4
- data.tar.gz: 33ae67ab59e2b4ccbb9797f882a34627058de7f01f92f9ad5dca2b71c6b6d021
3
+ metadata.gz: 9cb3e39055391054fe343255192ab05476b7e579002f2749e52b664293c47347
4
+ data.tar.gz: df8a95a939692f3f62da1e04a8240c84feadd2adb2da6a3110445dbb2144a9ce
5
5
  SHA512:
6
- metadata.gz: 865be63f0212e98c8bdec185e608fd1a3191f625ecbd9a2ea1fb1dbbe62024e5f96bea096a326f345e71e9b8eba4667facedc1f39e718d83721f90d33e877146
7
- data.tar.gz: 76c379471377f5ff4cc8285d1a18491369e1a7ebb5a5673cb37ebe5137b6a39841f235f34ee485098600ba2ecb83c72313ba86421ffe5a9af7efe3c3fae64c31
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.14
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - chenghengsheng
@@ -122,20 +122,6 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: net/http
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
125
  description: Some useful tools make me happy
140
126
  email:
141
127
  - 2534550460@qq.com