提交 4315c44c 编写于 作者: G gongfuxiang

小程序与H5互通

上级 f107554e
......@@ -42,16 +42,17 @@ class UserService
$user = null;
if(APPLICATION == 'web')
{
// web用户session
$user = session('user');
// token仅小程序浏览器环境和api接口环境中有效
if(!empty($params['token']) && in_array(MiniAppEnv(), ['weixin', 'alipay', 'baidu']))
if(empty($user) && !empty($params['token']) && in_array(MiniAppEnv(), ['weixin', 'alipay', 'baidu']))
{
$user = cache(config('shopxo.cache_user_info').$params['token']);
if(isset($user['id']))
{
self::UserLoginRecord($user['id']);
}
} else {
$user = session('user');
}
} else {
if(!empty($params['token']))
......
......@@ -20,8 +20,6 @@ Page({
}
}
this.setData({
web_url: url,
});
this.setData({web_url: url});
}
});
\ No newline at end of file
......@@ -61,7 +61,7 @@ App({
// 请求地址
// request_url: "{{request_url}}",
request_url: 'http://tp5-dev.com/',
//request_url: 'https://test.shopxo.net/',
request_url: 'https://test.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",
......
......@@ -20,8 +20,6 @@ Page({
}
}
this.setData({
web_url: url,
});
this.setData({web_url: url});
}
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册