18
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
use support\Request;
|
||||
use taoser\facade\Validate;
|
||||
use app\model\Address as AddressModel;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ namespace app\api\controller;
|
||||
|
||||
use app\model\Archives as ArchivesModel;
|
||||
use support\Request;
|
||||
use taoser\facade\Validate;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ use support\Response;
|
||||
use Shopwwi\WebmanFilesystem\FilesystemFactory;
|
||||
use Shopwwi\WebmanFilesystem\Facade\Storage;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
use taoser\facade\Validate;
|
||||
use Tinywan\Validate\Facade\Validate;
|
||||
/**
|
||||
* 基础控制器
|
||||
* @Apidoc\NotParse()
|
||||
@@ -40,7 +40,7 @@ class BaseController
|
||||
*/
|
||||
protected function json(int $code, string $msg = 'ok', array|object|null $data = []): Response
|
||||
{
|
||||
return json(['code' => $code, 'data' => $data, 'msg' => $msg]);
|
||||
return json(['code' => $code, 'data' => $data, 'msg' => __($msg)]);
|
||||
}
|
||||
|
||||
protected function success(string $msg = '成功', array|object|null $data = []): Response
|
||||
|
||||
@@ -5,7 +5,6 @@ use app\model\Card as CardModel;
|
||||
use app\model\Cdkey as CdkeyModel;
|
||||
use app\model\User as UserModel;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace app\api\controller;
|
||||
|
||||
use taoser\facade\Validate;
|
||||
use Tinywan\Validate\Facade\Validate;
|
||||
use app\model\User as UserModel;
|
||||
|
||||
use support\Request;
|
||||
@@ -29,7 +29,6 @@ class CommonController extends BaseController{
|
||||
*/
|
||||
public $noNeedLogin = ['*'];
|
||||
|
||||
|
||||
/**
|
||||
* 加载初始化
|
||||
*
|
||||
@@ -37,7 +36,7 @@ class CommonController extends BaseController{
|
||||
*/
|
||||
public function init(Request $request)
|
||||
{
|
||||
$lang = input('lang','en-US');
|
||||
$lang = $request->header('lang','zh-Hans');
|
||||
locale( $lang);
|
||||
$config = Config('site');
|
||||
$disallowFields = [
|
||||
|
||||
@@ -5,7 +5,6 @@ use app\model\UserRemark as UserRemarkModel;
|
||||
use app\model\GroupRemark as GroupRemarkModel;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use taoser\facade\Validate;
|
||||
use support\think\Db;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,6 @@ use app\model\FriendCircleLike as FriendCircleLikeModel;
|
||||
use app\model\FriendCircleComment as FriendCircleCommentModel;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use taoser\facade\Validate;
|
||||
use support\think\Db;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ use app\model\UserRemark as UserRemarkModel;
|
||||
use app\model\GroupRemark as GroupRemarkModel;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use taoser\facade\Validate;
|
||||
use support\think\Db;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,6 @@ use app\model\Gift as GiftModel;
|
||||
use app\model\GiftOrder as GiftOrderModel;
|
||||
use app\model\User as UserModel;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ namespace app\api\controller;
|
||||
use app\model\User as UserModel;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use taoser\facade\Validate;
|
||||
use support\think\Db;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace app\api\controller;
|
||||
use app\model\Product as ProductModel;
|
||||
use app\model\ProductOrder as ProductOrderModel;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,6 @@ use app\model\ProductOrder as ProductOrderModel;
|
||||
use app\model\Product as ProductModel;
|
||||
use app\model\User as UserModel;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,6 @@ namespace app\api\controller;
|
||||
|
||||
use support\Request;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use app\model\Recharge as RechargeModel;
|
||||
use app\model\User as UserModel;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
@@ -6,7 +6,6 @@ use app\model\User as UserModel;
|
||||
use app\model\Realname as RealnameModel;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use taoser\facade\Validate;
|
||||
use support\think\Db;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ namespace app\api\controller;
|
||||
use app\model\User as UserModel;
|
||||
use support\Request;
|
||||
use app\model\Cdkey as CdkeyModel;
|
||||
use taoser\facade\Validate;
|
||||
use support\think\Db;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use app\model\User as UserModel;
|
||||
use app\model\Withdrawl as WithdrawlModel;
|
||||
use support\Request;
|
||||
use support\think\Db;
|
||||
use taoser\facade\Validate;
|
||||
use hg\apidoc\annotation as Apidoc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ class Auth implements MiddlewareInterface
|
||||
$response = response('',204,$headers);
|
||||
return $response;
|
||||
}
|
||||
$lang = $request->input('lang','zh-Hans');
|
||||
$lang = $request->header('lang','zh-Hans');
|
||||
locale($lang);
|
||||
if ($request->controller) {
|
||||
$request->client = $request->header('client',"web");
|
||||
|
||||
Reference in New Issue
Block a user