获取微信userinfo
<p>[TOC]</p>
<h5>简要描述</h5>
<ul>
<li>获取微信userinfo</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>/index/index/getUserInfo</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>浏览器路由, GET</li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">必选</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">是</td>
<td style="text-align: left;">string</td>
<td>微信code</td>
</tr>
<tr>
<td style="text-align: left;">pid</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>联盟id,用于注册写入</td>
</tr>
<tr>
<td style="text-align: left;">type</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>1-抖音,2-快手,用于判断跳转地址</td>
</tr>
<tr>
<td style="text-align: left;">p_type</td>
<td style="text-align: left;">否</td>
<td style="text-align: left;">int</td>
<td>1-霸屏 2-合伙人 用于判断跳转地址</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<p>跳转判断如下</p>
<pre><code>if (!empty($type) && $type == 1) {
if (!empty($system["domain"])) {
header("Location: " . $system["domain"] . "index/index/index#/pages/my/union/detail/detail?id=" . input("id"));
exit;
} else {
$this->redirect(url("index/index/index") . "#/pages/my/union/detail/detail?id=" . input("id"));
exit;
}
} else {
if (!empty($system["domain"])) {
header("Location: " . $system["domain"] . "index/index/index/");
exit;
}
}
if (!empty($p_type) && $p_type == 2) {
if (!empty($system["domain"])) {
header("Location: " . $system["domain"] . "index/index/index#/pages/my/partner/login/login");
exit;
} else {
$this->redirect(request()->domain() . "/index/index/index#/pages/my/partner/login/login");
exit;
}
}
return $this->redirect(url("index/index/index"));</code></pre>