feat/task1-c-wallet
devil_gong 2019-06-28 17:52:40 +08:00
parent d216bb8de0
commit fac8a4b68e
3 changed files with 15 additions and 8 deletions

View File

@ -138,11 +138,11 @@ class User extends Common
'key_name' => 'openid',
'error_msg' => 'openid为空',
],
[
'checked_type' => 'empty',
'key_name' => 'userinfo',
'error_msg' => '用户数据为空',
],
// [
// 'checked_type' => 'empty',
// 'key_name' => 'userinfo',
// 'error_msg' => '用户数据为空',
// ],
];
$ret = ParamsChecked($this->data_post, $p);
if($ret !== true)

View File

@ -311,10 +311,11 @@ App({
get_user_login_info(object, method, openid, userinfo) {
my.showLoading({ content: "授权中..." });
var $this = this;
userinfo['openid'] = openid;
my.request({
url: $this.get_request_url('alipayuserinfo', 'user'),
method: 'POST',
data: { userinfo: userinfo, openid: openid },
data: userinfo,
dataType: 'json',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
success: (res) => {

View File

@ -44,8 +44,14 @@ Page({
// content: userinfo,
// buttonText: '我知道了',
// });
console.log(userinfo)
app.user_auth_login($this, 'user_auth_back_event', null);
// 字符串则转为json对象兼容支付宝框架bug
// if(typeof(userinfo) == 'string')
// {
userinfo = JSON.parse(userinfo.response);
//}
console.log(userinfo.response)
app.user_auth_login(this, 'user_auth_back_event', userinfo.response);
}
});
},