获取微信userinfo
[TOC]
简要描述
- 获取微信userinfo
请求URL
/index/index/getUserInfo
请求方式
- 浏览器路由, GET
参数
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
code | 是 | string | 微信code |
pid | 否 | int | 联盟id,用于注册写入 |
type | 否 | int | 1-抖音,2-快手,用于判断跳转地址 |
p_type | 否 | int | 1-霸屏 2-合伙人 用于判断跳转地址 |
返回示例
跳转判断如下
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"));