作者 郭盛
1 个管道 的构建 通过 耗费 5 秒

图片接口

@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 <project version="4"> 2 <project version="4">
3 <component name="ChangeListManager"> 3 <component name="ChangeListManager">
4 <list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment=""> 4 <list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment="">
5 - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />  
6 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/User.php" afterPath="$PROJECT_DIR$/application/api/controller/User.php" /> 5 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/User.php" afterPath="$PROJECT_DIR$/application/api/controller/User.php" />
  6 + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/common/library/Auth.php" afterPath="$PROJECT_DIR$/application/common/library/Auth.php" />
7 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/api.html" afterPath="$PROJECT_DIR$/public/api.html" /> 7 <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/api.html" afterPath="$PROJECT_DIR$/public/api.html" />
8 </list> 8 </list>
9 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> 9 <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -18,22 +18,31 @@ @@ -18,22 +18,31 @@
18 <file leaf-file-name="User.php" pinned="false" current-in-tab="true"> 18 <file leaf-file-name="User.php" pinned="false" current-in-tab="true">
19 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> 19 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
20 <provider selected="true" editor-type-id="text-editor"> 20 <provider selected="true" editor-type-id="text-editor">
21 - <state relative-caret-position="329">  
22 - <caret line="271" column="5" lean-forward="true" selection-start-line="271" selection-start-column="5" selection-end-line="271" selection-end-column="5" /> 21 + <state relative-caret-position="219">
  22 + <caret line="306" column="30" lean-forward="true" selection-start-line="306" selection-start-column="30" selection-end-line="306" selection-end-column="30" />
23 <folding> 23 <folding>
24 <element signature="e#38#68#0#PHP" expanded="true" /> 24 <element signature="e#38#68#0#PHP" expanded="true" />
25 - <element signature="e#312#384#0#PHP" expanded="false" />  
26 - <element signature="e#390#1128#0#PHP" expanded="false" />  
27 - <element signature="e#1133#2796#0#PHP" expanded="false" />  
28 - <element signature="e#2802#3330#0#PHP" expanded="false" />  
29 - <element signature="e#3335#4106#0#PHP" expanded="false" />  
30 - <element signature="e#4112#4519#0#PHP" expanded="false" />  
31 - <element signature="e#4873#5474#0#PHP" expanded="false" /> 25 + <element signature="e#462#1200#0#PHP" expanded="false" />
  26 + <element signature="e#2874#3402#0#PHP" expanded="false" />
  27 + <element signature="e#3407#4178#0#PHP" expanded="false" />
  28 + <element signature="e#4184#4591#0#PHP" expanded="false" />
  29 + <element signature="e#7344#7793#0#PHP" expanded="false" />
  30 + <element signature="e#7798#8681#0#PHP" expanded="false" />
32 </folding> 31 </folding>
33 </state> 32 </state>
34 </provider> 33 </provider>
35 </entry> 34 </entry>
36 </file> 35 </file>
  36 + <file leaf-file-name="Auth.php" pinned="false" current-in-tab="false">
  37 + <entry file="file://$PROJECT_DIR$/application/common/library/Auth.php">
  38 + <provider selected="true" editor-type-id="text-editor">
  39 + <state relative-caret-position="585">
  40 + <caret line="105" column="38" lean-forward="true" selection-start-line="105" selection-start-column="38" selection-end-line="105" selection-end-column="38" />
  41 + <folding />
  42 + </state>
  43 + </provider>
  44 + </entry>
  45 + </file>
37 <file leaf-file-name="verify.php" pinned="false" current-in-tab="false"> 46 <file leaf-file-name="verify.php" pinned="false" current-in-tab="false">
38 <entry file="file://$PROJECT_DIR$/application/extra/verify.php"> 47 <entry file="file://$PROJECT_DIR$/application/extra/verify.php">
39 <provider selected="true" editor-type-id="text-editor"> 48 <provider selected="true" editor-type-id="text-editor">
@@ -49,6 +58,7 @@ @@ -49,6 +58,7 @@
49 <component name="FindInProjectRecents"> 58 <component name="FindInProjectRecents">
50 <findStrings> 59 <findStrings>
51 <find>image</find> 60 <find>image</find>
  61 + <find>init($token)</find>
