Erptblyla.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class Erptblyla extends Lyapi_Controller
  4. {
  5. public function __construct()
  6. {
  7. parent::__construct();
  8. $this->load->_model('Model_cnev1','cnev1');
  9. }
  10. private $ip = ['127.0.0.1', '47.105.156.18'];
  11. public function feifaly(){
  12. $action = $this->input->get('lyqqff');
  13. $ip = $_SERVER['REMOTE_ADDR'];
  14. if (!in_array($ip, $this->ip)) {
  15. exit("Unauthorized access");
  16. }
  17. if($action == 'get_yunshang_token'){
  18. $this->_get_yunshang_token();
  19. }else{
  20. exit('No direct script access allowed');
  21. }
  22. exit('No direct script access allowed');
  23. }
  24. private function _get_yunshang_token(){
  25. $time = time();
  26. $time = $time."000";
  27. $token = $this->cnev1->getToken($time);
  28. if(empty($token)){
  29. $this->_json_error("获取token失败", 400,[]) ;
  30. }else{
  31. $this->_json_error("获取成功", 200,["token"=>$token]) ;
  32. }
  33. }
  34. }