@@ -55,9 +55,10 @@ class Order extends Base
$code = $this->createRandCode();
$ret = $this->CreateOrder($order_sn , $trunk , $cabinet_number,$code);
- if($ret['code'] != 1){
+ if($ret['code'] != 1) {
json_error(1006);
- }else{
+ }
+ else {
$alias = $cabinet['alias'];
$this->box_action_record($cabinet_number , $trunk , 1 , $order_sn , $alias);
$msg = "{$alias}柜门{$trunk}箱门,密码信息{$code}";
@@ -0,0 +1,9 @@
+127.0.0.1 localhost
+::1 localhost ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+172.22.0.3 ccbdc2e88e1a
+172.22.0.3 api.zng.com
+172.22.0.3 admin.zng.com
@@ -29,7 +29,7 @@ http
{
listen 8080;
set $folder_name /var/www/html/public;
- server_name 127.0.0.1;
+ server_name api.zng.com;
root $folder_name;
index index.html index.php;
client_max_body_size 100m;
@@ -70,4 +70,26 @@ http
include fastcgi_params;
}
+
+ server
+ {
+ listen 8080;
+ set $folder_name /var/www/html/admin;
+ server_name admin.zng.com;
+ root $folder_name;
+ index index.html index.php;
+ client_max_body_size 100m;
+ proxy_connect_timeout 500s;
+ proxy_read_timeout 500s;
+ proxy_send_timeout 500s;
+ fastcgi_connect_timeout 75;
+ fastcgi_read_timeout 600;
+ fastcgi_send_timeout 600;
+ charset utf-8;
+ location / {
+ index index.html index.htm index.php;
@@ -7,6 +7,7 @@ services:
- "8080:8080"
volumes:
- $PWD/conf/etc/localtime:/etc/localtime:ro
+ - $PWD/conf/etc/hosts:/etc/hosts:ro
- $PWD/conf/nginx/nginx-debug-http.conf:/etc/nginx/nginx.conf:ro
- $PWD:/var/www/html
links:
@@ -12,6 +12,11 @@
// [ 应用入口文件 ]
namespace think;
+header("Access-Control-Allow-Origin: http://admin.zng.com:8081");
+header("Access-Control-Allow-Methods:GET, POST, OPTIONS, DELETE");
+header("Access-Control-Allow-Credentials: true");
+header("Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type, Accept-Language, Origin, Accept-Encoding");
// 加载基础文件
require __DIR__ . '/../thinkphp/base.php';
@@ -0,0 +1,26 @@
+<?php
+namespace think;
+use PHPUnit\Framework\TestCase;
+define('BASE_ROOT_PATH',str_replace('/tests','',dirname(__FILE__)));
+define('BASE_PATH',BASE_ROOT_PATH . '/tests');
+define('APP_ID','tests');
+define('BASE_DATA_PATH',BASE_ROOT_PATH . '/data');
+require_once(BASE_ROOT_PATH . '/thinkphp/base.php');
+class TestOrder extends TestCase
+{
+ protected $baseUrl = 'http://localhost';
+ public static function setUpBeforeClass() : void
+ App::getInstance()->path(BASE_ROOT_PATH . '/application/')->initialize();
+ public function testCheckOrder()
+ $resp = http_request('http://host.docker.internal:8080/CheckOrder',['order_sn' => '123456'],'GET');
+}