52 </findStrings> 62 </findStrings>
53 </component> 63 </component>
54 <component name="Git.Settings"> 64 <component name="Git.Settings">
@@ -91,8 +101,8 @@ @@ -91,8 +101,8 @@
91 <option value="$PROJECT_DIR$/.gitlab-ci.yml" /> 101 <option value="$PROJECT_DIR$/.gitlab-ci.yml" />
92 <option value="$PROJECT_DIR$/.gitignore" /> 102 <option value="$PROJECT_DIR$/.gitignore" />
93 <option value="$PROJECT_DIR$/public/.gitignore" /> 103 <option value="$PROJECT_DIR$/public/.gitignore" />
94 - <option value="$PROJECT_DIR$/application/common/library/Auth.php" />  
95 <option value="$PROJECT_DIR$/application/extra/verify.php" /> 104 <option value="$PROJECT_DIR$/application/extra/verify.php" />
  105 + <option value="$PROJECT_DIR$/application/common/library/Auth.php" />
96 <option value="$PROJECT_DIR$/application/api/controller/User.php" /> 106 <option value="$PROJECT_DIR$/application/api/controller/User.php" />
97 </list> 107 </list>
98 </option> 108 </option>
@@ -112,10 +122,10 @@ @@ -112,10 +122,10 @@
112 </component> 122 </component>
113 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> 123 <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
114 <component name="ProjectFrameBounds"> 124 <component name="ProjectFrameBounds">
115 - <option name="x" value="667" />  
116 - <option name="y" value="102" /> 125 + <option name="x" value="529" />
  126 + <option name="y" value="29" />
117 <option name="width" value="1589" /> 127 <option name="width" value="1589" />
118 - <option name="height" value="930" /> 128 + <option name="height" value="939" />
119 </component> 129 </component>
120 <component name="ProjectView"> 130 <component name="ProjectView">
121 <navigator currentView="ProjectPane" proportions="" version="1"> 131 <navigator currentView="ProjectPane" proportions="" version="1">
@@ -148,14 +158,14 @@ @@ -148,14 +158,14 @@
148 <item name="areial" type="b2602c69:ProjectViewProjectNode" /> 158 <item name="areial" type="b2602c69:ProjectViewProjectNode" />
149 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" /> 159 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" />
150 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" /> 160 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
151 - <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" /> 161 + <item name="common" type="2a2b976b:PhpTreeStructureProvider$1" />
152 </path> 162 </path>
153 <path> 163 <path>
154 <item name="areial" type="b2602c69:ProjectViewProjectNode" /> 164 <item name="areial" type="b2602c69:ProjectViewProjectNode" />
155 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" /> 165 <item name="areial" type="2a2b976b:PhpTreeStructureProvider$1" />
156 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" /> 166 <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
157 - <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />  
158 - <item name="model" type="2a2b976b:PhpTreeStructureProvider$1" /> 167 + <item name="common" type="2a2b976b:PhpTreeStructureProvider$1" />
  168 + <item name="library" type="2a2b976b:PhpTreeStructureProvider$1" />
