Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
24d2c72b
ShopXO
项目概览
纵之格
/
ShopXO
通知
393
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
24d2c72b
编写于
11月 30, 2021
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户登陆注册H5兼容小程序
上级
f6e151be
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
83 addition
and
26 deletion
+83
-26
app/api/controller/User.php
app/api/controller/User.php
+15
-17
app/service/ConstService.php
app/service/ConstService.php
+3
-3
app/service/UserService.php
app/service/UserService.php
+65
-6
未找到文件。
app/api/controller/User.php
浏览文件 @
24d2c72b
...
...
@@ -124,52 +124,50 @@ class User extends Common
}
/**
*
用户-验证码显示
*
app用户手机绑定
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
UserVerifyEntry
()
public
function
AppMobileBind
()
{
$params
=
[
'width'
=>
100
,
'height'
=>
28
,
'key_prefix'
=>
input
(
'type'
,
'user_reg'
),
];
$verify
=
new
\
base\Verify
(
$params
);
$verify
->
Entry
();
return
ApiService
::
ApiDataReturn
(
UserService
::
AppMobileBind
(
$this
->
data_post
));
}
/**
* app用户手机绑定
* app用户手机绑定
-验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
AppMobileBind
()
public
function
AppMobileBind
VerifySend
()
{
return
ApiService
::
ApiDataReturn
(
UserService
::
AppMobileBind
(
$this
->
data_post
));
return
ApiService
::
ApiDataReturn
(
UserService
::
AppMobileBind
VerifySend
(
$this
->
data_post
));
}
/**
*
app用户手机绑定-验证码发送
*
用户-验证码显示
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
AppMobileBindVerifySend
()
public
function
UserVerifyEntry
()
{
return
ApiService
::
ApiDataReturn
(
UserService
::
AppMobileBindVerifySend
(
$this
->
data_post
));
$params
=
[
'width'
=>
100
,
'height'
=>
28
,
'key_prefix'
=>
input
(
'type'
,
'user_reg'
),
];
$verify
=
new
\
base\Verify
(
$params
);
$verify
->
Entry
();
}
/**
* 支付宝用户授权
* @author Devil
...
...
app/service/ConstService.php
浏览文件 @
24d2c72b
...
...
@@ -92,9 +92,9 @@ class ConstService
// 用户注册类型列表
'common_user_reg_type_list'
=>
[
0
=>
[
'value'
=>
'
sms'
,
'name'
=>
'短信
'
],
1
=>
[
'value'
=>
'
email'
,
'name'
=>
'邮箱
'
],
2
=>
[
'value'
=>
'
username'
,
'name'
=>
'用户名
'
],
0
=>
[
'value'
=>
'
username'
,
'name'
=>
'账号
'
],
1
=>
[
'value'
=>
'
sms'
,
'name'
=>
'短信
'
],
2
=>
[
'value'
=>
'
email'
,
'name'
=>
'邮箱
'
],
],
// 登录方式
...
...
app/service/UserService.php
浏览文件 @
24d2c72b
...
...
@@ -766,7 +766,7 @@ class UserService
// 获取用户账户信息
$where
=
[
$ac
[
'data'
]
=>
$params
[
'accounts'
],
'is_delete_time'
=>
0
];
$user
=
Db
::
name
(
'User'
)
->
field
(
'id,pwd,salt,status'
)
->
where
(
$where
)
->
find
();
$user
=
Db
::
name
(
'User'
)
->
where
(
$where
)
->
find
();
if
(
empty
(
$user
))
{
return
DataReturn
(
'帐号不存在'
,
-
3
);
...
...
@@ -804,14 +804,38 @@ class UserService
// 返回数据,更新数据库
$data
=
[
'upd_time'
=>
time
(),
];
'upd_time'
=>
time
(),
];
if
(
$params
[
'type'
]
==
'username'
)
{
$salt
=
GetNumberCode
(
6
);
$data
[
'salt'
]
=
$salt
;
$data
[
'pwd'
]
=
LoginPwdEncryption
(
$params
[
'pwd'
],
$salt
);
}
// 用户openid
if
(
empty
(
$user
[
APPLICATION_CLIENT_TYPE
.
'_openid'
]))
{
$openid
=
self
::
UserOpenidHandle
(
$params
);
if
(
!
empty
(
$openid
[
'field'
])
&&
!
empty
(
$openid
[
'value'
]))
{
// openid放入用户data中
$data
[
$openid
[
'field'
]]
=
$openid
[
'value'
];
}
}
// 用户unionid
if
(
empty
(
$user
[
APPLICATION_CLIENT_TYPE
.
'_unionid'
]))
{
$unionid
=
self
::
UserUnionidHandle
(
$params
);
if
(
!
empty
(
$unionid
[
'field'
])
&&
!
empty
(
$unionid
[
'value'
]))
{
// unionid放入用户data中
$data
[
$unionid
[
'field'
]]
=
$unionid
[
'value'
];
}
}
// 更新用户信息
if
(
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$user
[
'id'
]])
->
update
(
$data
)
!==
false
)
{
// 清除图片验证码
...
...
@@ -1230,7 +1254,7 @@ class UserService
return
DataReturn
(
$ret
,
-
1
);
}
// 是否开启用户
注册
// 是否开启用户
登录
if
(
!
in_array
(
$params
[
'type'
],
MyC
(
'home_user_login_type'
,
[],
true
)))
{
return
DataReturn
(
'暂时关闭登录'
,
-
1
);
...
...
@@ -1857,6 +1881,33 @@ class UserService
return
Db
::
name
(
'User'
)
->
where
([
'id'
=>
$user_id
])
->
update
(
$data
);
}
/**
* 用户openid处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-02-11
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
UserOpenidHandle
(
$params
=
[])
{
$field
=
null
;
$value
=
null
;
$fields_arr
=
array_column
(
MyConst
(
'common_appmini_type'
),
'value'
);
foreach
(
$fields_arr
as
$type
)
{
$openid
=
$type
.
'_openid'
;
if
(
!
empty
(
$params
[
$openid
]))
{
$field
=
$openid
;
$value
=
$params
[
$openid
];
break
;
}
}
return
[
'field'
=>
$field
,
'value'
=>
$value
];
}
/**
* 用户unionid处理
* @author Devil
...
...
@@ -1873,8 +1924,8 @@ class UserService
// QQ用户unionid
$field
=
null
;
$value
=
null
;
$
unionid_all
=
[
'weixin_unionid'
,
'qq_unionid'
];
foreach
(
$
unionid_all
as
$unionid
)
$
fields_arr
=
[
'weixin_unionid'
,
'qq_unionid'
];
foreach
(
$
fields_arr
as
$unionid
)
{
if
(
!
empty
(
$params
[
$unionid
]))
{
...
...
@@ -2042,6 +2093,14 @@ class UserService
// 用户基础信息处理
$data
=
self
::
UserBaseHandle
(
$data
,
$params
);
// 用户openid
$openid
=
self
::
UserOpenidHandle
(
$params
);
if
(
!
empty
(
$openid
[
'field'
])
&&
!
empty
(
$openid
[
'value'
]))
{
// openid放入用户data中
$data
[
$openid
[
'field'
]]
=
$openid
[
'value'
];
}
// 用户unionid
$unionid
=
self
::
UserUnionidHandle
(
$params
);
if
(
!
empty
(
$unionid
[
'field'
])
&&
!
empty
(
$unionid
[
'value'
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录