Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
54d016e2
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,发现更多精彩内容 >>
提交
54d016e2
编写于
6月 29, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户信息优化
上级
38cb3896
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
22 deletion
+34
-22
application/service/UserService.php
application/service/UserService.php
+23
-10
config/shopxo.php
config/shopxo.php
+3
-0
public/appmini/old/alipay/app.js
public/appmini/old/alipay/app.js
+4
-6
public/appmini/old/weixin/app.js
public/appmini/old/weixin/app.js
+4
-6
未找到文件。
application/service/UserService.php
浏览文件 @
54d016e2
...
...
@@ -40,7 +40,7 @@ class UserService
return
session
(
'user'
);
}
else
{
$params
=
input
();
return
empty
(
$params
[
'
user_id'
])
?
null
:
self
::
UserLoginRecord
(
$params
[
'user_id'
],
true
);
return
empty
(
$params
[
'
token'
])
?
null
:
cache
(
config
(
'shopxo.cache_user_info'
)
.
$params
[
'token'
]
);
}
}
...
...
@@ -763,10 +763,9 @@ class UserService
'user_id'
=>
$user_id
]);
if
(
$is_app
==
true
)
// 非app则存储session
if
(
$is_app
==
false
)
{
return
$user
;
}
else
{
// 存储session
session
(
'user'
,
$user
);
return
(
session
(
'user'
)
!==
null
);
...
...
@@ -1631,7 +1630,7 @@ class UserService
public
static
function
AppUserInfoHandle
(
$user_id
=
null
,
$where_field
=
null
,
$where_value
=
null
,
$user
=
[])
{
// 获取用户信息
$field
=
'id,username,nickname,mobile,email,avatar'
;
$field
=
'id,username,nickname,mobile,email,avatar
,integral
'
;
if
(
!
empty
(
$user_id
))
{
$user
=
self
::
UserInfo
(
'id'
,
$user_id
,
$field
);
...
...
@@ -1642,11 +1641,29 @@ class UserService
if
(
!
empty
(
$user
))
{
// 用户登录纪录处理
self
::
UserLoginRecord
(
$user
[
'id'
],
true
);
// 用户信息处理
$user
=
self
::
GetUserViewInfo
(
0
,
$user
);
// 是否强制绑定手机号码
$user
[
'is_mandatory_bind_mobile'
]
=
intval
(
MyC
(
'common_user_is_mandatory_bind_mobile'
));;
$user
[
'is_mandatory_bind_mobile'
]
=
intval
(
MyC
(
'common_user_is_mandatory_bind_mobile'
));
// token生成并存储缓存
if
(
isset
(
$user
[
'id'
])
&&
(
$user
[
'is_mandatory_bind_mobile'
]
==
0
||
(
$user
[
'is_mandatory_bind_mobile'
]
==
1
&&
!
empty
(
$user
[
'mobile'
]))))
{
$user
[
'token'
]
=
md5
(
md5
(
$user
[
'id'
])
.
$user
[
'id'
]);
cache
(
config
(
'shopxo.cache_user_info'
)
.
$user
[
'token'
],
$user
,
3600
*
24
);
}
else
{
$user
[
'token'
]
=
''
;
}
// 移除用户id
if
(
isset
(
$user
[
'id'
]))
{
unset
(
$user
[
'id'
]);
}
}
return
$user
;
...
...
@@ -1885,10 +1902,6 @@ class UserService
{
// 清除验证码
$obj
->
Remove
();
// 用户登录纪录处理
self
::
UserLoginRecord
(
$user_id
,
true
);
return
DataReturn
(
'绑定成功'
,
0
,
self
::
AppUserInfoHandle
(
$user_id
));
}
else
{
return
DataReturn
(
'绑定失败'
,
-
100
);
...
...
config/shopxo.php
浏览文件 @
54d016e2
...
...
@@ -45,6 +45,9 @@ return [
// 配置信息一条缓存 拼接唯一标记 [ only_tag ]
'cache_config_row_key'
=>
'cache_config_row_data_'
,
// 用户缓存信息
'cache_user_info'
=>
'cache_user_info_'
,
// 附件host, 数据库图片地址以/static/...开头
'attachment_host'
=>
defined
(
'__MY_PUBLIC_URL__'
)
?
substr
(
__MY_PUBLIC_URL__
,
0
,
-
1
)
:
''
,
...
...
public/appmini/old/alipay/app.js
浏览文件 @
54d016e2
...
...
@@ -172,15 +172,13 @@ App({
params
=
"
&
"
+
params
;
}
var
user
=
this
.
get_user_cache_info
();
var
app_client_user_id
=
user
==
false
?
""
:
user
.
alipay_openid
;
var
user_id
=
user
==
false
?
0
:
user
.
id
;
var
token
=
(
user
==
false
)
?
0
:
user
.
token
;
return
(
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
"
&application=app&application_client_type=alipay&application_user_id=
"
+
app_client_user_id
+
"
&user_id=
"
+
user_id
+
"
&application=app&application_client_type=alipay
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
);
...
...
public/appmini/old/weixin/app.js
浏览文件 @
54d016e2
...
...
@@ -164,15 +164,13 @@ App({
params
=
"
&
"
+
params
;
}
var
user
=
this
.
get_user_cache_info
();
var
app_client_user_id
=
user
==
false
?
""
:
user
.
weixin_openid
;
var
user_id
=
user
==
false
?
0
:
user
.
id
;
var
token
=
(
user
==
false
)
?
''
:
user
.
token
||
''
;
return
(
this
.
data
.
request_url
+
"
index.php?s=/
"
+
m
+
"
/
"
+
c
+
"
/
"
+
a
+
"
&application=app&application_client_type=weixin&application_user_id=
"
+
app_client_user_id
+
"
&user_id=
"
+
user_id
+
"
&application=app&application_client_type=weixin
"
+
"
&token=
"
+
token
+
"
&ajax=ajax
"
+
params
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录