159 </path> 169 </path>
160 <path> 170 <path>
161 <item name="areial" type="b2602c69:ProjectViewProjectNode" /> 171 <item name="areial" type="b2602c69:ProjectViewProjectNode" />
@@ -209,7 +219,7 @@ @@ -209,7 +219,7 @@
209 <workItem from="1574122453532" duration="15780000" /> 219 <workItem from="1574122453532" duration="15780000" />
210 <workItem from="1574141466352" duration="745000" /> 220 <workItem from="1574141466352" duration="745000" />
211 <workItem from="1574143209694" duration="3660000" /> 221 <workItem from="1574143209694" duration="3660000" />
212 - <workItem from="1574146994475" duration="4813000" /> 222 + <workItem from="1574146994475" duration="7109000" />
213 </task> 223 </task>
214 <task id="LOCAL-00001" summary="调试"> 224 <task id="LOCAL-00001" summary="调试">
215 <created>1574145133364</created> 225 <created>1574145133364</created>
@@ -222,7 +232,7 @@ @@ -222,7 +232,7 @@
222 <servers /> 232 <servers />
223 </component> 233 </component>
224 <component name="TimeTrackingManager"> 234 <component name="TimeTrackingManager">
225 - <option name="totallyTimeSpent" value="53166000" /> 235 + <option name="totallyTimeSpent" value="55462000" />
226 </component> 236 </component>
227 <component name="TodoView"> 237 <component name="TodoView">
228 <todo-panel id="selected-file"> 238 <todo-panel id="selected-file">
@@ -234,7 +244,7 @@ @@ -234,7 +244,7 @@
234 </todo-panel> 244 </todo-panel>
235 </component> 245 </component>
236 <component name="ToolWindowManager"> 246 <component name="ToolWindowManager">
237 - <frame x="667" y="102" width="1589" height="930" extended-state="0" /> 247 + <frame x="529" y="29" width="1589" height="939" extended-state="0" />
238 <layout> 248 <layout>
239 <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18574232" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" /> 249 <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18574232" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
240 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> 250 <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
@@ -244,7 +254,7 @@ @@ -244,7 +254,7 @@
244 <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> 254 <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
245 <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> 255 <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
246 <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> 256 <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
247 - <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.26986128" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> 257 + <window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2319202" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
248 <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" /> 258 <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
249 <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> 259 <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
250 <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> 260 <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@@ -600,16 +610,6 @@ @@ -600,16 +610,6 @@
600 </state> 610 </state>
601 </provider> 611 </provider>
602 </entry> 612 </entry>
603 - <entry file="file://$PROJECT_DIR$/application/common/library/Auth.php">  
604 - <provider selected="true" editor-type-id="text-editor">  
605 - <state relative-caret-position="650">  
606 - <caret line="212" column="0" lean-forward="true" selection-start-line="212" selection-start-column="0" selection-end-line="212" selection-end-column="0" />  
607 - <folding>  
608 - <element signature="e#38#64#0#PHP" expanded="false" />  
609 - </folding>  
610 - </state>  
611 - </provider>  
612 - </entry>  
613 <entry file="file://$PROJECT_DIR$/thinkphp/library/think/Validate.php"> 613 <entry file="file://$PROJECT_DIR$/thinkphp/library/think/Validate.php">
614 <provider selected="true" editor-type-id="text-editor"> 614 <provider selected="true" editor-type-id="text-editor">
615 <state relative-caret-position="453"> 615 <state relative-caret-position="453">
@@ -639,19 +639,26 @@ @@ -639,19 +639,26 @@
639 </state> 639 </state>
640 </provider> 640 </provider>
641 </entry> 641 </entry>
  642 + <entry file="file://$PROJECT_DIR$/application/common/library/Auth.php">
  643 + <provider selected="true" editor-type-id="text-editor">
  644 + <state relative-caret-position="585">
  645 + <caret line="105" column="38" lean-forward="true" selection-start-line="105" selection-start-column="38" selection-end-line="105" selection-end-column="38" />
  646 + <folding />
  647 + </state>
  648 + </provider>
  649 + </entry>
642 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php"> 650 <entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
643 <provider selected="true" editor-type-id="text-editor"> 651 <provider selected="true" editor-type-id="text-editor">
644 - <state relative-caret-position="329">  
645 - <caret line="271" column="5" lean-forward="true" selection-start-line="271" selection-start-column="5" selection-end-line="271" selection-end-column="5" /> 652 + <state relative-caret-position="219">
  653 + <caret line="306" column="30" lean-forward="true" selection-start-line="306" selection-start-column="30" selection-end-line="306" selection-end-column="30" />
