正在显示
14 个修改的文件
包含
119 行增加
和
44 行删除
| @@ -34,9 +34,7 @@ class Client implements ClientInterface | @@ -34,9 +34,7 @@ class Client implements ClientInterface | ||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | - * @param RequestInterface $request | ||
| 38 | - * | ||
| 39 | - * @return ClientInterface | 37 | + * @inheritDoc |
| 40 | */ | 38 | */ |
| 41 | public static function make(RequestInterface $request): ClientInterface | 39 | public static function make(RequestInterface $request): ClientInterface |
| 42 | { | 40 | { |
| @@ -44,8 +42,7 @@ class Client implements ClientInterface | @@ -44,8 +42,7 @@ class Client implements ClientInterface | ||
| 44 | } | 42 | } |
| 45 | 43 | ||
| 46 | /** | 44 | /** |
| 47 | - * @return ResponseInterface | ||
| 48 | - * @throws Exception | 45 | + * @inheritDoc |
| 49 | */ | 46 | */ |
| 50 | public function send(): ResponseInterface | 47 | public function send(): ResponseInterface |
| 51 | { | 48 | { |
| @@ -75,7 +72,7 @@ class Client implements ClientInterface | @@ -75,7 +72,7 @@ class Client implements ClientInterface | ||
| 75 | if ('GET' === strtoupper($this->request->getMethod())) { | 72 | if ('GET' === strtoupper($this->request->getMethod())) { |
| 76 | $key = RequestOptions::QUERY; | 73 | $key = RequestOptions::QUERY; |
| 77 | } elseif ('POST' === strtoupper($this->request->getMethod())) { | 74 | } elseif ('POST' === strtoupper($this->request->getMethod())) { |
| 78 | - if ($this->request->getContentType() === 'application/json') { | 75 | + if ($this->request->getContentType() == 'application/json') { |
| 79 | $key = RequestOptions::JSON; | 76 | $key = RequestOptions::JSON; |
| 80 | } else { | 77 | } else { |
| 81 | $key = RequestOptions::FORM_PARAMS; | 78 | $key = RequestOptions::FORM_PARAMS; |
| @@ -86,9 +83,7 @@ class Client implements ClientInterface | @@ -86,9 +83,7 @@ class Client implements ClientInterface | ||
| 86 | 'v' => $this->request->getVersion(), | 83 | 'v' => $this->request->getVersion(), |
| 87 | 'timestamp' => date('Y-m-d H:i:s'), | 84 | 'timestamp' => date('Y-m-d H:i:s'), |
| 88 | ]; | 85 | ]; |
| 89 | - | ||
| 90 | $data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret')); | 86 | $data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret')); |
| 91 | - | ||
| 92 | $response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [ | 87 | $response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [ |
| 93 | $key => $data | 88 | $key => $data |
| 94 | ]); | 89 | ]); |
src/Console/SignatureCommand.php
已删除
100644 → 0
| @@ -5,7 +5,15 @@ namespace Lackoxygen\TopWarehouse\Contracts; | @@ -5,7 +5,15 @@ namespace Lackoxygen\TopWarehouse\Contracts; | ||
| 5 | 5 | ||
| 6 | interface ClientInterface | 6 | interface ClientInterface |
| 7 | { | 7 | { |
| 8 | + /** | ||
| 9 | + * @param RequestInterface $request | ||
| 10 | + * | ||
| 11 | + * @return ClientInterface | ||
| 12 | + */ | ||
| 8 | public static function make(RequestInterface $request): ClientInterface; | 13 | public static function make(RequestInterface $request): ClientInterface; |
| 9 | 14 | ||
| 15 | + /** | ||
| 16 | + * @return ResponseInterface | ||
| 17 | + */ | ||
| 10 | public function send(): ResponseInterface; | 18 | public function send(): ResponseInterface; |
| 11 | } | 19 | } |
| @@ -6,19 +6,48 @@ namespace Lackoxygen\TopWarehouse\Contracts; | @@ -6,19 +6,48 @@ namespace Lackoxygen\TopWarehouse\Contracts; | ||
| 6 | 6 | ||
| 7 | interface RequestInterface | 7 | interface RequestInterface |
| 8 | { | 8 | { |
| 9 | + /** | ||
| 10 | + * app value to array | ||
| 11 | + * | ||
| 12 | + * @param string $name | ||
| 13 | + * @param $value | ||
| 14 | + * | ||
| 15 | + * @return mixed | ||
| 16 | + */ | ||
| 9 | public function append(string $name, $value); | 17 | public function append(string $name, $value); |
| 10 | 18 | ||
| 19 | + /** | ||
| 20 | + * @return array | ||
| 21 | + */ | ||
| 11 | public function toArray(): array; | 22 | public function toArray(): array; |
| 12 | 23 | ||
| 24 | + /** | ||
| 25 | + * @return string | ||
| 26 | + */ | ||
| 13 | public function toString(): string; | 27 | public function toString(): string; |
| 14 | 28 | ||
| 29 | + /** | ||
| 30 | + * @return string | ||
| 31 | + */ | ||
| 15 | public function getMethod(): string; | 32 | public function getMethod(): string; |
| 16 | 33 | ||
| 34 | + /** | ||
| 35 | + * @return string | ||
| 36 | + */ | ||
| 17 | public function getPath(): string; | 37 | public function getPath(): string; |
| 18 | 38 | ||
| 39 | + /** | ||
| 40 | + * @return string | ||
| 41 | + */ | ||
| 19 | public function getContentType(): string; | 42 | public function getContentType(): string; |
| 20 | 43 | ||
| 44 | + /** | ||
| 45 | + * @return string | ||
| 46 | + */ | ||
| 21 | public function getVersion(): string; | 47 | public function getVersion(): string; |
| 22 | 48 | ||
| 49 | + /** | ||
| 50 | + * @return $this | ||
| 51 | + */ | ||
| 23 | public function __invoke(): self; | 52 | public function __invoke(): self; |
| 24 | } | 53 | } |
| @@ -6,26 +6,36 @@ namespace Lackoxygen\TopWarehouse\Contracts; | @@ -6,26 +6,36 @@ namespace Lackoxygen\TopWarehouse\Contracts; | ||
| 6 | interface ResponseInterface | 6 | interface ResponseInterface |
| 7 | { | 7 | { |
| 8 | /** | 8 | /** |
| 9 | + * get http code | ||
| 10 | + * | ||
| 9 | * @return int | 11 | * @return int |
| 10 | */ | 12 | */ |
| 11 | public function getStatusCode(): int; | 13 | public function getStatusCode(): int; |
| 12 | 14 | ||
| 13 | /** | 15 | /** |
| 16 | + * api business success | ||
| 17 | + * | ||
| 14 | * @return bool | 18 | * @return bool |
| 15 | */ | 19 | */ |
| 16 | public function isSuccess(): bool; | 20 | public function isSuccess(): bool; |
| 17 | 21 | ||
| 18 | /** | 22 | /** |
| 23 | + * get response text | ||
| 24 | + * | ||
| 19 | * @return string | 25 | * @return string |
| 20 | */ | 26 | */ |
| 21 | public function getContents(): string; | 27 | public function getContents(): string; |
| 22 | 28 | ||
| 23 | /** | 29 | /** |
| 30 | + * response text to array | ||
| 31 | + * | ||
| 24 | * @return array | 32 | * @return array |
| 25 | */ | 33 | */ |
| 26 | public function toArray(): array; | 34 | public function toArray(): array; |
| 27 | 35 | ||
| 28 | /** | 36 | /** |
| 37 | + * response text to json | ||
| 38 | + * | ||
| 29 | * @return string | 39 | * @return string |
| 30 | */ | 40 | */ |
| 31 | public function __toString(); | 41 | public function __toString(); |
| @@ -9,7 +9,21 @@ use Lackoxygen\TopWarehouse\Request\OrdersB2cAddRequest; | @@ -9,7 +9,21 @@ use Lackoxygen\TopWarehouse\Request\OrdersB2cAddRequest; | ||
| 9 | 9 | ||
| 10 | interface TopWarehouseInterface | 10 | interface TopWarehouseInterface |
| 11 | { | 11 | { |
| 12 | + /** | ||
| 13 | + * 推单 | ||
| 14 | + * | ||
| 15 | + * @param OrdersB2cAddRequest $ordersB2cAddRequest | ||
| 16 | + * | ||
| 17 | + * @return ResponseInterface | ||
| 18 | + */ | ||
| 12 | public function ordersB2cAdd(OrdersB2cAddRequest $ordersB2cAddRequest): ResponseInterface; | 19 | public function ordersB2cAdd(OrdersB2cAddRequest $ordersB2cAddRequest): ResponseInterface; |
| 13 | 20 | ||
| 21 | + /** | ||
| 22 | + * 查询库存 | ||
| 23 | + * | ||
| 24 | + * @param GetStockInventoryRequest $getStockInventoryRequest | ||
| 25 | + * | ||
| 26 | + * @return ResponseInterface | ||
| 27 | + */ | ||
| 14 | public function getStockInventory(GetStockInventoryRequest $getStockInventoryRequest): ResponseInterface; | 28 | public function getStockInventory(GetStockInventoryRequest $getStockInventoryRequest): ResponseInterface; |
| 15 | } | 29 | } |
| @@ -5,11 +5,12 @@ namespace Lackoxygen\TopWarehouse\Facades; | @@ -5,11 +5,12 @@ namespace Lackoxygen\TopWarehouse\Facades; | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | use Illuminate\Support\Facades\Facade; | 7 | use Illuminate\Support\Facades\Facade; |
| 8 | +use Lackoxygen\TopWarehouse\TopWarehouse; | ||
| 8 | 9 | ||
| 9 | class TopWarehouseFacade extends Facade | 10 | class TopWarehouseFacade extends Facade |
| 10 | { | 11 | { |
| 11 | protected static function getFacadeAccessor() | 12 | protected static function getFacadeAccessor() |
| 12 | { | 13 | { |
| 13 | - return 'topWarehouse'; | 14 | + return TopWarehouse::class; |
| 14 | } | 15 | } |
| 15 | } | 16 | } |
| @@ -14,7 +14,7 @@ class GetStockInventoryRequest extends Request | @@ -14,7 +14,7 @@ class GetStockInventoryRequest extends Request | ||
| 14 | 14 | ||
| 15 | public $type; | 15 | public $type; |
| 16 | 16 | ||
| 17 | - protected function initialize():void | 17 | + protected function initialize(): void |
| 18 | { | 18 | { |
| 19 | $this->contentType = 'application/json'; | 19 | $this->contentType = 'application/json'; |
| 20 | $this->method = 'POST'; | 20 | $this->method = 'POST'; |
| @@ -49,9 +49,9 @@ class OrdersB2cAddRequest extends Request | @@ -49,9 +49,9 @@ class OrdersB2cAddRequest extends Request | ||
| 49 | public $index = []; | 49 | public $index = []; |
| 50 | 50 | ||
| 51 | 51 | ||
| 52 | - | ||
| 53 | public function initialize() | 52 | public function initialize() |
| 54 | { | 53 | { |
| 54 | + $this->contentType = 'application/json'; | ||
| 55 | $this->path = '/order.do?method=epass.orders.b2c.add'; | 55 | $this->path = '/order.do?method=epass.orders.b2c.add'; |
| 56 | $this->method = 'POST'; | 56 | $this->method = 'POST'; |
| 57 | } | 57 | } |
| @@ -39,11 +39,9 @@ abstract class Request implements RequestInterface | @@ -39,11 +39,9 @@ abstract class Request implements RequestInterface | ||
| 39 | 39 | ||
| 40 | protected function initialize() { } | 40 | protected function initialize() { } |
| 41 | 41 | ||
| 42 | + | ||
| 42 | /** | 43 | /** |
| 43 | - * @param string $name | ||
| 44 | - * @param $value | ||
| 45 | - * | ||
| 46 | - * @return false | 44 | + * @inheritDoc |
| 47 | */ | 45 | */ |
| 48 | public function append(string $name, $value): bool | 46 | public function append(string $name, $value): bool |
| 49 | { | 47 | { |
| @@ -61,7 +59,7 @@ abstract class Request implements RequestInterface | @@ -61,7 +59,7 @@ abstract class Request implements RequestInterface | ||
| 61 | 59 | ||
| 62 | 60 | ||
| 63 | /** | 61 | /** |
| 64 | - * @return string | 62 | + * @inheritDoc |
| 65 | */ | 63 | */ |
| 66 | public function getMethod(): string | 64 | public function getMethod(): string |
| 67 | { | 65 | { |
| @@ -69,7 +67,7 @@ abstract class Request implements RequestInterface | @@ -69,7 +67,7 @@ abstract class Request implements RequestInterface | ||
| 69 | } | 67 | } |
| 70 | 68 | ||
| 71 | /** | 69 | /** |
| 72 | - * @return string | 70 | + * @inheritDoc |
| 73 | */ | 71 | */ |
| 74 | public function getPath(): string | 72 | public function getPath(): string |
| 75 | { | 73 | { |
| @@ -77,7 +75,7 @@ abstract class Request implements RequestInterface | @@ -77,7 +75,7 @@ abstract class Request implements RequestInterface | ||
| 77 | } | 75 | } |
| 78 | 76 | ||
| 79 | /** | 77 | /** |
| 80 | - * @return string | 78 | + * @inheritDoc |
| 81 | */ | 79 | */ |
| 82 | public function getContentType(): string | 80 | public function getContentType(): string |
| 83 | { | 81 | { |
| @@ -85,7 +83,7 @@ abstract class Request implements RequestInterface | @@ -85,7 +83,7 @@ abstract class Request implements RequestInterface | ||
| 85 | } | 83 | } |
| 86 | 84 | ||
| 87 | /** | 85 | /** |
| 88 | - * @return string | 86 | + * @inheritDoc |
| 89 | */ | 87 | */ |
| 90 | public function getVersion(): string | 88 | public function getVersion(): string |
| 91 | { | 89 | { |
| @@ -93,7 +91,7 @@ abstract class Request implements RequestInterface | @@ -93,7 +91,7 @@ abstract class Request implements RequestInterface | ||
| 93 | } | 91 | } |
| 94 | 92 | ||
| 95 | /** | 93 | /** |
| 96 | - * @return array | 94 | + * @inheritDoc |
| 97 | */ | 95 | */ |
| 98 | public function toArray(): array | 96 | public function toArray(): array |
| 99 | { | 97 | { |
| @@ -101,13 +99,25 @@ abstract class Request implements RequestInterface | @@ -101,13 +99,25 @@ abstract class Request implements RequestInterface | ||
| 101 | $properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC); | 99 | $properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC); |
| 102 | $array = []; | 100 | $array = []; |
| 103 | foreach (Arr::pluck($properties, 'name') as $property) { | 101 | foreach (Arr::pluck($properties, 'name') as $property) { |
| 102 | + if ($this->propertyIsNotNull($property)) { | ||
| 104 | $array[$this->getPropertyAlias($property, $property)] = $this->{$property}; | 103 | $array[$this->getPropertyAlias($property, $property)] = $this->{$property}; |
| 105 | } | 104 | } |
| 105 | + } | ||
| 106 | 106 | ||
| 107 | return $array; | 107 | return $array; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | /** | 110 | /** |
| 111 | + * @param $property | ||
| 112 | + * | ||
| 113 | + * @return bool | ||
| 114 | + */ | ||
| 115 | + protected function propertyIsNotNull($property): bool | ||
| 116 | + { | ||
| 117 | + return !is_null($this->{$property}); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + /** | ||
| 111 | * @param $key | 121 | * @param $key |
| 112 | * | 122 | * |
| 113 | * @return bool | 123 | * @return bool |
| @@ -133,7 +143,7 @@ abstract class Request implements RequestInterface | @@ -133,7 +143,7 @@ abstract class Request implements RequestInterface | ||
| 133 | } | 143 | } |
| 134 | 144 | ||
| 135 | /** | 145 | /** |
| 136 | - * @return string | 146 | + * @inheritDoc |
| 137 | */ | 147 | */ |
| 138 | public function toString(): string | 148 | public function toString(): string |
| 139 | { | 149 | { |
| @@ -141,7 +151,7 @@ abstract class Request implements RequestInterface | @@ -141,7 +151,7 @@ abstract class Request implements RequestInterface | ||
| 141 | } | 151 | } |
| 142 | 152 | ||
| 143 | /** | 153 | /** |
| 144 | - * @return $this | 154 | + * @inheritDoc |
| 145 | */ | 155 | */ |
| 146 | public function __invoke(): RequestInterface | 156 | public function __invoke(): RequestInterface |
| 147 | { | 157 | { |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace Lackoxygen\TopWarehouse; | 3 | namespace Lackoxygen\TopWarehouse; |
| 4 | 4 | ||
| 5 | use Illuminate\Support\Arr; | 5 | use Illuminate\Support\Arr; |
| 6 | +use Lackoxygen\TopWarehouse\Constants\ResponseCode; | ||
| 6 | use Lackoxygen\TopWarehouse\Contracts\ResponseInterface; | 7 | use Lackoxygen\TopWarehouse\Contracts\ResponseInterface; |
| 7 | use Lackoxygen\TopWarehouse\Utils\Json; | 8 | use Lackoxygen\TopWarehouse\Utils\Json; |
| 8 | use Psr\Http\Message\ResponseInterface as PsrResponseInterface; | 9 | use Psr\Http\Message\ResponseInterface as PsrResponseInterface; |
| @@ -24,11 +25,17 @@ class Response implements ResponseInterface | @@ -24,11 +25,17 @@ class Response implements ResponseInterface | ||
| 24 | $this->response = $response; | 25 | $this->response = $response; |
| 25 | } | 26 | } |
| 26 | 27 | ||
| 28 | + /** | ||
| 29 | + * @inheritDoc | ||
| 30 | + */ | ||
| 27 | public function getStatusCode(): int | 31 | public function getStatusCode(): int |
| 28 | { | 32 | { |
| 29 | return $this->response->getStatusCode(); | 33 | return $this->response->getStatusCode(); |
| 30 | } | 34 | } |
| 31 | 35 | ||
| 36 | + /** | ||
| 37 | + * @inheritDoc | ||
| 38 | + */ | ||
| 32 | public function isSuccess(): bool | 39 | public function isSuccess(): bool |
| 33 | { | 40 | { |
| 34 | if (200 !== $this->getStatusCode()) { | 41 | if (200 !== $this->getStatusCode()) { |
| @@ -37,19 +44,28 @@ class Response implements ResponseInterface | @@ -37,19 +44,28 @@ class Response implements ResponseInterface | ||
| 37 | 44 | ||
| 38 | $body = $this->toArray(); | 45 | $body = $this->toArray(); |
| 39 | 46 | ||
| 40 | - return Arr::get($body, 'status', 0) == 1; | 47 | + return Arr::get($body, 'status', 0) == ResponseCode::STATUS_SUCCESS; |
| 41 | } | 48 | } |
| 42 | 49 | ||
| 50 | + /** | ||
| 51 | + * @inheritDoc | ||
| 52 | + */ | ||
| 43 | public function getContents(): string | 53 | public function getContents(): string |
| 44 | { | 54 | { |
| 45 | return $this->response->getBody()->getContents(); | 55 | return $this->response->getBody()->getContents(); |
| 46 | } | 56 | } |
| 47 | 57 | ||
| 58 | + /** | ||
| 59 | + * @inheritDoc | ||
| 60 | + */ | ||
| 48 | public function toArray(): array | 61 | public function toArray(): array |
| 49 | { | 62 | { |
| 50 | return Json::decode($this->getContents()); | 63 | return Json::decode($this->getContents()); |
| 51 | } | 64 | } |
| 52 | 65 | ||
| 66 | + /** | ||
| 67 | + * @inheritDoc | ||
| 68 | + */ | ||
| 53 | public function __toString() | 69 | public function __toString() |
| 54 | { | 70 | { |
| 55 | return $this->getContents(); | 71 | return $this->getContents(); |
| @@ -9,11 +9,17 @@ use Lackoxygen\TopWarehouse\Request\OrdersB2cAddRequest; | @@ -9,11 +9,17 @@ use Lackoxygen\TopWarehouse\Request\OrdersB2cAddRequest; | ||
| 9 | 9 | ||
| 10 | class TopWarehouse implements TopWarehouseInterface | 10 | class TopWarehouse implements TopWarehouseInterface |
| 11 | { | 11 | { |
| 12 | + /** | ||
| 13 | + * @inheritDoc | ||
| 14 | + */ | ||
| 12 | public function ordersB2cAdd(OrdersB2cAddRequest $ordersB2cAddRequest): ResponseInterface | 15 | public function ordersB2cAdd(OrdersB2cAddRequest $ordersB2cAddRequest): ResponseInterface |
| 13 | { | 16 | { |
| 14 | return Client::make($ordersB2cAddRequest)->send(); | 17 | return Client::make($ordersB2cAddRequest)->send(); |
| 15 | } | 18 | } |
| 16 | 19 | ||
| 20 | + /** | ||
| 21 | + * @inheritDoc | ||
| 22 | + */ | ||
| 17 | public function getStockInventory(GetStockInventoryRequest $getStockInventoryRequest): ResponseInterface | 23 | public function getStockInventory(GetStockInventoryRequest $getStockInventoryRequest): ResponseInterface |
| 18 | { | 24 | { |
| 19 | return Client::make($getStockInventoryRequest)->send(); | 25 | return Client::make($getStockInventoryRequest)->send(); |
| @@ -3,7 +3,6 @@ | @@ -3,7 +3,6 @@ | ||
| 3 | namespace Lackoxygen\TopWarehouse; | 3 | namespace Lackoxygen\TopWarehouse; |
| 4 | 4 | ||
| 5 | use Illuminate\Support\ServiceProvider; | 5 | use Illuminate\Support\ServiceProvider; |
| 6 | -use Illuminate\Foundation\Application; | ||
| 7 | 6 | ||
| 8 | class TopWarehouseServiceProvider extends ServiceProvider | 7 | class TopWarehouseServiceProvider extends ServiceProvider |
| 9 | { | 8 | { |
| @@ -12,7 +11,6 @@ class TopWarehouseServiceProvider extends ServiceProvider | @@ -12,7 +11,6 @@ class TopWarehouseServiceProvider extends ServiceProvider | ||
| 12 | */ | 11 | */ |
| 13 | public const CONFIG_NAME = 'top-warehouse'; | 12 | public const CONFIG_NAME = 'top-warehouse'; |
| 14 | 13 | ||
| 15 | - | ||
| 16 | /** | 14 | /** |
| 17 | * @var bool | 15 | * @var bool |
| 18 | */ | 16 | */ |
| @@ -21,9 +19,7 @@ class TopWarehouseServiceProvider extends ServiceProvider | @@ -21,9 +19,7 @@ class TopWarehouseServiceProvider extends ServiceProvider | ||
| 21 | /** | 19 | /** |
| 22 | * @var array | 20 | * @var array |
| 23 | */ | 21 | */ |
| 24 | - protected $commands = [ | ||
| 25 | - | ||
| 26 | - ]; | 22 | + protected $commands = []; |
| 27 | 23 | ||
| 28 | /** | 24 | /** |
| 29 | * Register any application services. | 25 | * Register any application services. |
| @@ -40,9 +36,12 @@ class TopWarehouseServiceProvider extends ServiceProvider | @@ -40,9 +36,12 @@ class TopWarehouseServiceProvider extends ServiceProvider | ||
| 40 | $this->publishes([__DIR__ . '/../config/top-warehouse.php' => config_path('top-warehouse.php')]); | 36 | $this->publishes([__DIR__ . '/../config/top-warehouse.php' => config_path('top-warehouse.php')]); |
| 41 | } | 37 | } |
| 42 | 38 | ||
| 39 | + /** | ||
| 40 | + * @return string[] | ||
| 41 | + */ | ||
| 43 | public function provides() | 42 | public function provides() |
| 44 | { | 43 | { |
| 45 | - return []; | 44 | + return ['topWarehouse', TopWarehouse::class]; |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | } | 47 | } |
| @@ -21,15 +21,12 @@ class SignatureUtil | @@ -21,15 +21,12 @@ class SignatureUtil | ||
| 21 | case null: | 21 | case null: |
| 22 | case '': | 22 | case '': |
| 23 | break; | 23 | break; |
| 24 | - case 'string': | ||
| 25 | - if (strlen($item) > 0) { | ||
| 26 | - $string .= "{$key}{$item}"; | ||
| 27 | - } | ||
| 28 | - break; | ||
| 29 | case 'array': | 24 | case 'array': |
| 30 | $value = Json::encode($item); | 25 | $value = Json::encode($item); |
| 31 | $string .= "{$key}$value}"; | 26 | $string .= "{$key}$value}"; |
| 32 | break; | 27 | break; |
| 28 | + default: | ||
| 29 | + $string .= "{$key}{$item}"; | ||
| 33 | } | 30 | } |
| 34 | } | 31 | } |
| 35 | 32 |
-
请 注册 或 登录 后发表评论