微擎常量+请求

2019-04-03  本文已影响0人  wyc0859

获取post请求,携带的name参数。

//微擎方法:
global $_GPC;
$name=$_GPC['__input']['name'];

//PHP方法:
$post=file_get_contents("php://input");  
$arr=json_decode($post,true);
$name=$arr['name'];

微擎常量

global $_W;
$_W['uniaccount']  平台信息,包含:公众号+小程序+支付
$_W['uniaccount']['setting']['payment']['wechat']['mchid']  //微信商户号
$_W['uniaccount']['setting']['payment']['wechat']['signkey']  //微信商户key

入口跳Vue

//如果是无限开,就一定要带uniacid做判断,全局请求一次uniacid即可

public function doMobileIndex() {   
        global $_W;
        $str = '/h5/#/?i='.$_W['uniacid'];
        $url = "{$_W['siteroot']}addons/{$_W['current_module']['name']}/" . $str;
        echo '<script language="javascript">';
        echo 'window.location.href="'.$url.'"'; 
        echo '</script>';
    }
上一篇 下一篇

猜你喜欢

热点阅读