646 <folding> 654 <folding>
647 <element signature="e#38#68#0#PHP" expanded="true" /> 655 <element signature="e#38#68#0#PHP" expanded="true" />
648 - <element signature="e#312#384#0#PHP" expanded="false" />  
649 - <element signature="e#390#1128#0#PHP" expanded="false" />  
650 - <element signature="e#1133#2796#0#PHP" expanded="false" />  
651 - <element signature="e#2802#3330#0#PHP" expanded="false" />  
652 - <element signature="e#3335#4106#0#PHP" expanded="false" />  
653 - <element signature="e#4112#4519#0#PHP" expanded="false" />  
654 - <element signature="e#4873#5474#0#PHP" expanded="false" /> 656 + <element signature="e#462#1200#0#PHP" expanded="false" />
  657 + <element signature="e#2874#3402#0#PHP" expanded="false" />
  658 + <element signature="e#3407#4178#0#PHP" expanded="false" />
  659 + <element signature="e#4184#4591#0#PHP" expanded="false" />
  660 + <element signature="e#7344#7793#0#PHP" expanded="false" />
  661 + <element signature="e#7798#8681#0#PHP" expanded="false" />
655 </folding> 662 </folding>
656 </state> 663 </state>
657 </provider> 664 </provider>
@@ -17,10 +17,12 @@ class User extends Api @@ -17,10 +17,12 @@ class User extends Api
17 { 17 {
18 protected $noNeedLogin = ['login']; 18 protected $noNeedLogin = ['login'];
19 protected $noNeedRight = '*'; 19 protected $noNeedRight = '*';
  20 + protected $uid = '';
20 21
21 public function _initialize() 22 public function _initialize()
22 { 23 {
23 parent::_initialize(); 24 parent::_initialize();
  25 + $this->uid = $this->auth->getUserId();
24 } 26 }
25 27
26 /** 28 /**
@@ -166,17 +168,18 @@ class User extends Api @@ -166,17 +168,18 @@ class User extends Api
166 * @ApiMethod (POST) 168 * @ApiMethod (POST)
167 * @ApiRoute (/api/user/search) 169 * @ApiRoute (/api/user/search)
168 * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") 170 * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  171 + *
169 * @ApiParams (name="type_id", type="inter", required=false, description="视频/图片 (视频为1 图片为2 精美大片为3)") 172 * @ApiParams (name="type_id", type="inter", required=false, description="视频/图片 (视频为1 图片为2 精美大片为3)")
170 * @ApiParams (name="keyword", type="string", required=true, description="关键字") 173 * @ApiParams (name="keyword", type="string", required=true, description="关键字")
171 * @ApiReturn({ 174 * @ApiReturn({
172 - "code": 1,  
173 - "msg": "成功",  
174 - "time": "1571492001",  
175 - "data": {  
176 - "id": 4,//视频id/图片id,  
177 - "thumbnail": //视频封面图地址/图片地址,  
178 - "video": //视频路径/精美大片视频路径,  
179 - } 175 + "code": 1,
  176 + "msg": "成功",
  177 + "time": "1571492001",
  178 + "data": {
  179 + "id": 4,//视频id/图片id,
  180 + "thumbnail": //视频封面图地址/图片地址,
  181 + "video": //视频路径/精美大片视频路径,
  182 + }
180 }) 183 })
181 */ 184 */
182 public function search() 185 public function search()
@@ -271,4 +274,62 @@ class User extends Api @@ -271,4 +274,62 @@ class User extends Api
271 } 274 }
272 } 275 }
273 276
  277 + /**
  278 + * @ApiTitle (图片详情)
  279 + * @ApiSummary (图片详情)
  280 + * @ApiMethod (POST)
  281 + * @ApiRoute (/api/user/picdetail)
  282 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  283 + *
  284 + * @ApiParams (name="pic_id", type="inter", required=true, description="图片ID")
  285 + * @ApiReturn({
  286 + "code": 1,
  287 + "msg": "成功",
  288 + "time": "1571492001",
  289 + "data": {
  290 + "id": 4,//图片id,
  291 + "thumbnail": //缩略图,
  292 + "water_url": //带水印的地址,
  293 + "url": //高清地址,
  294 + "price"://正常价格,
  295 + "vip_price"://vip价格,
  296 + "content"://图片介绍,
  297 + "is_vip"://是否为会员(0否 1是)
  298 +
  299 + }
  300 + })
  301 + */
  302 + public function picdetail()
  303 + {
  304 + $uid = $this->uid;
  305 + $rule = config('verify.path');
  306 + $res = Db::name('user')
  307 + ->where('id',$uid)
  308 + ->field('id,is_vip')
  309 + ->find();
  310 + if($res['is_vip'] == 0){
  311 + $pic_id = $this->request->post('pic_id');
  312 + if(empty($pic_id)){
  313 + $this->error(['code'=>2,'msg'=>'缺少必要参数']);
  314 + }
  315 + $data = Db::name('pic')
  316 + ->where('id',$pic_id)
  317 + ->find();
  318 + $data['thumbnail'] = $rule.$data['thumbnail'];
  319 + $data['is_vip'] = 0;
  320 + $this->success('SUCCESS',$data);
  321 + }elseif($res['is_vip'] == 1){
  322 + $pic_id = $this->request->post('pic_id');
  323 + if(empty($pic_id)){
  324 + $this->error(['code'=>2,'msg'=>'缺少必要参数']);
  325 + }
  326 + $data = Db::name('pic')
  327 + ->where('id',$pic_id)
  328 + ->find();
  329 + $data['is_vip'] = 1;
  330 + $data['thumbnail'] = $rule.$data['thumbnail'];
  331 + $this->success('SUCCESS',$data);
  332 + }
  333 + }
  334 +
