1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\api\controller;
- use think\facade\Lang;
- /**
- * ============================================================================
- * DSO2O多用户商城
- * ============================================================================
- * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
- * 网站地址: https://www.valimart.net/
- * ----------------------------------------------------------------------------
- *
- * ============================================================================
- * 控制器
- */
- 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');
- }
- }
- }
- ?>
|