예제 #1
0
 public function _loginAct()
 {
     $phone = V('mobile');
     $pas = $_POST['pwd'];
     if (empty($phone) || empty($pas)) {
         return 0;
     }
     $data = array('sname' => 'user.login', 'mobile' => $phone, 'passwd' => $pas);
     core::Singleton('comm.remote.remote');
     $result = remote::send($data);
     setcookie("version", remote::$session_id, time() + 3600 * 12, '/', 'cailai.com');
     $data = json_decode($result, TRUE);
     if ($data['code'] != 0) {
         $this->view->assign('tipMsg', $data['msg']);
     }
     setcookie("uid", md5(uniqid()) . $data['data']['mobile'], time() + 3600 * 12, '/', 'cailai.com');
     if (empty(remote::$session_id)) {
         $this->view->assign('n', $phone);
         return 0;
     } else {
         skip();
     }
 }
예제 #2
0
파일: t.php 프로젝트: GStepOne/CI
<?php

$data = array('sname' => 'express.get', 'brand' => "sf", 'no' => "212180769458");
$result = remote::send($data);
print_R(json_decode($result));
?>



<?php 
class remote
{
    //授权账号
    public static $pname = 'ios';
    //授权账号
    public static $url = 'http://dts.kuaidihelp.com/api.php';
    //key值
    public static $key = '40b208cae52648af9b368382ac10304f';
    //timeout
    public static $timeout = 5;
    //debug信息
    public static $debug = NULL;
    //
    public static $open_debug = 0;
    //session_id的值
    public static $session_id = '';
    public function __set($name, $value)
    {
        self::$name = $value;
    }
    public function __get($name)
예제 #3
0
파일: test.php 프로젝트: GStepOne/CI
function autoRedirect($reqData)
{
    //echo "<pre>";print_r($reqData);echo "</pre>";exit;
    $tmp = array();
    $html = <<<HTML
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head><body onload="document.getElementById('autoRedirectForm').submit();">
<div class="margin:10px;font-size:14px;">正在跳转...</div>
<form id="autoRedirectForm" method="POST" action="http://mertest.chinapnr.com/muser/publicRequests">
HTML;
    foreach ($reqData as $key => $value) {
        $html .= '<input type="hidden" value=\'' . $value . '\' name="' . $key . '" />';
        $tmp[$key] = $value;
    }
    $html .= "</form>";
    $html .= "</body></html>";
    //file_put_contents('/tmp/autoRedirect',date('m-d H:i:s')."autoRedirect ".print_r($autoRedirect,true)."\n",FILE_APPEND);
    //file_put_contents('/tmp/autoRedirect',date('m-d H:i:s')."autoRedirect ".print_r($reqData,true)."\n",FILE_APPEND);
    print $html;
    exit;
}
//我的资产(需要登陆才可以)
$data = array('sname' => 'member.capital');
$header[] = 'Cookie:session_id=c14e16e841390bf4be501b18b3ac56ce6';
$result = remote::send($data, '', $header);
print_R(json_decode($result));
//打印结果,body属性返回格式为json格式
//print_r(remote::$debug);
echo "\n\n";
exit;
예제 #4
0
function transferAPI($data, $time = 5, $headers = array(), $return = 'body')
{
    core::Singleton('comm.remote.remote');
    remote::$open_debug = openDebug;
    // 判断 登陆的 登陆后把 cookie 发送 出去 呀!
    $temp = is_login();
    $headers = $temp == false ? $headers : $temp;
    $result = remote::send($data, $time, $headers, $return);
    return json_decode($result, TRUE);
}