切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
何书鹏
4 years ago
提交
cde2269ab57ada55e98ccde6b1b0fc9c5f135b5a
1 个父辈
e505e616
1 个管道 的构建
通过
耗费 9 秒
2021年4月13之后的获取不到openid
变更
2
构建
2
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
21 行增加
和
1 行删除
application/api/controller/v2/User.php
public/api.html
application/api/controller/v2/User.php
查看文件 @
cde2269
...
...
@@ -653,6 +653,7 @@ class User extends Api
"data": {
"session_key": "1qyMwZRVdlBmQLwRYtYSgA==",
"token": "9e4648c7-c640-4e41-b758-dd1a8ef7a7ae",
"openid": "9e4648c7-c640-4e41-b758-dd1a8ef7a7ae",
}
})
*/
...
...
@@ -695,6 +696,7 @@ class User extends Api
* @ApiParams (name="sessionKey", type="string", required=true, description="小程序sessionKey")
* @ApiParams (name="iv", type="string", required=true, description="小程序iv")
* @ApiParams (name="encryptData", type="string", required=true, description="小程序encryptData")
* @ApiParams (name="openid", type="string", required=true, description="openid")
* @ApiParams (name="user_id", type="inter", required=false, description="扫码获取的用户ID")
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
...
...
@@ -727,6 +729,13 @@ class User extends Api
// 获取小程序配置
$app
=
Wechat
::
miniProgram
();
$user_info
=
$app
->
encryptor
->
decryptData
(
$param
[
'sessionKey'
],
$param
[
'iv'
],
$param
[
'encryptData'
]);
// 2021年4月13之后的获取不到openid
if
(
empty
(
$user_info
[
'openId'
])){
empty
(
$param
[
'openid'
])
&&
$this
->
error
(
'传参缺少openid'
);
$user_info
[
'openId'
]
=
$param
[
'openid'
];
}
// 判断用户是否授权
$where
=
[
'openid'
=>
$user_info
[
'openId'
]
...
...
public/api.html
查看文件 @
cde2269
...
...
@@ -3394,6 +3394,7 @@
"data": {
"session_key": "1qyMwZRVdlBmQLwRYtYSgA==",
"token": "9e4648c7-c640-4e41-b758-dd1a8ef7a7ae",
"openid": "9e4648c7-c640-4e41-b758-dd1a8ef7a7ae",
}
}
</pre>
</div>
...
...
@@ -3465,6 +3466,12 @@
<td>
小程序encryptData
</td>
</tr>
<tr>
<td>
openid
</td>
<td>
string
</td>
<td>
是
</td>
<td>
openid
</td>
</tr>
<tr>
<td>
user_id
</td>
<td>
inter
</td>
<td>
否
</td>
...
...
@@ -3501,6 +3508,10 @@
<input
type=
"string"
class=
"form-control input-sm"
id=
"encryptData"
required
placeholder=
"小程序encryptData"
name=
"encryptData"
>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
for=
"openid"
>
openid
</label>
<input
type=
"string"
class=
"form-control input-sm"
id=
"openid"
required
placeholder=
"openid"
name=
"openid"
>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
for=
"user_id"
>
user_id
</label>
<input
type=
"inter"
class=
"form-control input-sm"
id=
"user_id"
placeholder=
"扫码获取的用户ID"
name=
"user_id"
>
</div>
...
...
@@ -15562,7 +15573,7 @@
<div
class=
"row mt0 footer"
>
<div
class=
"col-md-6"
align=
"left"
>
Generated on 2021-0
2-06 19:34:03
</div>
Generated on 2021-0
4-15 19:45:55
</div>
<div
class=
"col-md-6"
align=
"right"
>
<a
href=
"./"
target=
"_blank"
>
My Website
</a>
</div>
...
...
请
注册
或
登录
后发表评论