123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- require_once('MyBaseController.php');
- class Home extends MyBaseController {
- public function __construct()
- {
- parent::__construct();
- if ($this->session->userinfo==null) {
- $this->redirect('/Account/logout');
- exit;
- }
- $userId = $this->input->post('userId');
- $r = $this->getNewToken($userId);
- $_POST['token'] = $r;
- // var_dump($this->session->userinfo);exit();
- }
- public function index()
- {
- $this->load->view('index');
- }
- //取当前的userid
- protected function self_user_id()
- {
- return $this->session->userinfo->userId;
- }
- //取当前的org
- protected function self_org_id()
- {
- return $this->session->userinfo->orgId;
- }
- public function queryConveyAddrList(){
- $url = $this->config->item('api_url2')."api/v1/server/ConveyAddr/queryConveyAddrList";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function ConveyDeviceLists(){
- $url = $this->config->item('api_url2')."api/v1/server/ConveyDevice/lists";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function queryUserOrdersByMode(){
- $url = $this->config->item('api_url2')."api/v1/server/Orders/queryUserOrdersByMode";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function orderYhadd(){
- $url = $this->config->item('api_url2')."api/v1/server/Orders/yhadd";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function commentYhadd(){
- $url = $this->config->item('api_url2')."api/v1/server/Comment/yhadd";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function orderQueryDetail(){
- $url = $this->config->item('api_url2')."api/v1/server/Orders/queryDetail";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function conveyCateLists(){
- $url = $this->config->item('api_url2')."api/v1/server/ConveyCate/lists";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function updateOrderModeByUser(){
- $url = $this->config->item('api_url2')."api/v1/server/Orders/updateOrderModeByUser";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function conveyXqTime(){
- $url = $this->config->item('api_url2')."api/v1/server/ConveyCate/getXqTime";
- $ret = curl_post($url,$_POST);
- header('Content-Type:application/json; charset=utf-8');
- exit($ret);
- }
- public function getNewToken($userId){
- $url = $this->config->item('api_url2')."api/v1/User/getToken";
- $ret = curl_post($url,['userId'=>$userId]);
- $data = json_decode($ret,true);
- return $data['data']['token'];
- }
- }
|