Uninote
Uninote
用户根目录
每日点滴

<!DOCTYPE html> <html><head><meta http-equiv='Content-Type' content='text/html; charset=utf8'><title>mynote tnds</title> <script> var g_resRoot = '../../__res/'; var g_json_outline = '{"children":[],"level":0,"lvNumber":"","text":"mynote tnds"}'; </script> <link rel='stylesheet' type='text/css' href='../../__res/common.css'><style>.s0{color:#0000ff;} .s1{color:#000000;} .s2{color:#c80000;} .s3{color:#000000;} .s4{color:#660000;} .s5{color:#000000;} .s6{color:#660e7a;} .s7{color:#008000;} .s8{color:#000080;} .s9{color:#808080;} .s10{color:#808080;} .s11{color:#000000;} .s12{color:#c80000;} .s13{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 tnds</a></li> </div>

<pre id='ol_0' class='title'>mynote tnds</pre> <pre><d class='s0'></d></pre> <t id='bed212a0-bce1-411c-a2b7-30ada23c322e'> <pre class='tnd_head'>lv1=mynote lv2= type=</pre> <pre><d class='s1'>class AppAsset extends AssetBundle</d></pre> <pre><d class='s1'>{</d></pre> <pre><d class='s1'> public $basePath = '@webroot';</d></pre> <pre><d class='s1'> public $baseUrl = '@web';</d></pre> <pre><d class='s1'> public function registerAssetFiles( $view )</d></pre> <pre><d class='s1'> { </d></pre> <pre><d class='s1'> $release = '1';</d></pre> <pre><d class='s1'> $this->css = [</d></pre> <pre><d class='s1'> "/link/public/css/bootstrap.min.css?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/css/style.css?v={$release}",</d></pre> <pre><d class='s1'> ];</d></pre> <pre><d class='s1'> $this->js = [</d></pre> <pre><d class='s1'> "/link/public/js/jquery.min.js?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/js/html5shiv.js?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/js/respond.min.js?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/js/layer/layer.js?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/js/common.js?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/js/fun.js?v={$release}",</d></pre> <pre><d class='s1'> "/link/public/js/bootstrap.min.js?v={$release}",</d></pre> <pre><d class='s1'> ];</d></pre> <pre><d class='s1'> parent::registerAssetFiles( $view );</d></pre> <pre><d class='s1'> }</d></pre> <pre><d class='s1'>}</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'> // 设置接口输出数据</d></pre> <pre><d class='s1'> Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;</d></pre> <pre><d class='s1'></d></pre> <pre><d class='s1'>E:\uninote\mynote\basic\views\author\index.php</d></pre> <pre><d class='s2'><?php $this->beginBlock('js'); ?></d><d class='s1'></d></pre> <pre><d class='s1'><script type="text/</d></pre> <pre><d class='s1'> var api_url = '<?= \Yiijavascript"></d></pre> <pre><d class='s1'> var json = <?= $json; ?>;::$app->api->api_url; ?>';</d></pre> <pre><d class='s1'></script></d></pre> <pre><d class='s1'><script type="text/javascript" src="/link/author/js/do.js"></script></d></pre> <pre><d class='s2'><?php $this->endBlock(); ?></d></pre> <pre><d class='s1'></d></pre> </t> <t id='274b2bf3-261c-4ab5-9c04-48190bd2b2ef'> <pre class='tnd_head'>lv1=mynote lv2= type=</pre> <pre><d class='s3'>参数获取:</d></pre> <pre><d class='s4'>$this</d><d class='s5'>-></d><d class='s6'>req</d><d class='s5'>->get(</d><d class='s7'>'id'</d><d class='s5'>,</d><d class='s8'>FALSE</d><d class='s5'>);</d></pre> <pre><d class='s3'></d></pre> <pre><d class='s3'>发送请求、处理返回值:</d></pre> <pre><d class='s9'>// user_name 用户名称</d><d class='s10'></d></pre> <pre><d class='s4'>$user_info </d><d class='s5'>= </d><d class='s4'>$this</d><d class='s5'>->_req_api(</d><d class='s7'>"/user/getuserinfo"</d><d class='s5'>,[</d><d class='s7'>'username'</d><d class='s5'>=></d><d class='s4'>$username</d><d class='s5'>]);</d></pre> <pre><d class='s4'>$user_arr </d><d class='s5'>= </d><d class='s4'>$user_info</d><d class='s5'>[</d><d class='s7'>'data'</d><d class='s5'>];</d></pre> <pre><d class='s8'>if </d><d class='s5'>(</d><d class='s4'>$user_arr</d><d class='s5'>[</d><d class='s7'>'nick'</d><d class='s5'>]) {</d></pre> <pre><d class='s5'> </d><d class='s4'>$user_name </d><d class='s5'>= </d><d class='s4'>$user_arr</d><d class='s5'>[</d><d class='s7'>'nick'</d><d class='s5'>];</d></pre> <pre><d class='s5'>} </d><d class='s8'>else </d><d class='s5'>{</d></pre> <pre><d class='s5'> </d><d class='s4'>$user_arr</d><d class='s5'>[</d><d class='s7'>'email'</d><d class='s5'>] ? </d><d class='s4'>$user_name </d><d class='s5'>= </d><d class='s4'>$user_arr</d><d class='s5'>[</d><d class='s7'>'email'</d><d class='s5'>] : </d><d class='s4'>$user_name </d><d class='s5'>= </d><d class='s4'>$user_arr</d><d class='s5'>[</d><d class='s7'>'mobile'</d><d class='s5'>]; </d></pre> <pre><d class='s5'>} </d></pre> </t> <pre><d class='s0'></d></pre> <t id='bad4ffb3-3a02-4322-8d5a-59d07f54be24'> <pre class='tnd_head'>lv1=mynote lv2= type=jy</pre> <pre><d class='s11'>E:\uninote\mynote\basic\web\docs\users.txt 需要unix格式,no BOM</d></pre> <pre><d class='s12'></d></pre> <pre><d class='s12'>api test需要绝对链接!!参数不要带空白!!</d><d class='s11'></d></pre> <pre><d class='s11'>/api/markdown/release </d></pre> <pre><d class='s11'></d></pre> <pre><d class='s12'>要用www用户操作docs目录!!</d><d class='s11'></d></pre> </t> <pre><d class='s13'></d></pre> </body></html>

mynote_tests

mynote_todo

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