作者 Cool
1 个管道 的构建 通过 耗费 10 秒

新增获取融云账号接口

... ... @@ -360,4 +360,41 @@ class User extends Api
}
$this->success('success',$data);
}
/**
* @ApiTitle (获取用户融云账号信息)
* @ApiSummary (获取用户融云账号信息)
* @ApiMethod (POST)
* @ApiRoute (/api/user/rongyun)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id"://融云id
"token"://融云token
}
})
*/
public function rongyun() {
$return = [
'id' => '',
'token' => ''
];
if($this->userId) {
$user_id = $this->getUserId();
if($this->user['is_create'] == 1) {
$return = [
'id' => $this->user['rongyun_id'],
'token' => $this->user['rongyun_token'],
];
}
}
$this->success('成功',$return);
}
}
... ...
... ... @@ -5,8 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="问答小程序">
<title>问答小程序</title>
<meta name="author" content="小微问问">
<title>小微问问</title>
<!-- Bootstrap Core CSS -->
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
... ... @@ -109,7 +109,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://www.fastadmin.net" target="_blank">问答小程序</a>
<a class="navbar-brand" href="https://www.fastadmin.net" target="_blank">小微问问</a>
</div>
<div class="navbar-collapse collapse">
<form class="navbar-form navbar-right">
... ... @@ -214,6 +214,7 @@
<a href="javascript:;" data-id="52" class="list-group-item">小程序登录注册</a>
<a href="javascript:;" data-id="53" class="list-group-item">通过code获取token</a>
<a href="javascript:;" data-id="54" class="list-group-item">判断用户身份</a>
<a href="javascript:;" data-id="55" class="list-group-item">获取用户融云账号信息</a>
</div>
</div>
</div>
... ... @@ -8314,13 +8315,141 @@
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" id="heading-55">
<h4 class="panel-title">
<span class="label label-primary">POST</span>
<a data-toggle="collapse" data-parent="#accordion55" href="#collapseOne55"> 获取用户融云账号信息 <span class="text-muted">/api/user/rongyun</span></a>
</h4>
</div>
<div id="collapseOne55" class="panel-collapse collapse">
<div class="panel-body">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="doctab55">
<li class="active"><a href="#info55" data-toggle="tab">基础信息</a></li>
<li><a href="#sandbox55" data-toggle="tab">在线测试</a></li>
<li><a href="#sample55" data-toggle="tab">返回示例</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div class="tab-pane active" id="info55">
<div class="well">
获取用户融云账号信息 </div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>正文</strong></div>
<div class="panel-body">
</div>
</div>
</div><!-- #info -->
<div class="tab-pane" id="sandbox55">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/rongyun" method="POST" name="form55" id="form55">
<div class="form-group">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="55">提交</button>
<button type="reset" class="btn btn-info" rel="55">重置</button>
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>响应输出</strong></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12" style="overflow-x:auto">
<pre id="response_headers55"></pre>
<pre id="response55"></pre>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>返回参数</strong></div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div><!-- #sandbox -->
<div class="tab-pane" id="sample55">
<div class="row">
<div class="col-md-12">
<pre id="sample_response55">{
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id"://融云id
"token"://融云token
}
}</pre>
</div>
</div>
</div><!-- #sample -->
</div><!-- .tab-content -->
</div>
</div>
</div>
</div>
<hr>
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2020-02-27 22:24:53 </div>
Generated on 2020-03-07 09:32:17 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...