Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
893657d6
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,体验更适合开发者的 AI 搜索 >>
提交
893657d6
编写于
3月 04, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小程序手机绑定接口更新,api新增注册+验证码发送接口
上级
97269bea
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
155 addition
and
73 deletion
+155
-73
application/api/controller/User.php
application/api/controller/User.php
+116
-43
application/index/controller/User.php
application/index/controller/User.php
+2
-2
application/index/view/default/user/reg_info.html
application/index/view/default/user/reg_info.html
+5
-5
application/service/UserService.php
application/service/UserService.php
+20
-12
changelog.txt
changelog.txt
+2
-1
sourcecode/alipay/default/pages/login/login.js
sourcecode/alipay/default/pages/login/login.js
+2
-2
sourcecode/baidu/default/pages/login/login.js
sourcecode/baidu/default/pages/login/login.js
+2
-2
sourcecode/qq/default/pages/login/login.js
sourcecode/qq/default/pages/login/login.js
+2
-2
sourcecode/toutiao/default/pages/login/login.js
sourcecode/toutiao/default/pages/login/login.js
+2
-2
sourcecode/weixin/default/pages/login/login.js
sourcecode/weixin/default/pages/login/login.js
+2
-2
未找到文件。
application/api/controller/User.php
浏览文件 @
893657d6
...
...
@@ -44,49 +44,135 @@ class User extends Common
}
/**
* [Reg 用户注册-数据添加]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-07T00:08:36+0800
* 用户登录
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
Reg
()
public
function
Login
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
return
UserService
::
Login
(
$this
->
data_post
);
}
// 调用服务层
return
UserService
::
AppReg
(
$this
->
data_post
);
/**
* 用户登录-验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
LoginVerifySend
()
{
return
UserService
::
LoginVerifySend
(
$this
->
data_post
);
}
/**
* [RegVerifySend 用户注册-验证码发送]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-05T19:17:10+0800
* 用户注册
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
Reg
()
{
return
UserService
::
Reg
(
$this
->
data_post
);
}
/**
* 用户注册-验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
RegVerifySend
()
{
// 是否ajax请求
if
(
!
IS_AJAX
)
{
return
$this
->
error
(
'非法访问'
);
}
return
UserService
::
RegVerifySend
(
$this
->
data_post
);
}
// 调用服务层
return
UserService
::
AppUserBindVerifySend
(
$this
->
data_post
);
/**
* 密码找回
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
ForgetPwd
()
{
return
UserService
::
ForgetPwd
(
$this
->
data_post
);
}
/**
* [GetAlipayUserInfo 支付宝用户授权]
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2017-09-23T21:52:49+0800
* 密码找回-验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
ForgetPwdVerifySend
()
{
return
UserService
::
ForgetPwdVerifySend
(
$this
->
data_post
);
}
/**
* 用户-验证码显示
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
UserVerifyEntry
()
{
$params
=
[
'width'
=>
100
,
'height'
=>
26
,
'key_prefix'
=>
input
(
'type'
,
'user_reg'
),
];
$verify
=
new
\
base\Verify
(
$params
);
$verify
->
Entry
();
}
/**
* app用户手机绑定
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
AppMobileBind
()
{
return
UserService
::
AppMobileBind
(
$this
->
data_post
);
}
/**
* app用户手机绑定-验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
AppMobileBindVerifySend
()
{
return
UserService
::
AppMobileBindVerifySend
(
$this
->
data_post
);
}
/**
* 支付宝用户授权
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
AlipayUserAuth
()
{
...
...
@@ -635,18 +721,5 @@ class User extends Common
$this
->
data_post
[
'is_onekey_mobile_bind'
]
=
1
;
return
UserService
::
AuthUserProgram
(
$this
->
data_post
,
APPLICATION_CLIENT_TYPE
.
'_openid'
);
}
/**
* 用户登录
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-03-04
* @desc description
*/
public
function
Login
()
{
return
UserService
::
Login
(
$this
->
data_post
);
}
}
?>
\ No newline at end of file
application/index/controller/User.php
浏览文件 @
893657d6
...
...
@@ -371,11 +371,11 @@ class User extends Common
*/
public
function
UserVerifyEntry
()
{
$params
=
array
(
$params
=
[
'width'
=>
100
,
'height'
=>
26
,
'key_prefix'
=>
input
(
'type'
,
'user_reg'
),
)
;
]
;
$verify
=
new
\
base\Verify
(
$params
);
$verify
->
Entry
();
}
...
...
application/index/view/default/user/reg_info.html
浏览文件 @
893657d6
...
...
@@ -251,17 +251,17 @@ function RegisterSuccessBack(e)
{
$
.
AMUI
.
progress
.
done
();
Prompt
(
e
.
msg
,
'
success
'
);
console
.
log
(
e
.
data
)
// 登录返回html处理
if
((
e
.
data
.
body_html
||
null
)
!=
null
)
{
$
(
'
body
'
).
append
(
e
.
data
.
body_html
);
}
setTimeout
(
function
()
{
window
.
location
.
href
=
'
{{$referer_url}}
'
;
},
1500
);
//
setTimeout(function()
//
{
//
window.location.href = '{{$referer_url}}';
//
}, 1500);
}
else
{
$
(
'
.register-container form.am-form
'
).
find
(
'
button[type="submit"]
'
).
button
(
'
reset
'
);
$
.
AMUI
.
progress
.
done
();
...
...
application/service/UserService.php
浏览文件 @
893657d6
...
...
@@ -822,7 +822,7 @@ class UserService
return
$ret
;
}
//
登录
返回
//
成功
返回
if
(
APPLICATION
==
'app'
)
{
$result
=
self
::
AppUserInfoHandle
(
$user_id
);
...
...
@@ -985,7 +985,14 @@ class UserService
// 用户登录session纪录
if
(
self
::
UserLoginRecord
(
$user_ret
[
'data'
][
'user_id'
]))
{
return
DataReturn
(
'注册成功'
,
0
,
$user_ret
);
// 成功返回
if
(
APPLICATION
==
'app'
)
{
$result
=
self
::
AppUserInfoHandle
(
$user_ret
[
'data'
][
'user_id'
]);
}
else
{
$result
=
$user_ret
[
'data'
];
}
return
DataReturn
(
'注册成功'
,
0
,
$result
);
}
return
DataReturn
(
'注册成功,请到登录页面登录帐号'
);
}
else
{
...
...
@@ -1934,13 +1941,14 @@ class UserService
$body_html
=
[];
// 注册成功后钩子
$user
=
Db
::
name
(
'User'
)
->
field
(
'id,username,nickname,mobile,email,gender,avatar,province,city,birthday'
)
->
where
([
'id'
=>
$user_id
])
->
find
();
$hook_name
=
'plugins_service_user_register_end'
;
$ret
=
HookReturnHandle
(
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
'params'
=>
&
$params
,
'user_id'
=>
$user_id
,
'user'
=>
Db
::
name
(
'User'
)
->
field
(
'id,username,nickname,mobile,email,gender,avatar,province,city,birthday'
)
->
where
([
'id'
=>
$user_id
])
->
find
()
,
'user'
=>
$user
,
'body_html'
=>
&
$body_html
,
]));
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
...
...
@@ -1960,7 +1968,7 @@ class UserService
}
/**
* app用户
注册
* app用户
手机绑定
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -1968,7 +1976,7 @@ class UserService
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
App
Reg
(
$params
=
[])
public
static
function
App
MobileBind
(
$params
=
[])
{
// 数据验证
$p
=
[
...
...
@@ -1989,8 +1997,8 @@ class UserService
return
DataReturn
(
$ret
,
-
1
);
}
// 用户
注册
前校验钩子
$hook_name
=
'plugins_service_user_app_
register
_begin_check'
;
// 用户
手机绑定
前校验钩子
$hook_name
=
'plugins_service_user_app_
mobile_bind
_begin_check'
;
$ret
=
HookReturnHandle
(
Hook
::
listen
(
$hook_name
,
[
'hook_name'
=>
$hook_name
,
'is_backend'
=>
true
,
...
...
@@ -2009,7 +2017,7 @@ class UserService
// 验证码校验
$verify_params
=
[
'key_prefix'
=>
'bind_'
.
md5
(
$params
[
'mobile'
]),
'key_prefix'
=>
'
user_
bind_'
.
md5
(
$params
[
'mobile'
]),
'expire_time'
=>
MyC
(
'common_verify_expire_time'
)
];
$obj
=
new
\
base\Sms
(
$verify_params
);
...
...
@@ -2128,7 +2136,7 @@ class UserService
}
/**
* app用户绑定验证码发送
* app用户
手机
绑定验证码发送
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -2136,7 +2144,7 @@ class UserService
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
App
User
BindVerifySend
(
$params
=
[])
public
static
function
App
Mobile
BindVerifySend
(
$params
=
[])
{
// 数据验证
$p
=
[
...
...
@@ -2160,8 +2168,8 @@ class UserService
// 验证码公共基础参数
$verify_params
=
[
'key_prefix'
=>
'
bind_'
.
md5
(
$params
[
'mobile'
]),
'expire_time'
=>
MyC
(
'common_verify_expire_time'
),
'key_prefix'
=>
'user_
bind_'
.
md5
(
$params
[
'mobile'
]),
'expire_time'
=>
MyC
(
'common_verify_expire_time'
),
'interval_time'
=>
MyC
(
'common_verify_interval_time'
),
];
...
...
changelog.txt
浏览文件 @
893657d6
...
...
@@ -18,12 +18,13 @@ web端
3. 插件(上传、安装、卸载、删除)新增回调事件
4. 后台管理登录优化(新增帐号密码+图片验证码、邮件验证码、手机验证码)
5. 用户登录优化(新增帐号密码+图片验证码、邮件验证码、手机验证码)
6. API用户接口新增帐号密码
、手机验证码、邮箱验证码登录方式
6. API用户接口新增帐号密码
+手机+邮箱[登录、注册]方式、图片验证码+短信邮件验证码发送
小程序
1. 小程序商品详情标题去除高度限制
2. 签到优化,不强制填写信息
3. 微信小程序适配官方新规授权登录逻辑更新
4. 手机绑定接口更新
插件
1. 应用商店(在线自动安装应用插件、开发者提供优质插件、VIP授权管理)
...
...
sourcecode/alipay/default/pages/login/login.js
浏览文件 @
893657d6
...
...
@@ -85,7 +85,7 @@ Page({
this
.
setData
({
verify_submit_text
:
'
发送中
'
,
verify_loading
:
true
,
verify_disabled
:
true
});
my
.
request
({
url
:
app
.
get_request_url
(
'
reg
verifysend
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
verifysend
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
mobile
:
this
.
data
.
mobile
},
dataType
:
'
json
'
,
...
...
@@ -149,7 +149,7 @@ Page({
// 网络请求
my
.
request
({
url
:
app
.
get_request_url
(
'
reg
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
e
.
detail
.
value
,
dataType
:
'
json
'
,
...
...
sourcecode/baidu/default/pages/login/login.js
浏览文件 @
893657d6
...
...
@@ -94,7 +94,7 @@ Page({
this
.
setData
({
verify_submit_text
:
'
发送中
'
,
verify_loading
:
true
,
verify_disabled
:
true
});
swan
.
request
({
url
:
app
.
get_request_url
(
'
reg
verifysend
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
verifysend
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
mobile
:
this
.
data
.
mobile
},
dataType
:
'
json
'
,
...
...
@@ -149,7 +149,7 @@ Page({
// 网络请求
swan
.
request
({
url
:
app
.
get_request_url
(
'
reg
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
e
.
detail
.
value
,
dataType
:
'
json
'
,
...
...
sourcecode/qq/default/pages/login/login.js
浏览文件 @
893657d6
...
...
@@ -81,7 +81,7 @@ Page({
this
.
setData
({
verify_submit_text
:
'
发送中
'
,
verify_loading
:
true
,
verify_disabled
:
true
});
qq
.
request
({
url
:
app
.
get_request_url
(
'
reg
verifysend
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
verifysend
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
mobile
:
this
.
data
.
mobile
},
dataType
:
'
json
'
,
...
...
@@ -148,7 +148,7 @@ Page({
// 网络请求
qq
.
request
({
url
:
app
.
get_request_url
(
'
reg
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
e
.
detail
.
value
,
dataType
:
'
json
'
,
...
...
sourcecode/toutiao/default/pages/login/login.js
浏览文件 @
893657d6
...
...
@@ -113,7 +113,7 @@ Page({
this
.
setData
({
verify_submit_text
:
'
发送中
'
,
verify_loading
:
true
,
verify_disabled
:
true
});
tt
.
request
({
url
:
app
.
get_request_url
(
'
reg
verifysend
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
verifysend
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
mobile
:
this
.
data
.
mobile
},
dataType
:
'
json
'
,
...
...
@@ -179,7 +179,7 @@ Page({
// 网络请求
tt
.
request
({
url
:
app
.
get_request_url
(
'
reg
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
e
.
detail
.
value
,
dataType
:
'
json
'
,
...
...
sourcecode/weixin/default/pages/login/login.js
浏览文件 @
893657d6
...
...
@@ -103,7 +103,7 @@ Page({
this
.
setData
({
verify_submit_text
:
'
发送中
'
,
verify_loading
:
true
,
verify_disabled
:
true
});
wx
.
request
({
url
:
app
.
get_request_url
(
'
reg
verifysend
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
verifysend
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
{
mobile
:
this
.
data
.
mobile
},
dataType
:
'
json
'
,
...
...
@@ -168,7 +168,7 @@ Page({
// 网络请求
wx
.
request
({
url
:
app
.
get_request_url
(
'
reg
'
,
'
user
'
),
url
:
app
.
get_request_url
(
'
appmobilebind
'
,
'
user
'
),
method
:
'
POST
'
,
data
:
e
.
detail
.
value
,
dataType
:
'
json
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录