12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace App\Http\Controllers\Api\V1\MpUser;
- use App\Facades\UserFacade;
- use App\Http\Controllers\Controller;
- use Illuminate\Http\Request;
- class MpUserController extends Controller
- {
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function index()
- {
- //
- $code = request()->input('code');
- if(!$code) {
- return $this->error()->fail('code参数不能为空');
- }
- return UserFacade::wxMPLogin($code);
- }
- /**
- * Store a newly created resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @return \Illuminate\Http\Response
- */
- public function store(Request $request)
- {
- //
- $code = request()->input('code');
- if(!$code) {
- return $this->error()->fail('code参数不能为空');
- }
- $wxUserInfo = request()->input('wx_user_info');
- if(!$wxUserInfo) {
- return $this->error()->fail('用户数据不能为空');
- }
- return UserFacade::wxMPRegister($code, $wxUserInfo);
- }
- /**
- * Display the specified resource.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function show($id)
- {
- //
- }
- /**
- * Update the specified resource in storage.
- *
- * @param \Illuminate\Http\Request $request
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function update(Request $request, $id)
- {
- //
- }
- /**
- * Remove the specified resource from storage.
- *
- * @param int $id
- * @return \Illuminate\Http\Response
- */
- public function destroy($id)
- {
- //
- }
- }
|