Uninote
Uninote
用户根目录
每日点滴

<!DOCTYPE html> <html><head><meta http-equiv='Content-Type' content='text/html; charset=utf8'><title>mynote_code</title> <script> var g_resRoot = '../../__res/'; var g_json_outline = '{"children":[{"children":[],"level":1,"lvNumber":"1","text":"base logic CommonLogic::proxy_logic"}],"level":0,"lvNumber":"","text":"mynote_code"}'; </script> <link rel='stylesheet' type='text/css' href='../../__res/common.css'><style>.s0{color:#000000;} .s1{color:#000000;} .s2{color:#000080;} .s3{color:#000000;} .s4{color:#660000;} .s5{color:#008000;} .s6{color:#000000;} .s7{color:#808080;} .s8{color:#000080;} .s9{color:#000000;} .s10{color:#660000;} .s11{color:#660e7a;} .s12{color:#660e7a;} .s13{color:#7f01f5;} .s14{color:#000000;} .s15{color:#0000ff;} </style> </head><body> <script src='../../__res/util.js'></script><div id='outline'> <li><a href='#ol_0' style='font-weight:bold; font-size:22px'>mynote_code</a></li> <li> <a href='#ol_1' >base logic CommonLogic::proxy_logic</a></li> </div>

<pre id='ol_0' class='title'>mynote_code</pre> <pre><d class='s0'></d></pre> <pre><d class='s1'>logger.php:</d></pre> <pre><d class='s2'>public function </d><d class='s3'>log(</d><d class='s4'>$message</d><d class='s3'>, </d><d class='s4'>$level</d><d class='s3'>, </d><d class='s4'>$category </d><d class='s3'>= </d><d class='s5'>'application'</d><d class='s3'>)</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>E:\uninote\mynote\basic\runtime\logs\app.log</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s6'>E:\uninote\mynote\basic\config\api.php</d></pre> <pre><d class='s6'>Yii::$app->api->git_docs_host;</d></pre> <pre><d class='s6'></d></pre> <pre><d class='s6'> return [</d></pre> <pre><d class='s6'> 'class' => 'yii',</d></pre> <pre><d class='s6'> 'api_url' => '<a href='http://www.mynote.com/api'>http://www.mynote.com/api</a>',</d></pre> <pre><d class='s6'> 'git_docs_host' => '121.40.183.99',</d></pre> <pre><d class='s6'> ];</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>namespace </d><d class='s3'>app\models;</d></pre> <pre><d class='s2'>class </d><d class='s3'>Curl</d></pre> <pre><d class='s6'></d></pre> <pre><d class='s2'>use </d><d class='s3'>app\models\Curl;</d></pre> <pre><d class='s4'>$this</d><d class='s3'>->curl_model = </d><d class='s2'>new </d><d class='s3'>Curl();</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>---</d></pre> <pre><d class='s6'></d></pre> <pre><d class='s6'>/</d></pre> <pre><d class='s6'> 关于本项目全部api配置</d></pre> <pre><d class='s6'>* api_url 主要的接口地址</d></pre> <pre><d class='s6'>*/</d></pre> <pre><d class='s6'></d></pre> <pre><d class='s2'>use </d><d class='s3'>Yii;</d></pre> <pre><d class='s6'></d></pre> <pre><d class='s2'>public </d><d class='s4'>$api_url </d><d class='s3'>= </d><d class='s2'>NULL</d><d class='s3'>;</d><d class='s7'>// 请求地址 </d></pre> <pre><d class='s7'></d></pre> <pre><d class='s8'>public function </d><d class='s9'>init()</d></pre> <pre><d class='s9'>{</d></pre> <pre><d class='s9'> </d><d class='s10'>$this</d><d class='s9'>-></d><d class='s11'>layout </d><d class='s9'>= </d><d class='s8'>FALSE</d><d class='s9'>;</d><d class='s7'>// 取消模板配置</d></pre> <pre><d class='s7'> </d><d class='s10'>$this</d><d class='s9'>-></d><d class='s11'>req </d><d class='s9'>= \Yii::</d><d class='s11'>$app</d><d class='s9'>-></d><d class='s11'>request</d><d class='s9'>;</d></pre> <pre><d class='s9'> </d><d class='s10'>$this</d><d class='s9'>-></d><d class='s11'>api_url </d><d class='s9'>= \Yii::</d><d class='s11'>$app</d><d class='s9'>-></d><d class='s11'>api</d><d class='s9'>-></d><d class='s11'>api_url</d><d class='s9'>;</d></pre> <pre><d class='s6'></d></pre> <pre><d class='s4'>$bool </d><d class='s3'>= </d><d class='s4'>$this</d><d class='s3'>-></d><d class='s12'>curl_model</d><d class='s3'>->http_post(</d><d class='s4'>$this</d><d class='s3'>-></d><d class='s12'>api_url</d><d class='s3'>.</d><d class='s5'>"/article/showlist"</d><d class='s3'>,[</d><d class='s5'>'username'</d><d class='s3'>=></d><d class='s4'>$username</d><d class='s3'>]);</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>---</d></pre> <pre><d class='s13'>_file_list_arr</d></pre> <pre><d class='s13'></d></pre> <pre><d class='s14'></d><d class='s3'>Yii::</d><d class='s12'>$app</d><d class='s3'>-></d><d class='s12'>api</d><d class='s3'>-></d><d class='s12'>api_url</d></pre> <pre><d class='s14'></d><d class='s3'>Yii::</d><d class='s12'>$app</d><d class='s3'>-></d><d class='s5'>params</d><d class='s3'>-></d><d class='s5'>adminEmail</d></pre> <pre><d class='s5'></d></pre> <pre><d class='s0'>---</d></pre> <pre><d class='s0'>http://localhost:222/common/base/do</d></pre> <pre><d class='s0'>-></d></pre> <pre><d class='s0'><img src='..\pic\76b0b9a88c04860e7e9fae8fbc224a69.jpg' /></d><d class='s0'></d></pre> <pre><d class='s0'>---</d></pre> <pre><d class='s0'> var aid = cur_aid;</d></pre> <pre><d class='s0'> $.ajax({</d></pre> <pre><d class='s0'> type: "POST",</d></pre> <pre><d class='s0'> // url: api_url + '/article/like',</d></pre> <pre><d class='s0'> url: '/common/base/do',</d></pre> <pre><d class='s0'> dataType: "json",</d></pre> <pre><d class='s0'> data: {</d></pre> <pre><d class='s0'> "_csrf": _csrf,</d></pre> <pre><d class='s0'> "type": '/article/like',</d></pre> <pre><d class='s0'> "json": {</d></pre> <pre><d class='s0'> "aid": aid</d></pre> <pre><d class='s0'> }</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'> },</d></pre> <pre><d class='s0'>参数为:</d></pre> <pre><d class='s0'><img src='..\pic\4108b99d66bf6e94c0b156c1e7058d45.jpg' /></d><d class='s0'></d></pre> <pre><d class='s0'>对应:</d></pre> <pre><d class='s0'><img src='..\pic\de179a18017a8e77b055c676c6367024.jpg' /></d><d class='s0'></d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>---</d></pre> <pre><d class='s0'></d></pre> <t id='68f01c65-662c-4246-aabd-7f1b08beecd7'> <pre class='tnd_head'>lv1= lv2= type=</pre> <h1 id='ol_1'>base logic CommonLogic::proxy_logic</h1> <pre><d class='s1'>\app\logic\BaseLogic</d></pre> <pre><d class='s2'>public function </d><d class='s3'>__call(</d><d class='s4'>$name</d><d class='s3'>, </d><d class='s4'>$arguments</d><d class='s3'>)</d></pre> <pre><d class='s3'>{</d></pre> <pre><d class='s3'> </d><d class='s2'>if </d><d class='s3'>(</d><d class='s2'>isset</d><d class='s3'>(\Yii::</d><d class='s12'>$app</d><d class='s3'>-></d><d class='s12'>api</d><d class='s3'>-></d><d class='s12'>api_proxy_url</d><d class='s3'>)) {</d></pre> <pre><d class='s3'> </d><d class='s2'>return </d><d class='s3'>\app\logic\CommonLogic::proxy_logic(</d><d class='s12'>CLASS</d><d class='s3'>, </d><d class='s12'>METHOD</d><d class='s3'>, func_get_args());</d></pre> <pre><d class='s3'> }</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'> </d><d class='s2'>return </d><d class='s3'>call_user_func_array([</d><d class='s4'>$this</d><d class='s3'>, </d><d class='s4'>$name</d><d class='s3'>], </d><d class='s4'>$arguments</d><d class='s3'>);</d></pre> <pre><d class='s3'>}</d></pre> <pre><d class='s15'></d></pre> </t> </d></pre> </body></html>

mynote_back

mynote_crawl

点赞(0) 阅读(68) 举报
目录
标题