Erptblyla.php 1.0 KB

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