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 +4 -4
- data/lib/yptools/chatai/yp_chatai.rb +6 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cb3e39055391054fe343255192ab05476b7e579002f2749e52b664293c47347
|
4
|
+
data.tar.gz: df8a95a939692f3f62da1e04a8240c84feadd2adb2da6a3110445dbb2144a9ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|