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

小程序与H5互通

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