lvhao пре 4 часа
родитељ
комит
50f836f1c0

+ 39 - 0
core/CoreApp/controllers/Lyerpapi/v2/Erptblyla.php

@@ -0,0 +1,39 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Skutoysjm extends Lyapi_Controller
+{
+    public function __construct()
+    {
+          $this->load->_model('Model_cnev1','cnev1');
+    }
+
+    private $ip = ['127.0.0.1', '47.105.156.18'];
+
+    public function feifaly(){
+        $action = $this->input->get('lyqqff');
+
+        $ip = $_SERVER['REMOTE_ADDR'];
+
+        if (!in_array($ip, $this->ip)) {
+            exit("Unauthorized access");
+        }
+
+        if($action == 'get_yunshang_token'){
+             $this->_get_yunshang_token();   
+        }else{
+            exit('No direct script access allowed');
+        }
+        exit('No direct script access allowed');
+    }
+    private function _get_yunshang_token(){
+        $time = time();
+        $time = $time."000";
+        $token = $this->cnev1->getToken($time);
+        if(empty($token)){
+            $this->_json_error("获取token失败", 400,[]) ;
+        }else{
+             $this->_json_error("获取成功", 200,["token"=>$token]) ;
+        }
+    }
+}

+ 2 - 1
core/CoreApp/core/Lin_Controller.php

@@ -194,7 +194,8 @@ abstract class Lyapi_Controller extends CI_Controller {
 			"lyapi/v1/wechat/wxlogin",
 			"lyapi/v1/yyys/lyysmsghz",
 			"lyapi/v2/skutoysjm/getlist",
-			"lyapi/v2/skutoysjm/getorderlist"
+			"lyapi/v2/skutoysjm/getorderlist",
+			"lyapi/v2/erptblyla/feifaly"
 		 ];
 		 if(!in_array($uri_path,$allow_arr)){
 			$this->_check_api_auth();