作者 王智

xiugai

  1 +<?php
  2 +
  3 +
  4 +namespace app\api\controller;
  5 +
  6 +
  7 +use app\common\controller\Api;
  8 +
  9 +/**
  10 + * 改版接口
  11 + */
  12 +class Update extends Api
  13 +{
  14 + protected $noNeedLogin = ['*'];
  15 + protected $noNeedRight = '*';
  16 +
  17 +
  18 + /**
  19 + * 商城板块接口
  20 + * @ApiTitle (token换UserId)
  21 + * @ApiSummary (token换UserId)
  22 + * @ApiMethod (POST)
  23 + * @ApiRoute (/api/Update/TokenToUser)
  24 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  25 + * @ApiReturnParams (name="code", type="integer", required=true, sample="0")
  26 + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
  27 + * @ApiReturn ({
  28 + 'code':'1',
  29 + 'msg':'返回成功',
  30 + })
  31 + */
  32 + public function TokenToUser()
  33 + {
  34 + $UserId = $this->is_token($this->request->header());
  35 + $this->success('成功', $UserId);
  36 + }
  37 +}