File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change
1
+ ## v6.0.125 / 2020-11-19
2
+ - 优化淘宝服务协议
3
+
1
4
## v6.0.124 / 2020-11-19
2
5
- 小范围测试淘宝官方SDK
3
6
Original file line number Diff line number Diff line change 25
25
/**
26
26
* 定义当前版本
27
27
*/
28
- const VERSION = '6.0.124 ' ;
28
+ const VERSION = '6.0.125 ' ;
29
29
30
30
if (!function_exists ('get_ip_info ' )) {
31
31
/**
Original file line number Diff line number Diff line change @@ -80,6 +80,23 @@ class TbkService extends Service
80
80
*/
81
81
private $ output ;
82
82
83
+ /**
84
+ * 安全协议
85
+ * @var string
86
+ */
87
+ private $ protocol = 'http ' ;
88
+
89
+ /**
90
+ * 设置安全协议
91
+ * @param string $protocol
92
+ * @return $this
93
+ */
94
+ public function setProtocol ($ protocol = 'http ' ): self
95
+ {
96
+ $ this ->protocol = $ protocol ;
97
+ return $ this ;
98
+ }
99
+
83
100
/**
84
101
* 是否为沙箱
85
102
* @return $this
@@ -927,10 +944,19 @@ private function http(): void
927
944
$ strParam = $ this ->createStrParam ();
928
945
$ strParam .= 'sign= ' . $ sign ;
929
946
//访问服务
930
- if (empty ($ this ->sandbox )) {
931
- $ url = 'http://gw.api.taobao.com/router/rest? ' . $ strParam ;
932
- } else {
933
- $ url = 'http://gw.api.tbsandbox.com/router/rest? ' . $ strParam ;
947
+ if ($ this ->protocol === 'http ' ) {
948
+ if (empty ($ this ->sandbox )) {
949
+ $ url = 'http://gw.api.taobao.com/router/rest? ' . $ strParam ;
950
+ } else {
951
+ $ url = 'http://gw.api.tbsandbox.com/router/rest? ' . $ strParam ;
952
+ }
953
+ }
954
+ if ($ this ->protocol === 'https ' ) {
955
+ if (empty ($ this ->sandbox )) {
956
+ $ url = 'https://eco.taobao.com/router/rest? ' . $ strParam ;
957
+ } else {
958
+ $ url = 'https://gw.api.tbsandbox.com/router/rest? ' . $ strParam ;
959
+ }
934
960
}
935
961
$ result = file_get_contents ($ url );
936
962
$ result = json_decode ($ result , true );
You can’t perform that action at this time.
0 commit comments