mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 19:08:59 +08:00
小程序与H5互通
This commit is contained in:
parent
f107554ee0
commit
4315c44cc5
@ -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});
|
||||
}
|
||||
});
|
@ -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});
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user