Compare commits
7 Commits
cbf3c44f14
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c80725bb4a | ||
|
|
2efa163483 | ||
|
|
abb3584262 | ||
| 5a1d44095c | |||
| 2649b20dae | |||
| aea1718fd0 | |||
| 79641f01ee |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1 +1,5 @@
|
|||||||
*.csv
|
*.csv
|
||||||
|
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
.volumes/
|
||||||
3
Dockerfile
Normal file
3
Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
FROM php:7.3-fpm-alpine
|
||||||
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
||||||
|
RUN docker-php-ext-install pdo_mysql mysqli
|
||||||
@@ -71,11 +71,19 @@ class Index
|
|||||||
$user_model = new UserModel();
|
$user_model = new UserModel();
|
||||||
$is_exit = $user_model->getOne(['Phone' => $phone]);
|
$is_exit = $user_model->getOne(['Phone' => $phone]);
|
||||||
if($is_exit) {
|
if($is_exit) {
|
||||||
$return_data = [
|
if ($is_exit['is_verify'] == 0) {
|
||||||
'code' => 0,
|
$data_user_old = [
|
||||||
'msg' => '用户已经存在'
|
'LoginCode' => $is_exit['LoginCode'].'-del',
|
||||||
];
|
'Phone' => $is_exit['Phone'].'-del',
|
||||||
echo json_encode($return_data);die;
|
];
|
||||||
|
|
||||||
|
$user_model->updateOne(['Id'=>$is_exit['Id']],$data_user_old);
|
||||||
|
}
|
||||||
|
// $return_data = [
|
||||||
|
// 'code' => 0,
|
||||||
|
// 'msg' => '用户已经存在'
|
||||||
|
// ];
|
||||||
|
// echo json_encode($return_data);die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -206,6 +214,105 @@ class Index
|
|||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//推广用户注册
|
||||||
|
public function apiregister()
|
||||||
|
{
|
||||||
|
$data = $_GET;
|
||||||
|
// dump($data);die;
|
||||||
|
|
||||||
|
unset($data['s']);
|
||||||
|
$data['LoginCode'] = trim($data['LoginCode']);
|
||||||
|
|
||||||
|
if(empty($data['LoginCode'])){
|
||||||
|
$info = [
|
||||||
|
'Code' => 10003,
|
||||||
|
'Data' => '',
|
||||||
|
'Message' => '账号为空',
|
||||||
|
];
|
||||||
|
echo json_encode($info);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
//----
|
||||||
|
|
||||||
|
if(empty($data['agent_id'])){
|
||||||
|
$info = [
|
||||||
|
'Code' => 10003,
|
||||||
|
'Data' => '',
|
||||||
|
'Message' => '代理id错误',
|
||||||
|
];
|
||||||
|
echo json_encode($info);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['agent_id'] = base64_decode($data['agent_id']);
|
||||||
|
|
||||||
|
if ($data['agent_id']<10000) {
|
||||||
|
$info = [
|
||||||
|
'Code' => 10003,
|
||||||
|
'Data' => '',
|
||||||
|
'Message' => '代理id错误',
|
||||||
|
];
|
||||||
|
echo json_encode($info);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
// dump($data);die;
|
||||||
|
|
||||||
|
$data['Phone'] = $data['LoginCode'];
|
||||||
|
$data['TenantId'] = 0;
|
||||||
|
$data['Enabled'] = 1;
|
||||||
|
$data['UpdateTime'] = date('Y-m-d H:i:s',time());
|
||||||
|
$data['CreateTime'] = date('Y-m-d H:i:s',time());
|
||||||
|
$data['CreateType'] = 4;
|
||||||
|
$data['ProductAccountCount'] = 0;
|
||||||
|
$data['ExpiredProductAccountCount'] = 0;
|
||||||
|
$data['RestAmount'] = 0;
|
||||||
|
$data['ConsumeAmount'] = 0;
|
||||||
|
$data['DeleteTag'] = 0;
|
||||||
|
$data['UseTestCount'] = 0;
|
||||||
|
$data['Sex'] = 0;
|
||||||
|
$data['Wx'] = '';
|
||||||
|
$data['QQ'] = '';
|
||||||
|
$data['LastLoginDate'] = date('Y-m-d H:i:s',time());
|
||||||
|
$data['Password'] = empty($data['Password'])?cToMd5('123568'):cToMd5(trim($data['Password']));
|
||||||
|
|
||||||
|
$user_model = new UserModel;
|
||||||
|
$data['ManagerId'] = 0;
|
||||||
|
|
||||||
|
$has_user = $user_model->isExit("LoginCode='".$data['LoginCode']."' or Phone='".$data['Phone']."' or TaoBao='".$data['Phone']."'");
|
||||||
|
if ($has_user){
|
||||||
|
if ($has_user['is_verify'] == 0) {
|
||||||
|
$data_user_old = [
|
||||||
|
'LoginCode' => $has_user['LoginCode'].'-del',
|
||||||
|
'Phone' => $has_user['Phone'].'-del',
|
||||||
|
];
|
||||||
|
|
||||||
|
$user_model->updateOne(['Id'=>$has_user['Id']],$data_user_old);
|
||||||
|
} else {
|
||||||
|
$info = [
|
||||||
|
'Code' => 20000,
|
||||||
|
'Data' => '',
|
||||||
|
'Message' => '该账号或者手机号被注册了',
|
||||||
|
];
|
||||||
|
echo json_encode($info);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user_model->add($data)) {
|
||||||
|
$info = [
|
||||||
|
'Code' => 10000,
|
||||||
|
'Data' => '',
|
||||||
|
'Message' => '该账号注册成功!',
|
||||||
|
];
|
||||||
|
echo json_encode($info);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
die;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private function getCred(){
|
private function getCred(){
|
||||||
$ak = "JDC_A3B38E573D7404F976472FB42F52";
|
$ak = "JDC_A3B38E573D7404F976472FB42F52";
|
||||||
$sk = "C9BAE98F49B42DA2DC02868A75AA3AD8";
|
$sk = "C9BAE98F49B42DA2DC02868A75AA3AD8";
|
||||||
|
|||||||
@@ -308,7 +308,48 @@ class Order extends Controller
|
|||||||
|
|
||||||
switch ($data['order_type']) {
|
switch ($data['order_type']) {
|
||||||
case 2:
|
case 2:
|
||||||
$data['money'] = round($data['data']['periodAmount'] * $price['price'],2);
|
$peroid = $data['data']['periodAmount'];
|
||||||
|
|
||||||
|
$whitelist = 0;
|
||||||
|
if (isset($data['renew'])) {
|
||||||
|
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist/maxAmount';
|
||||||
|
$req = formatHttpRequert([
|
||||||
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$resp = json_decode(linkcurl($url, 'POST', $req, [], 0));
|
||||||
|
if ($resp->s < 0) {
|
||||||
|
return [
|
||||||
|
'code'=>-1,
|
||||||
|
'data' => $resp,
|
||||||
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$whitelist = $resp->d->maxAmount;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!isset($data['data']['maxWhitelist'])) {
|
||||||
|
return [
|
||||||
|
'code'=>-2,
|
||||||
|
'data' => '',
|
||||||
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$whitelist = $data['data']['maxWhitelist'];
|
||||||
|
}
|
||||||
|
if ($whitelist == 0) {
|
||||||
|
return [
|
||||||
|
'code'=>-3,
|
||||||
|
'data' => '',
|
||||||
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$discount = max(.6, 1 - .1 * ($whitelist -1)); // 每多一个白名单配额就减 1 折,最低 6 折
|
||||||
|
$data['money'] = round($price['price'] * $peroid * $whitelist * $discount, 2);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$data['money'] = round(($data['data']['periodAmount'] * $price['price'] * $data['data']['ipAmount']),2);
|
$data['money'] = round(($data['data']['periodAmount'] * $price['price'] * $data['data']['ipAmount']),2);
|
||||||
@@ -342,13 +383,22 @@ class Order extends Controller
|
|||||||
if ($order_model->add($order_data)) {
|
if ($order_model->add($order_data)) {
|
||||||
$url = $http_url;
|
$url = $http_url;
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
if ($url == $this->url_root . '/user/pack/renew') {
|
||||||
|
$request_data = [
|
||||||
|
'sgUserId' => $request_data['sgUserId'],
|
||||||
|
'packId' => $request_data['packId'],
|
||||||
|
'packType' => $request_data['packType'],
|
||||||
|
'periodType' => $request_data['periodType'],
|
||||||
|
'periodAmount' => $request_data['periodAmount'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
$http_data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$http_data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
||||||
|
|
||||||
if ($http_data->s < 0) {
|
if ($http_data->s < 0) {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-7,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '请求后台失败,请联系客服!'
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
];
|
];
|
||||||
@@ -369,7 +419,7 @@ class Order extends Controller
|
|||||||
|
|
||||||
if ($http_order_data->s < 0) {
|
if ($http_order_data->s < 0) {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-8,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '请求后台失败,请联系客服!'
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
];
|
];
|
||||||
@@ -393,7 +443,7 @@ class Order extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-6,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '请求后台失败,请联系客服!'
|
'msg' => '请求后台失败,请联系客服!'
|
||||||
];
|
];
|
||||||
@@ -402,7 +452,7 @@ class Order extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-5,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '聚币不足!'
|
'msg' => '聚币不足!'
|
||||||
];
|
];
|
||||||
@@ -411,7 +461,7 @@ class Order extends Controller
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
$info = [
|
$info = [
|
||||||
'code'=>-1,
|
'code'=>-4,
|
||||||
'data' => '非法参数',
|
'data' => '非法参数',
|
||||||
'msg' => '聚币不足!'
|
'msg' => '聚币不足!'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -8,16 +8,14 @@ use app\http\model\Order as OrderModel;
|
|||||||
use enum\http\Order as HttpOrderEnum;
|
use enum\http\Order as HttpOrderEnum;
|
||||||
use app\http\model\Recharge as RechargeModel;
|
use app\http\model\Recharge as RechargeModel;
|
||||||
|
|
||||||
class User extends Controller
|
class User extends Controller {
|
||||||
{
|
|
||||||
// private $url_root = 'https://sandbox.sgxz.cn';
|
// private $url_root = 'https://sandbox.sgxz.cn';
|
||||||
private $url_root = 'https://merchant.sgxz.cn';
|
private $url_root = 'https://merchant.sgxz.cn';
|
||||||
|
|
||||||
private $http_user_info = [];
|
private $http_user_info = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct() {
|
||||||
{
|
parent::__construct('', '');
|
||||||
parent::__construct('','');
|
|
||||||
if (empty($this->userinfo['UserId'])) {
|
if (empty($this->userinfo['UserId'])) {
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
@@ -31,11 +29,11 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/detail';
|
$url = $this->url_root . '/user/detail';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
|
||||||
$user_data = [
|
$user_data = [
|
||||||
'uid' => $this->http_user_info['sgUserId'],
|
'uid' => $this->http_user_info['sgUserId'],
|
||||||
@@ -83,21 +81,21 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/short/pack/list';
|
$url = $this->url_root . '/user/short/pack/list';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$list = array_merge($data->d->packs->period,$data->d->packs->unlimited,$data->d->packs->usage);
|
$list = array_merge($data->d->packs->period, $data->d->packs->unlimited, $data->d->packs->usage);
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info->name = HttpOrderEnum::$package_type[ $info->planType];
|
$info->name = HttpOrderEnum::$package_type[$info->planType];
|
||||||
$info->durationType2 = $info->durationType;
|
$info->durationType2 = $info->durationType;
|
||||||
$info->durationType = HttpOrderEnum::$durationType[ $info->durationType];
|
$info->durationType = HttpOrderEnum::$durationType[$info->durationType];
|
||||||
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
|
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
|
||||||
$info->isExpired = $info->isExpired?'已过期':'未过期';
|
$info->isExpired = $info->isExpired ? '已过期' : '未过期';
|
||||||
$info->ipAmount = $info->ipAmount?:'无限量';
|
$info->ipAmount = $info->ipAmount ?: '无限量';
|
||||||
$info->remainingAmount = $info->remainingAmount?:'无限量';
|
$info->remainingAmount = $info->remainingAmount ?: '无限量';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -107,14 +105,13 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//短效全部套餐
|
//短效全部套餐
|
||||||
public function dx_order() {
|
public function dx_order() {
|
||||||
$order_model = new OrderModel();
|
$order_model = new OrderModel();
|
||||||
$order_where = [
|
$order_where = [
|
||||||
'package_type' => ['in',HttpOrderEnum::$package_list],
|
'package_type' => ['in', HttpOrderEnum::$package_list],
|
||||||
'order_status' => HttpOrderEnum::$pay_yes,
|
'order_status' => HttpOrderEnum::$pay_yes,
|
||||||
'user_id' => $this->userinfo['UserId']
|
'user_id' => $this->userinfo['UserId']
|
||||||
];
|
];
|
||||||
@@ -123,7 +120,7 @@ class User extends Controller
|
|||||||
foreach ($order_list as &$info) {
|
foreach ($order_list as &$info) {
|
||||||
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
||||||
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
|
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
|
||||||
$info['durationType'] = HttpOrderEnum::$durationType[ $info['durationType']];
|
$info['durationType'] = HttpOrderEnum::$durationType[$info['durationType']];
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -140,11 +137,11 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/short/ip/used/summary';
|
$url = $this->url_root . '/user/short/ip/used/summary';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$return_data = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'data' => $data->d,
|
'data' => $data->d,
|
||||||
@@ -152,28 +149,27 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
//用户短效每日使用情况查询
|
//用户短效每日使用情况查询
|
||||||
public function dx_used_log() {
|
public function dx_used_log() {
|
||||||
|
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
'page' => isset($request_data['page'])?$request_data['page']:1,
|
'page' => isset($request_data['page']) ? $request_data['page'] : 1,
|
||||||
'limit' => 50,
|
'limit' => 50,
|
||||||
'packType' => $request_data['packType'],
|
'packType' => $request_data['packType'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/short/ip/used/list';
|
$url = $this->url_root . '/user/short/ip/used/list';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
|
||||||
foreach ($data->d->items as &$info) {
|
foreach ($data->d->items as &$info) {
|
||||||
$info->packType = HttpOrderEnum::$package_type[$info->packType];
|
$info->packType = HttpOrderEnum::$package_type[$info->packType];
|
||||||
$info->createTime = date('Y-m-d H:i:s',$info->createTime);
|
$info->createTime = date('Y-m-d H:i:s', $info->createTime);
|
||||||
}
|
}
|
||||||
$return_data = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
@@ -182,14 +178,13 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//长效ip列表
|
//长效ip列表
|
||||||
public function lang_ip_list() {
|
public function lang_ip_list() {
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
$url = $this->url_root.'/user/long/ip/list';
|
$url = $this->url_root . '/user/long/ip/list';
|
||||||
|
|
||||||
foreach ($request_data as $key => &$info) {
|
foreach ($request_data as $key => &$info) {
|
||||||
if (strlen($info) == 0) {
|
if (strlen($info) == 0) {
|
||||||
@@ -199,7 +194,7 @@ class User extends Controller
|
|||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
|
||||||
$line_status = [
|
$line_status = [
|
||||||
'1' => '正常',
|
'1' => '正常',
|
||||||
@@ -209,10 +204,10 @@ class User extends Controller
|
|||||||
|
|
||||||
foreach ($data->d->items as &$info) {
|
foreach ($data->d->items as &$info) {
|
||||||
$info->lineType2 = $info->lineType;
|
$info->lineType2 = $info->lineType;
|
||||||
$info->lineType = ($info->lineType == 1)?'普通':'优质';
|
$info->lineType = ($info->lineType == 1) ? '普通' : '优质';
|
||||||
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
|
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
|
||||||
$info->shareType2 = $info->shareType;
|
$info->shareType2 = $info->shareType;
|
||||||
$info->shareType = ($info->shareType == 1)?'共享':'独享';
|
$info->shareType = ($info->shareType == 1) ? '共享' : '独享';
|
||||||
$info->state = $line_status[$info->state];
|
$info->state = $line_status[$info->state];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,25 +220,25 @@ class User extends Controller
|
|||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//长效全部套餐
|
//长效全部套餐
|
||||||
public function cx_package() {
|
public function cx_package() {
|
||||||
$list = [];
|
$list = [];
|
||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/long/pack/list';
|
$url = $this->url_root . '/user/long/pack/list';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$list = array_merge($data->d->packs);
|
$list = array_merge($data->d->packs);
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info->isAbroad2 = $info->isAbroad;
|
$info->isAbroad2 = $info->isAbroad;
|
||||||
$info->isAbroad = HttpOrderEnum::$game_type[ $info->isAbroad];
|
$info->isAbroad = HttpOrderEnum::$game_type[$info->isAbroad];
|
||||||
$info->expireTime = date('Y-m-d H:i:s',$info->expireTime);
|
$info->expireTime = date('Y-m-d H:i:s', $info->expireTime);
|
||||||
$info->isExpired = $info->isExpired?'已过期':'未过期';
|
$info->isExpired = $info->isExpired ? '已过期' : '未过期';
|
||||||
$info->shareType = ($info->shareType == 1) ?'共享':'独享';
|
$info->shareType = ($info->shareType == 1) ? '共享' : '独享';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -253,7 +248,6 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($return_data);
|
echo json_encode($return_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//长效全部订单
|
//长效全部订单
|
||||||
@@ -270,7 +264,7 @@ class User extends Controller
|
|||||||
foreach ($order_list as &$info) {
|
foreach ($order_list as &$info) {
|
||||||
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
$info['order_type'] = HttpOrderEnum::$order_type[$info['order_type']];
|
||||||
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
|
$info['package_type'] = HttpOrderEnum::$package_type[$info['package_type']];
|
||||||
$info['game_type'] = HttpOrderEnum::$game_type[ $info['game_type']];
|
$info['game_type'] = HttpOrderEnum::$game_type[$info['game_type']];
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -285,18 +279,18 @@ class User extends Controller
|
|||||||
//长效ip切换记录
|
//长效ip切换记录
|
||||||
public function cx_switch() {
|
public function cx_switch() {
|
||||||
ini_set('display_errors', 'off');
|
ini_set('display_errors', 'off');
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
'page' => isset($request_data['page'])?$request_data['page']:1,
|
'page' => isset($request_data['page']) ? $request_data['page'] : 1,
|
||||||
'limit' => 50,
|
'limit' => 50,
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/long/switch/ip/log';
|
$url = $this->url_root . '/user/long/switch/ip/log';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
|
||||||
//切换原因,0-系统自动切换,1-失效手动切换,2-免费手动切换,5-管理员免费切换,6-收费手动切换
|
//切换原因,0-系统自动切换,1-失效手动切换,2-免费手动切换,5-管理员免费切换,6-收费手动切换
|
||||||
$reason = [
|
$reason = [
|
||||||
@@ -308,7 +302,7 @@ class User extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
foreach ($data->d->items as &$info) {
|
foreach ($data->d->items as &$info) {
|
||||||
$info->createTime = date('Y-m-d H:i:s',$info->createTime);
|
$info->createTime = date('Y-m-d H:i:s', $info->createTime);
|
||||||
$info->reason = $reason[$info->reason];
|
$info->reason = $reason[$info->reason];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -327,15 +321,15 @@ class User extends Controller
|
|||||||
$request_data = [
|
$request_data = [
|
||||||
'sgUserId' => $this->http_user_info['sgUserId'],
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
];
|
];
|
||||||
$url = $this->url_root.'/user/short/whitelist';
|
$url = $this->url_root . '/user/short/whitelist';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$list = $data->d->items;
|
$list = $data->d->items;
|
||||||
|
|
||||||
foreach ($list as &$info) {
|
foreach ($list as &$info) {
|
||||||
$info->isLocked = $info->isLocked?'已锁定':'未锁定';
|
$info->isLocked = $info->isLocked ? '已锁定' : '未锁定';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@@ -349,15 +343,15 @@ class User extends Controller
|
|||||||
|
|
||||||
//用户创建白名单
|
//用户创建白名单
|
||||||
public function create_white_ip() {
|
public function create_white_ip() {
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
$url = $this->url_root.'/user/short/whitelist/create';
|
$url = $this->url_root . '/user/short/whitelist/create';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$return_data = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
@@ -368,15 +362,15 @@ class User extends Controller
|
|||||||
|
|
||||||
//用户锁定ip
|
//用户锁定ip
|
||||||
public function lock_ip() {
|
public function lock_ip() {
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
$url = $this->url_root.'/user/short/whitelist/lock';
|
$url = $this->url_root . '/user/short/whitelist/lock';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$return_data = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
@@ -387,15 +381,15 @@ class User extends Controller
|
|||||||
|
|
||||||
//用户删除ip
|
//用户删除ip
|
||||||
public function delete_ip() {
|
public function delete_ip() {
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
$url = $this->url_root.'/user/short/whitelist/delete';
|
$url = $this->url_root . '/user/short/whitelist/delete';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
$data = json_decode(linkcurl($url,'POST',$request_data,[],0));
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
$return_data = [
|
$return_data = [
|
||||||
'code' => 1,
|
'code' => 1,
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
@@ -405,17 +399,168 @@ class User extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
//提取长效ip
|
//提取长效ip
|
||||||
public function get_lang_ip(){
|
public function get_lang_ip() {
|
||||||
$request_data = json_decode(file_get_contents("php://input"),true)['data'];
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
$request_data['ids'] = trim($request_data['ids'],',');
|
$request_data['ids'] = trim($request_data['ids'], ',');
|
||||||
|
|
||||||
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
$url = $this->url_root.'/user/long/ip/batch/get';
|
$url = $this->url_root . '/user/long/ip/batch/get';
|
||||||
|
|
||||||
$request_data = formatHttpRequert($request_data);
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
echo(linkcurl($url,'GET',$request_data,[],0));
|
echo (linkcurl($url, 'GET', $request_data, [], 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 短效无限量白名单列表
|
||||||
|
public function white_list_su() {
|
||||||
|
$list = [];
|
||||||
|
$request_data = [
|
||||||
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
|
];
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist';
|
||||||
|
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
if ($data->s < 0) {
|
||||||
|
echo json_encode([
|
||||||
|
'code' => 0,
|
||||||
|
'msg' => $data->m,
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = $data->d->items;
|
||||||
|
foreach ($list as &$info) {
|
||||||
|
$info->isLocked = $info->isLocked ? '已锁定' : '未锁定';
|
||||||
|
}
|
||||||
|
|
||||||
|
$return_data = [
|
||||||
|
'code' => 1,
|
||||||
|
'data' => $list,
|
||||||
|
'msg' => '',
|
||||||
|
];
|
||||||
|
|
||||||
|
echo json_encode($return_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 短效无限量白名单创建
|
||||||
|
public function create_white_ip_su() {
|
||||||
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist/create';
|
||||||
|
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
$return_data = [
|
||||||
|
'code' => 1,
|
||||||
|
'msg' => '',
|
||||||
|
];
|
||||||
|
|
||||||
|
echo json_encode($return_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 短效无限量白名单删除
|
||||||
|
public function delete_ip_su() {
|
||||||
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist/delete';
|
||||||
|
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
$return_data = [
|
||||||
|
'code' => 1,
|
||||||
|
'msg' => '',
|
||||||
|
];
|
||||||
|
|
||||||
|
echo json_encode($return_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 短效无限量白名单切换锁定
|
||||||
|
public function lock_ip_su() {
|
||||||
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
|
||||||
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist/lock';
|
||||||
|
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
$return_data = [
|
||||||
|
'code' => 1,
|
||||||
|
'msg' => '',
|
||||||
|
];
|
||||||
|
|
||||||
|
echo json_encode($return_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 短效无限量白名单查询上限
|
||||||
|
public function white_limit_get_su() {
|
||||||
|
$request_data = [
|
||||||
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
|
];
|
||||||
|
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist/maxAmount';
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
|
$data = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
echo json_encode([
|
||||||
|
'code' => 1,
|
||||||
|
'data' => $data->d->maxAmount,
|
||||||
|
'msg' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 短效无限量白名单修改上限
|
||||||
|
public function white_limit_set_su() {
|
||||||
|
$request_data = json_decode(file_get_contents("php://input"), true)['data'];
|
||||||
|
$request_data['sgUserId'] = $this->http_user_info['sgUserId'];
|
||||||
|
|
||||||
|
$url = $this->url_root . '/user/short/unlimited/whitelist/edit/maxAmount';
|
||||||
|
$request_data = formatHttpRequert($request_data);
|
||||||
|
|
||||||
|
$resp = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
if ($resp->s < 0) {
|
||||||
|
echo json_encode([
|
||||||
|
'code' => -1,
|
||||||
|
'msg' => $resp->m,
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode([
|
||||||
|
'code' => 1,
|
||||||
|
'data' => $resp,
|
||||||
|
'msg' => '',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户短效当前可用的无限量套餐详情
|
||||||
|
public function get_unlimited_available() {
|
||||||
|
$url = $this->url_root . '/user/short/pack/unlimited/available';
|
||||||
|
$request_data = formatHttpRequert([
|
||||||
|
'sgUserId' => $this->http_user_info['sgUserId'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
$resp = json_decode(linkcurl($url, 'POST', $request_data, [], 0));
|
||||||
|
if ($resp->s < 0) {
|
||||||
|
echo json_encode([
|
||||||
|
'code' => -1,
|
||||||
|
'msg' => $resp->m,
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode([
|
||||||
|
'code' => 1,
|
||||||
|
'data' => $resp->d,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,7 @@ class Package extends Model
|
|||||||
$where = $data['data'];
|
$where = $data['data'];
|
||||||
$where['package_type'] = HttpOrderEnum::$dxwxl;
|
$where['package_type'] = HttpOrderEnum::$dxwxl;
|
||||||
$where['periodAmount'] = 1;
|
$where['periodAmount'] = 1;
|
||||||
|
unset($where['maxWhitelist']);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$where = $data['data'];
|
$where = $data['data'];
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ use app\jinyou\model\Package as PackageModel;
|
|||||||
use app\jinyou\model\PriceScheme as SchemeModel;
|
use app\jinyou\model\PriceScheme as SchemeModel;
|
||||||
use app\jinyou\model\UserPrice as UserPriceModel;
|
use app\jinyou\model\UserPrice as UserPriceModel;
|
||||||
use app\jinyou\model\ProductOrder as ProductOrderModel;
|
use app\jinyou\model\ProductOrder as ProductOrderModel;
|
||||||
|
use app\jinyou\model\ProductAccount as ProductAccountModel;
|
||||||
use enum\order\ProductOrder as OrderEnum;
|
use enum\order\ProductOrder as OrderEnum;
|
||||||
use app\user\model\UserScore as UserScore;
|
use app\user\model\UserScore as UserScore;
|
||||||
use app\jinyou\model\Account as AccountModel;
|
use app\jinyou\model\Account as AccountModel;
|
||||||
@@ -74,11 +75,11 @@ class Jinyoujt extends Controller
|
|||||||
$user_model = new UserModel;
|
$user_model = new UserModel;
|
||||||
$jinyoujingtai = new Jinyoujingtai;
|
$jinyoujingtai = new Jinyoujingtai;
|
||||||
$package_model = new PackageModel;
|
$package_model = new PackageModel;
|
||||||
|
$product_account = new ProductAccountModel;
|
||||||
$user_update_info = [];
|
$user_update_info = [];
|
||||||
|
|
||||||
$user_info = $user_model->getOne(['Id' => $this->userinfo['UserId']]);
|
$user_info = $user_model->getOne(['Id' => $this->userinfo['UserId']]);
|
||||||
|
|
||||||
|
|
||||||
//套餐详情
|
//套餐详情
|
||||||
$package_info = $package_model->getOne(['Id' => $request_data['package_id']]);
|
$package_info = $package_model->getOne(['Id' => $request_data['package_id']]);
|
||||||
|
|
||||||
@@ -117,6 +118,20 @@ class Jinyoujt extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
//判断账号是否存在
|
//判断账号是否存在
|
||||||
|
$timezone = new \DateTimeZone('Asia/Shanghai');
|
||||||
|
$datetime = new \DateTime('now', $timezone); // 确保是东八区时间
|
||||||
|
$account_result = $product_account->getCount([
|
||||||
|
'ProductId' => $package_info['ProductId'],
|
||||||
|
'Account' => $request_data['account'],
|
||||||
|
'EndTime' => ['>',$datetime->format('Y-m-d H:i:s')]
|
||||||
|
]);
|
||||||
|
if($account_result['count'] > 0){
|
||||||
|
$return_data['code'] = -1;
|
||||||
|
$return_data['msg'] = "账号已经存在!";
|
||||||
|
echo json_encode($return_data);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
$exist = $jinyoujingtai::checkVpnAccountExists($request_data['account'],$request_data['type']);
|
$exist = $jinyoujingtai::checkVpnAccountExists($request_data['account'],$request_data['type']);
|
||||||
if($exist->code != 200){
|
if($exist->code != 200){
|
||||||
$return_data['code'] = -1;
|
$return_data['code'] = -1;
|
||||||
|
|||||||
10
app/jinyou/model/ProductAccount.php
Normal file
10
app/jinyou/model/ProductAccount.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\jinyou\model;
|
||||||
|
|
||||||
|
use fastphp\base\Model;
|
||||||
|
|
||||||
|
class ProductAccount extends Model
|
||||||
|
{
|
||||||
|
protected $table = "product_account";
|
||||||
|
}
|
||||||
49
docker-compose.yaml
Normal file
49
docker-compose.yaml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
name: juipphp
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.0.21
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: 123456789
|
||||||
|
MYSQL_DATABASE: hualianyun
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
command: --default-authentication-plugin=mysql_native_password
|
||||||
|
volumes:
|
||||||
|
- ./.volumes/mysql:/var/lib/mysql
|
||||||
|
|
||||||
|
php:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./alipay:/var/www/html/alipay
|
||||||
|
- ./app:/var/www/html/app
|
||||||
|
- ./config:/var/www/html/config
|
||||||
|
- ./enum:/var/www/html/enum
|
||||||
|
- ./extends:/var/www/html/extends
|
||||||
|
- ./fastphp:/var/www/html/fastphp
|
||||||
|
- ./script:/var/www/html/script
|
||||||
|
- ./vendor:/var/www/html/vendor
|
||||||
|
- ./.htaccess:/var/www/html/.htaccess
|
||||||
|
- ./index.php:/var/www/html/index.php
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine
|
||||||
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/conf.d/app.conf
|
||||||
|
- ./alipay:/var/www/html/alipay
|
||||||
|
- ./app:/var/www/html/app
|
||||||
|
- ./config:/var/www/html/config
|
||||||
|
- ./enum:/var/www/html/enum
|
||||||
|
- ./extends:/var/www/html/extends
|
||||||
|
- ./fastphp:/var/www/html/fastphp
|
||||||
|
- ./script:/var/www/html/script
|
||||||
|
- ./vendor:/var/www/html/vendor
|
||||||
|
- ./.htaccess:/var/www/html/.htaccess
|
||||||
|
- ./index.php:/var/www/html/index.php
|
||||||
|
ports:
|
||||||
|
- 9000:9000
|
||||||
33
nginx.conf
Normal file
33
nginx.conf
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
server {
|
||||||
|
listen 9000;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
# CORS
|
||||||
|
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
|
||||||
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||||
|
|
||||||
|
# pre-flight requests
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
|
||||||
|
index index.php;
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
location ~ \.php(.*)$ {
|
||||||
|
fastcgi_pass php:9000;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param PATH_INFO $1;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
if (!-e $request_filename) {
|
||||||
|
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
|
||||||
|
rewrite ^(.*)$ /index.php?s=$1 last;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user