<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 獲取手機驗證碼 ~~~ /** * 獲取手機驗證碼 */ public function getPhoneCode(){ return json(['code'=>0,'msg'=>'success']); $phone = input('param.phone'); $code = input('param.code'); if(empty($phone)) return json(['code'=>1,'msg'=>'手機號碼參數錯誤']); if(empty($code)) return json(['code'=>1,'msg'=>'驗證碼參數錯誤']); $TemplateParam = Array( // 短信模板中字段的值 "code"=>$code, "product"=>"dsd" ); $response = dysms($phone,'SMS_105290006',$TemplateParam); if($response['Code']=='OK'){ return json(['code'=>0,'msg'=>'success']); //發送成功,如兩分鐘未收到,請重新點擊發送 }else{ return json(['code'=>1,'msg'=>'error']); } } ~~~ 注釋:通過公共函數dysms發送短信,具體可以參考阿里云的短信發送說明文檔 ## 獲取code > /user/controller/Login.php > public function bindingUser ~~~ // 獲取code的 $code = Request::instance()->param('code'); $xcx_openid = Request::instance()->param('openid'); if(empty($xcx_openid)) return $this->fetch('binding_user'); // 如果cookie緩存里面已經保存著openid,則不會再次獲取新的openid if (empty($code)) { $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $url = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; header('Location:https://wy.yanhongw.com/api/wechat/getCode/?url='.$url); exit; }else{ // 防止刷新時導致重復帶入過期code導致獲取openid錯誤 $options = array ( 'token' => 'ooczfh1408592787', // 填寫你設定的key 'appid' => 'wx886cec052b64822e', // 填寫高級調用功能的appid 'appsecret' => 'afbed07e362c9eb7987a396624bb8c6c' // 填寫高級調用功能的密鑰 ); $wechat = new WechatApi($options); $result = $wechat->getOauthAccessToken($code); if(empty($result)){ header('Location:https://wy.yanhongw.com/user/login/bindingUser/?openid='.$xcx_openid); // header('Location:https://www.baidu.com'); exit; } // access_token,expires_in,refresh_token,openid,scope } ~~~ ~~~ // 獲取code public function getCode(){ ob_start(); $myurl = Request::instance()->param('url'); // $myurl = 'https://wy.yanhongw.com/user/wechat/getOpenId'; $options = array ( 'token' => 'ooczfh1408592787', // 填寫你設定的key 'appid' => 'wx886cec052b64822e', // 填寫高級調用功能的appid 'appsecret' => 'afbed07e362c9eb7987a396624bb8c6c' // 填寫高級調用功能的密鑰 ); $wechat = new WechatApi($options); $callback = 'https://wy.yanhongw.com/oauth.php?url= '.$myurl; $url = $wechat->getOauthRedirect($callback,$state='',$scope='snsapi_base'); header("Location:".$url); exit; } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看