From 4315c44cc5bde580dcab2ae51f09a6249f89f4fe Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sat, 29 Jun 2019 23:55:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=8EH5=E4=BA=92?= =?UTF-8?q?=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/UserService.php | 7 ++++--- public/appmini/old/alipay/pages/web-view/web-view.js | 4 +--- public/appmini/old/weixin/app.js | 2 +- public/appmini/old/weixin/pages/web-view/web-view.js | 4 +--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/application/service/UserService.php b/application/service/UserService.php index a0517d892..4592a0084 100755 --- a/application/service/UserService.php +++ b/application/service/UserService.php @@ -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'])) diff --git a/public/appmini/old/alipay/pages/web-view/web-view.js b/public/appmini/old/alipay/pages/web-view/web-view.js index 21f41cbcd..fd525ca14 100644 --- a/public/appmini/old/alipay/pages/web-view/web-view.js +++ b/public/appmini/old/alipay/pages/web-view/web-view.js @@ -20,8 +20,6 @@ Page({ } } - this.setData({ - web_url: url, - }); + this.setData({web_url: url}); } }); \ No newline at end of file diff --git a/public/appmini/old/weixin/app.js b/public/appmini/old/weixin/app.js index 4188557f1..c0a6d50ce 100755 --- a/public/appmini/old/weixin/app.js +++ b/public/appmini/old/weixin/app.js @@ -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}}", diff --git a/public/appmini/old/weixin/pages/web-view/web-view.js b/public/appmini/old/weixin/pages/web-view/web-view.js index 21f41cbcd..fd525ca14 100755 --- a/public/appmini/old/weixin/pages/web-view/web-view.js +++ b/public/appmini/old/weixin/pages/web-view/web-view.js @@ -20,8 +20,6 @@ Page({ } } - this.setData({ - web_url: url, - }); + this.setData({web_url: url}); } }); \ No newline at end of file