274 } 335 }
@@ -23,6 +23,7 @@ class Auth @@ -23,6 +23,7 @@ class Auth
23 protected $keeptime = 2592000; 23 protected $keeptime = 2592000;
24 protected $requestUri = ''; 24 protected $requestUri = '';
25 protected $rules = []; 25 protected $rules = [];
  26 + protected $user_id = '';
26 //默认配置 27 //默认配置
27 protected $config = []; 28 protected $config = [];
28 protected $options = []; 29 protected $options = [];
@@ -102,6 +103,7 @@ class Auth @@ -102,6 +103,7 @@ class Auth
102 $this->_user = $user; 103 $this->_user = $user;
103 $this->_logined = true; 104 $this->_logined = true;
104 $this->_token = $token; 105 $this->_token = $token;
  106 + $this->user_id = $user_id;
105 107
106 //初始化成功的事件 108 //初始化成功的事件
107 Hook::listen("user_init_successed", $this->_user); 109 Hook::listen("user_init_successed", $this->_user);
@@ -220,6 +222,7 @@ class Auth @@ -220,6 +222,7 @@ class Auth
220 } else { 222 } else {
221 $result['jointime'] = time(); 223 $result['jointime'] = time();
222 $result['joinip'] = request()->ip(); 224 $result['joinip'] = request()->ip();
  225 + $result['status'] = 'normal';
223 $userModel->create($result); 226 $userModel->create($result);
224 } 227 }
225 $user = User::get($where); 228 $user = User::get($where);
@@ -571,4 +574,13 @@ class Auth @@ -571,4 +574,13 @@ class Auth
571 { 574 {
572 return $this->_error ? __($this->_error) : ''; 575 return $this->_error ? __($this->_error) : '';
573 } 576 }
  577 +
  578 + /**
  579 + * 获取user_id
  580 + * @return mixed
  581 + */
  582 + public function getUserId()
  583 + {
  584 + return $this->user_id;
  585 + }
574 } 586 }
@@ -169,6 +169,7 @@ @@ -169,6 +169,7 @@
169 <a href="javascript:;" data-id="10" class="list-group-item">地区分类</a> 169 <a href="javascript:;" data-id="10" class="list-group-item">地区分类</a>
170 <a href="javascript:;" data-id="11" class="list-group-item">搜索页</a> 170 <a href="javascript:;" data-id="11" class="list-group-item">搜索页</a>
171 <a href="javascript:;" data-id="12" class="list-group-item">图片列表</a> 171 <a href="javascript:;" data-id="12" class="list-group-item">图片列表</a>
  172 + <a href="javascript:;" data-id="13" class="list-group-item">图片详情</a>
172 </div> 173 </div>
173 </div> 174 </div>
174 </div> 175 </div>
@@ -1676,14 +1677,14 @@ @@ -1676,14 +1677,14 @@
1676 <div class="row"> 1677 <div class="row">
1677 <div class="col-md-12"> 1678 <div class="col-md-12">
1678 <pre id="sample_response11">{ 1679 <pre id="sample_response11">{
1679 - "code": 1,  
1680 - "msg": "成功",  
1681 - "time": "1571492001",  
1682 - "data": {  
1683 - "id": 4,//视频id/图片id,  
1684 - "thumbnail": //视频封面图地址/图片地址,  
1685 - "video": //视频路径/精美大片视频路径,  
1686 - } 1680 + "code": 1,
  1681 + "msg": "成功",
  1682 + "time": "1571492001",
  1683 + "data": {
  1684 + "id": 4,//视频id/图片id,
  1685 + "thumbnail": //视频封面图地址/图片地址,
  1686 + "video": //视频路径/精美大片视频路径,
  1687 + }
1687 }</pre> 1688 }</pre>
1688 </div> 1689 </div>
1689 </div> 1690 </div>
@@ -1839,13 +1840,166 @@ @@ -1839,13 +1840,166 @@
1839 </div> 1840 </div>
1840 </div> 1841 </div>
1841 </div> 1842 </div>
  1843 + <div class="panel panel-default">
  1844 + <div class="panel-heading" id="heading-13">
  1845 + <h4 class="panel-title">
  1846 + <span class="label label-primary">POST</span>
  1847 + <a data-toggle="collapse" data-parent="#accordion13" href="#collapseOne13"> 图片详情 <span class="text-muted">/api/user/picdetail</span></a>
  1848 + </h4>
  1849 + </div>
  1850 + <div id="collapseOne13" class="panel-collapse collapse">
  1851 + <div class="panel-body">
  1852 +
  1853 + <!-- Nav tabs -->
  1854 + <ul class="nav nav-tabs" id="doctab13">
  1855 + <li class="active"><a href="#info13" data-toggle="tab">基础信息</a></li>
  1856 + <li><a href="#sandbox13" data-toggle="tab">在线测试</a></li>
  1857 + <li><a href="#sample13" data-toggle="tab">返回示例</a></li>
  1858 + </ul>
  1859 +
  1860 + <!-- Tab panes -->
  1861 + <div class="tab-content">
  1862 +
  1863 + <div class="tab-pane active" id="info13">
  1864 + <div class="well">
  1865 + 图片详情 </div>
  1866 + <div class="panel panel-default">
  1867 + <div class="panel-heading"><strong>Headers</strong></div>
  1868 + <div class="panel-body">
  1869 + <table class="table table-hover">
  1870 + <thead>
  1871 + <tr>
  1872 + <th>名称</th>
  1873 + <th>类型</th>
  1874 + <th>必选</th>
  1875 + <th>描述</th>
  1876 + </tr>
  1877 + </thead>
  1878 + <tbody>
  1879 + <tr>
  1880 + <td>token</td>
  1881 + <td>string</td>
  1882 + <td></td>
  1883 + <td>请求的Token</td>
  1884 + </tr>
  1885 + </tbody>
  1886 + </table>
  1887 + </div>
  1888 + </div>
  1889 + <div class="panel panel-default">
  1890 + <div class="panel-heading"><strong>参数</strong></div>
  1891 + <div class="panel-body">
  1892 + <table class="table table-hover">
  1893 + <thead>
  1894 + <tr>
  1895 + <th>名称</th>
  1896 + <th>类型</th>
  1897 + <th>必选</th>
  1898 + <th>描述</th>
  1899 + </tr>
  1900 + </thead>
  1901 + <tbody>
  1902 + <tr>
  1903 + <td>pic_id</td>
  1904 + <td>inter</td>
  1905 + <td></td>
  1906 + <td>图片ID</td>
  1907 + </tr>
  1908 + </tbody>
  1909 + </table>
  1910 + </div>
  1911 + </div>
  1912 + <div class="panel panel-default">
  1913 + <div class="panel-heading"><strong>正文</strong></div>
  1914 + <div class="panel-body">
  1915 +</div>
  1916 + </div>
  1917 + </div><!-- #info -->
  1918 +
  1919 + <div class="tab-pane" id="sandbox13">
  1920 + <div class="row">
  1921 + <div class="col-md-12">
  1922 + <div class="panel panel-default">
  1923 + <div class="panel-heading"><strong>Headers</strong></div>
  1924 + <div class="panel-body">
  1925 + <div class="headers">
  1926 + <div class="form-group">
  1927 + <label class="control-label" for="token">token</label>
  1928 + <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
  1929 + </div>
  1930 + </div>
  1931 + </div>
  1932 + </div>
  1933 + <div class="panel panel-default">
  1934 + <div class="panel-heading"><strong>参数</strong></div>
  1935 + <div class="panel-body">
  1936 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/picdetail" method="POST" name="form13" id="form13">
  1937 + <div class="form-group">
  1938 + <label class="control-label" for="pic_id">pic_id</label>
  1939 + <input type="inter" class="form-control input-sm" id="pic_id" required placeholder="图片ID" name="pic_id">
  1940 + </div>
  1941 + <div class="form-group">
  1942 + <button type="submit" class="btn btn-success send" rel="13">提交</button>
  1943 + <button type="reset" class="btn btn-info" rel="13">重置</button>
  1944 + </div>
  1945 + </form>
  1946 + </div>
  1947 + </div>
  1948 + <div class="panel panel-default">
  1949 + <div class="panel-heading"><strong>响应输出</strong></div>
  1950 + <div class="panel-body">
  1951 + <div class="row">
  1952 + <div class="col-md-12" style="overflow-x:auto">
  1953 + <pre id="response_headers13"></pre>
  1954 + <pre id="response13"></pre>
  1955 + </div>
  1956 + </div>
  1957 + </div>
  1958 + </div>
  1959 + <div class="panel panel-default">
  1960 + <div class="panel-heading"><strong>返回参数</strong></div>
  1961 + <div class="panel-body">
  1962 +
  1963 + </div>
  1964 + </div>
  1965 + </div>
  1966 + </div>
  1967 + </div><!-- #sandbox -->
  1968 +
  1969 + <div class="tab-pane" id="sample13">
  1970 + <div class="row">
  1971 + <div class="col-md-12">
  1972 + <pre id="sample_response13">{
  1973 + "code": 1,
  1974 + "msg": "成功",
  1975 + "time": "1571492001",
  1976 + "data": {
  1977 + "id": 4,//图片id,
  1978 + "thumbnail": //缩略图,
  1979 + "water_url": //带水印的地址,
  1980 + "url": //高清地址,
  1981 + "price"://正常价格,
  1982 + "vip_price"://vip价格,
  1983 + "content"://图片介绍,
  1984 + "is_vip"://是否为会员(0否 1是)
  1985 +
  1986 + }
  1987 + }</pre>
  1988 + </div>
  1989 + </div>
  1990 + </div><!-- #sample -->
  1991 +
  1992 + </div><!-- .tab-content -->
  1993 + </div>
  1994 + </div>
  1995 + </div>
1842 </div> 1996 </div>
1843 1997
1844 <hr> 1998 <hr>
1845 1999
1846 <div class="row mt0 footer"> 2000 <div class="row mt0 footer">
1847 <div class="col-md-6" align="left"> 2001 <div class="col-md-6" align="left">
1848 - Generated on 2019-11-19 16:23:27 </div> 2002 + Generated on 2019-11-19 17:01:47 </div>
1849 <div class="col-md-6" align="right"> 2003 <div class="col-md-6" align="right">
1850 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a> 2004 <a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
1851 </div> 2005 </div>