Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
bffef3ef
Commit
bffef3ef
authored
Jul 05, 2017
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提供了用户注册服务
parent
d17775da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
ucenter_register.php
example/ucenter_register.php
+16
-0
Member.php
src/ucenter/Member.php
+19
-0
No files found.
example/ucenter_register.php
0 → 100644
View file @
bffef3ef
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2017/7/5
* Time: 18:26
*/
use
internalApi\ucenter\Member
;
require
__DIR__
.
'/_init.php'
;
Member
::
setDebug
();
$name
=
uniqid
(
'dev_'
);
$info
=
Member
::
register
(
$name
,
'123456'
,
$name
,
[
'mobile'
=>
'16000000000'
]);
print_r
(
$info
);
src/ucenter/Member.php
View file @
bffef3ef
...
...
@@ -41,4 +41,23 @@ class Member extends Client
return
self
::
call
(
'member.getSyncByUid'
,
compact
(
'uid'
));
}
/**
* 注册一个用户并获得用户信息
*
* 本方法返回一个数组,其中元素依次为:
* 0 => state: 布尔值,代表注册成功或失败
* 1 => statusText: 状态文本,error 代表错误,registered 代表已注册,ok 代表注册成功
* 2 => result: 注册失败时代表错误消息,注册成功时则是用户信息的数组
*
* @param string $username
* @param string $password
* @param string $nickname
* @param array $expand 扩展信息数组,包含可选字段:mobile, mail, wx_openid, avatar
* @return array [bool state, string statusText, string|array message or user data]
*/
public
static
function
register
(
$username
,
$password
,
$nickname
,
$expand
=
[])
{
return
self
::
call
(
'member.register'
,
compact
(
'username'
,
'password'
,
'nickname'
,
'expand'
));
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment