支付宝接口

This commit is contained in:
wanyongkang
2020-10-11 19:23:42 +08:00
parent ce067b91dc
commit 517b026891
1110 changed files with 139880 additions and 95 deletions

View File

@@ -9,25 +9,35 @@ namespace fastphp\base;
*/
class Controller
{
protected $_controller;
protected $_action;
// protected $_view;
public $userinfo;
//初始化属性,实例化对应模型
public function __construct($controller,$action)
{
$this->_controller = $controller;
$this->_action = $action;
// $this->_view = new View($controller,$action);
$data = json_decode(file_get_contents("php://input"),true);
$getPayload = false;
if(isset($data['cookie'])){
$cookie = explode('; ',$data['cookie']);
$token = '';
foreach($cookie as $k => $v){
$find_token = explode('=',$v);
if($find_token[0] == 'token'){
$token = $find_token[1];
break;
}
}
$jwt = new Jwt('hncore_yh_lzh_20f_2020_READY');
$getPayload=$jwt->verifyToken($token);
} else {
$jwt = new Jwt('etor_yh_lzh_20f_2020_YES');
$getPayload=$jwt->verifyToken($_SERVER['HTTP_TOKEN']);
}
if(!$getPayload){
die;
}
$this->userinfo = $getPayload;
}
// //分配变量
// public function assign($name,$value){
// $this->_view->assign($name,$value);
// }
//
// //渲染视图
// public function render(){
// $this->_view->render();
// }
}