本文整理匯總了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');
}