本文整理汇总了PHP中utils::decrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP utils::decrypt方法的具体用法?PHP utils::decrypt怎么用?PHP utils::decrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::decrypt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($enc_str)
{
$app_define = utils::decrypt($enc_str);
$action_url = urldecode($action_url);
$obj_wstage = vmc::singleton('wechat_stage');
$access_token = $obj_wstage->get_access_token(false, $app_define);
$app_id = $app_define['app_id'];
vmc::singleton('base_session')->start();
$session_str = utils::encrypt(array('session_id' => vmc::singleton('base_session')->sess_id() . '|' . time()));
$session_str = app::get('mobile')->router()->encode_args($session_str);
$redirect_uri = vmc::openapi_url('openapi.toauth', 'callback', array('wechat_toauth_pam' => 'callback')) . '?qrlp=' . $session_str;
$forward = $_GET['forward'];
$state = app::get('mobile')->router()->gen_url(array('app' => 'wechat', 'ctl' => 'mobile_wxqrlogin', 'act' => 'dologin'));
$long_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$app_id}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state={$state}#wechat_redirect";
if (!$access_token) {
$this->splash('error', '', '二维码生成失败');
}
if ($surl = $obj_wstage->gen_surl($long_url, $access_token, $msg)) {
$this->pagedata['surl'] = $surl;
} else {
$this->splash('error', '', '二维码生成失败:' . $msg);
}
// if($this->_reqeust->is_ajax()){
// $qrcode = vmc::singleton('wechat_qrcode')->create($surl);
// $qrcode_url = base_storager::inmage_path($qrcode['image_id']);
// $this->splash('success','',array('qrcode_url'=>$qrcode_url));
// }
$this->pagedata['forward'] = $forward;
$this->page('site/loginqrcode.html');
}
示例2: dologin
public function dologin()
{
$enc_str = $_GET['enc_str'];
$enc_str = app::get('mobile')->router()->decode_args($enc_str);
$member_id = $_GET['mid'];
$decode_enc = utils::decrypt($enc_str);
$session_id = $decode_enc['session_id'];
if ($session_id) {
$session_arr = explode('|', $session_id);
$session_id = $session_arr[0];
$time = $session_arr[1];
if (time() - (int) $time > 3600) {
//超时
logger::error('微信登录失败!超时.' . var_export($_GET, 1) . var_export($decode_enc, 1));
$this->display('mobile/wxloginerror.html');
exit;
}
vmc::singleton('base_session')->set_sess_id($session_id);
vmc::singleton('base_session')->start();
vmc::singleton('b2c_user_object')->set_member_session($member_id);
$member_id = vmc::singleton('b2c_user_object')->get_member_session();
$member = app::get('b2c')->model('members')->dump($member_id);
if ($member) {
$this->pagedata['member'] = $member;
$this->display('mobile/wxloginsuccess.html');
} else {
logger::error('微信登录失败!未知会员数据.' . var_export($_GET, 1) . var_export($decode_enc['session_id'], 1));
$this->display('mobile/wxloginerror.html');
}
} else {
logger::error('微信登录失败!未知SESSION_ID.' . var_export($_GET, 1) . var_export($decode_enc['session_id'], 1));
$this->display('mobile/wxloginerror.html');
}
}
示例3: get_default
public function get_default()
{
if ($_COOKIE['CURRENT_THEME']) {
$current_theme = utils::decrypt($_COOKIE['CURRENT_THEME']);
if ($current_theme) {
return $current_theme;
}
}
return app::get('site')->getConf('current_theme');
}