123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\api\controller;
- use think\facade\Lang;
- /**
-
- * DSO2O多用户商城
-
- *
- * ----------------------------------------------------------------------------
- *
-
- * 控制器
- */
- class MobileChain extends MobileHome
- {
- protected $chain_info;
- public function initialize()
- {
- parent::initialize();
- Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/chain.lang.php');
- $key = request()->header('X-DS-KEY');
- if ($key) {
- $mbchaintoken_model = model('mbchaintoken');
- $chain_token = $mbchaintoken_model->getMbchaintokenInfo(array('chain_token' => $key));
- if (!$chain_token) {
- ds_json_encode(40001, lang('chain_token_expire'));
- }
- $chain_model = model('chain');
- $chain_info = $chain_model->getChainInfo(array('chain_id' => $chain_token['chain_id']));
- if (!$chain_info) {
- ds_json_encode(40001, lang('chain_not_exist'));
- }
- if (request()->action() != 'apply_again' && request()->action() != 'information') {
- if ($chain_info['chain_state'] != 1) {
- ds_json_encode(40001, lang('chain_not_open'));
- }
- }
- $this->chain_info = $chain_info;
- } else {
- ds_json_encode(10001, 'Hacking Attempt');
- }
- }
- }
|