Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
cf09472a
ShopXO
项目概览
starsw001
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf09472a
编写于
2月 27, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
未登录应用优化
上级
592cfcc9
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
34 addition
and
10 deletion
+34
-10
application/api/controller/Common.php
application/api/controller/Common.php
+1
-4
application/index/controller/Common.php
application/index/controller/Common.php
+3
-2
application/plugins/commonrightnavigation/Index.php
application/plugins/commonrightnavigation/Index.php
+3
-2
application/plugins/usernotloginhidegoodsprice/Hook.php
application/plugins/usernotloginhidegoodsprice/Hook.php
+9
-2
application/service/UserService.php
application/service/UserService.php
+18
-0
未找到文件。
application/api/controller/Common.php
浏览文件 @
cf09472a
...
...
@@ -119,10 +119,7 @@ class Common extends Controller
private
function
CommonInit
()
{
// 用户数据
if
(
!
empty
(
$this
->
data_request
[
'user_id'
]))
{
$this
->
user
=
UserService
::
UserLoginRecord
(
$this
->
data_request
[
'user_id'
],
true
);
}
$this
->
user
=
UserService
::
LoginUserInfo
();
}
/**
...
...
application/index/controller/Common.php
浏览文件 @
cf09472a
...
...
@@ -19,6 +19,7 @@ use app\service\MessageService;
use
app\service\SearchService
;
use
app\service\ConfigService
;
use
app\service\LinkService
;
use
app\service\UserService
;
/**
* 前端公共控制器
...
...
@@ -128,7 +129,7 @@ class Common extends Controller
*/
protected
function
IsLogin
()
{
if
(
session
(
'user'
)
==
null
)
if
(
empty
(
$this
->
user
)
)
{
if
(
IS_AJAX
)
{
...
...
@@ -151,7 +152,7 @@ class Common extends Controller
// 用户数据
if
(
session
(
'user'
)
!=
null
)
{
$this
->
user
=
session
(
'user'
);
$this
->
user
=
UserService
::
LoginUserInfo
(
);
}
}
...
...
application/plugins/commonrightnavigation/Index.php
浏览文件 @
cf09472a
...
...
@@ -13,6 +13,7 @@ namespace app\plugins\commonrightnavigation;
use
think\Controller
;
use
app\service\AnswerService
;
use
app\service\BuyService
;
use
app\service\UserService
;
/**
* 右侧快捷导航 - 前端
...
...
@@ -34,7 +35,7 @@ class Index extends Controller
public
function
answer
(
$params
=
[])
{
$params
=
input
(
'post.'
);
$params
[
'user'
]
=
session
(
'user'
);
$params
[
'user'
]
=
UserService
::
LoginUserInfo
(
);
return
AnswerService
::
Add
(
$params
);
}
...
...
@@ -57,7 +58,7 @@ class Index extends Controller
$this
->
assign
(
'module_controller_action'
,
$module_name
.
$controller_name
.
$action_name
);
// 购物车
$cart_list
=
BuyService
::
CartList
([
'user'
=>
session
(
'user'
)]);
$cart_list
=
BuyService
::
CartList
([
'user'
=>
UserService
::
LoginUserInfo
(
)]);
// 基础数据
$base
=
[
...
...
application/plugins/usernotloginhidegoodsprice/Hook.php
浏览文件 @
cf09472a
...
...
@@ -12,6 +12,7 @@ namespace app\plugins\usernotloginhidegoodsprice;
use
think\Controller
;
use
app\service\PluginsService
;
use
app\service\UserService
;
/**
* 未登录隐藏商品价格 - 钩子入口
...
...
@@ -55,10 +56,16 @@ class Hook extends Controller
}
// 用户是否已登录
if
(
session
(
'user'
)
!=
null
)
$user
=
UserService
::
LoginUserInfo
();
if
(
!
empty
(
$user
))
{
// 查询用户状态是否待审核状态
$user
=
UserService
::
UserInfo
(
'id'
,
$user
[
'id'
]);
if
(
isset
(
$user
[
'status'
])
&&
in_array
(
$user
[
'status'
],
[
0
,
1
]))
{
return
DataReturn
(
'无需处理'
,
0
);
}
}
// 获取应用数据
$ret
=
PluginsService
::
PluginsData
(
'usernotloginhidegoodsprice'
);
...
...
application/service/UserService.php
浏览文件 @
cf09472a
...
...
@@ -23,6 +23,24 @@ use app\service\RegionService;
*/
class
UserService
{
/**
* 获取用户登录信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-02-27
* @desc description
*/
public
static
function
LoginUserInfo
()
{
if
(
APPLICATION
==
'web'
)
{
return
session
(
'user'
);
}
else
{
$params
=
input
();
return
empty
(
$params
[
'user_id'
])
?
null
:
self
::
UserLoginRecord
(
$params
[
'user_id'
],
true
);
}
}
/**
* 用户列表
* @author Devil
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录