Commit 42633065 authored by 杨培's avatar 杨培

移除 ClientUser

parent 90aa42b1
<?php
require ECMS_PATH . "e/extend/ibanshou/ClientCore.php";
/**
* Class ClientCore
* 用户信息相关接口
*
* 1. 用户登录, 流程:
* 子系统登录, 点击登录重定向到用户中登录:
* 失败: 继续登录流程
* 成功: 返回到子系统的CAS客户端, 通过用户名/用户id获取用户信息, 检查子系统是否该用户:
* 有: 子系统登录成功;
* 否: 保持用户信息到子系统中, 登录成功;
*
*
* 2. 更新用户信息, 更新系统与用户中心B的公共字段
* 备注:
* 多系统同步:
* 子系统设置计划任务, 根据用户中心与子系统的更新时间字段判断是否更新数据
*
*
* 3. 添加/注册用户
* 子系统注册, 点击注册重定向的用户中心注册:
* 失败: 继续注册流程
* 成功: 跳转到用户中心登录页面
*
*/
class ClientUser extends ClientCore
{
/**
* cas 登录后流程
* @param $wxhuid
* @return bool
*/
public function cas($wxhuid)
{
return $this->HanderResult($this->Hander(['wxhuid' => $wxhuid], 'cas'));
}
/**
* 修改用户信息
* @param $wxhuid
* @param $data
* @return array
*
* data example:
* [
* 'nickname' => '', //昵称
* 'password' => '', //密码
* 'mobile' => '', //手机
* 'mail' => '', //邮箱
* 'avatar' => '', //头像
* 'wx_openid' => '', //微信openid
* ]
*/
public function update($wxhuid, $data)
{
if (array_key_exists('wxhuid', $data)) {
unset($data['wxhuid']);
}
return $this->HanderResult($this->Hander(['wxhuid' => $wxhuid, 'data' => json_encode($data)], 'update-user'));
}
/**
* 修改用户密码
* @param $wxhuid
* @param $password
* @param $newPassword
* @return array|bool|mixed
*/
public function updatePassword($wxhuid, $password, $newPassword)
{
return $this->HanderResult($this->Hander(['wxhuid' => $wxhuid, 'password' => $password, 'newPassword' => $newPassword], 'update-password'));
}
/**
* @param $users
* @return array|bool|mixed
*
* users example:
* [
* [
* 'username' => '',
* 'password' => '',
* 'mobile' => '',
* 'nickname' => '',
* 'mail' => '',
* 'avatar' => '',
* ],
* ...
* ]
*/
public function syncuser($users)
{
return $this->HanderResult($this->Hander(['users' => json_encode($users)], 'sync-user'));
}
/**
* 获取微信accessToken
* @return array|bool|mixed
*/
public function wxAccessToken()
{
return $this->HanderResult($this->Hander([], 'wx-access-token'));
}
/**
* 获取微信openid
* @param $openidToken
* @return array|bool|mixed
*/
public function wxOpenid($openidToken)
{
return $this->HanderResult($this->Hander(['openidToken' => $openidToken], 'wx-openid'));
}
/**
* 获取微信用户信息
* @param $openid
* @return array|bool|mixed
*/
public function wxUserInfo($openid)
{
return $this->HanderResult($this->Hander(['openid' => $openid], 'wx-user-info'));
}
}
\ No newline at end of file
...@@ -5,7 +5,6 @@ require '../class/db_sql.php'; ...@@ -5,7 +5,6 @@ require '../class/db_sql.php';
require 'class/user.php'; require 'class/user.php';
require '../class/q_functions.php'; require '../class/q_functions.php';
require "../extend/ibanshou/ClientUser.php";
$link=db_connect(); $link=db_connect();
$empire=new mysqlquery(); $empire=new mysqlquery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment