1
0
This commit is contained in:
2023-11-16 14:33:38 +08:00
parent bff28ef911
commit 4f5a72f777
5 changed files with 74 additions and 47 deletions

View File

@@ -23,6 +23,7 @@ class Member extends _Init
{ {
/** /**
* 获取用户信息 * 获取用户信息
*
* @param integer 用户id * @param integer 用户id
* @return object * @return object
*/ */
@@ -43,6 +44,7 @@ class Member extends _Init
/** /**
* 编辑用户资料 * 编辑用户资料
*
* @param integer 用户id * @param integer 用户id
* @param array 更新的数据 * @param array 更新的数据
* @param string 数据验证的名称 * @param string 数据验证的名称
@@ -70,6 +72,7 @@ class Member extends _Init
/** /**
* 添加 用户资料 * 添加 用户资料
*
* @param [type] $user 添加的信息 * @param [type] $user 添加的信息
*/ */
private static function createInfo($user) private static function createInfo($user)
@@ -77,12 +80,14 @@ class Member extends _Init
$data = [ $data = [
'uid' => $user->id, 'uid' => $user->id,
'mobile' => $user->username, 'mobile' => $user->username,
'nickname' => $user->username,
]; ];
MemberInfoModel::create($data); MemberInfoModel::create($data);
} }
/** /**
* 注册一个用户 * 注册一个用户
*
* @param string $username 用户名 * @param string $username 用户名
* @param string $password 密码 * @param string $password 密码
* @param integer $status 初始状态 * @param integer $status 初始状态
@@ -125,6 +130,7 @@ class Member extends _Init
/** /**
* 修改密码 * 修改密码
*
* @param integer $uid 用户编号 * @param integer $uid 用户编号
* @param string $old 旧密码 * @param string $old 旧密码
* @param string $new 新密码 * @param string $new 新密码
@@ -149,6 +155,7 @@ class Member extends _Init
/** /**
* 更新密码 * 更新密码
*
* @param [type] $uid 用户id * @param [type] $uid 用户id
* @param [type] $password 更新的密码 * @param [type] $password 更新的密码
* @return [type] [description] * @return [type] [description]
@@ -176,6 +183,7 @@ class Member extends _Init
/** /**
* 用户登录 * 用户登录
*
* @param [type] $username 用户民 * @param [type] $username 用户民
* @param [type] $password 密码 * @param [type] $password 密码
* @return [type] 登录的结果 * @return [type] 登录的结果
@@ -226,6 +234,7 @@ class Member extends _Init
/** /**
* 根据openid 登录 * 根据openid 登录
*
* @param [type] $openid [description] * @param [type] $openid [description]
* @return [type] [description] * @return [type] [description]
*/ */
@@ -261,6 +270,7 @@ class Member extends _Init
/** /**
* 退出当前账户 * 退出当前账户
*
* @return [type] [description] * @return [type] [description]
*/ */
public static function logout() public static function logout()
@@ -277,6 +287,7 @@ class Member extends _Init
/** /**
* 修改用户状态 * 修改用户状态
*
* @param [type] $uid 要修改的用户id * @param [type] $uid 要修改的用户id
* @param [type] $status 要修改的状态 正常 禁用 * @param [type] $status 要修改的状态 正常 禁用
*/ */
@@ -296,6 +307,7 @@ class Member extends _Init
/** /**
* 用户登录判断 * 用户登录判断
*
* @return boolean 返回用户id 失败返回0 * @return boolean 返回用户id 失败返回0
*/ */
public static function isLogin() public static function isLogin()
@@ -310,6 +322,7 @@ class Member extends _Init
/** /**
* 切换模版 * 切换模版
*
* @param [type] $uid [description] * @param [type] $uid [description]
* @param [type] $tpl [description] * @param [type] $tpl [description]
* @return [type] [description] * @return [type] [description]
@@ -328,6 +341,7 @@ class Member extends _Init
/** /**
* 绑定微信 * 绑定微信
*
* @param [type] $uid [description] * @param [type] $uid [description]
* @param [type] $data [description] * @param [type] $data [description]
* @return [type] [description] * @return [type] [description]
@@ -346,7 +360,6 @@ class Member extends _Init
ScoreService::setting(UID, $scene); ScoreService::setting(UID, $scene);
} }
return true; return true;
} else { } else {
return '更新失败'; return '更新失败';
} }
@@ -354,6 +367,7 @@ class Member extends _Init
/** /**
* 解除绑定 * 解除绑定
*
* @param [type] $uid [description] * @param [type] $uid [description]
* @param [type] $data [description] * @param [type] $data [description]
* @return [type] [description] * @return [type] [description]

View File

@@ -11,6 +11,7 @@ namespace app\common\service;
use app\common\model\Sms as SmsModel; use app\common\model\Sms as SmsModel;
use app\common\validate\Sms as SmsValidate; use app\common\validate\Sms as SmsValidate;
use think\Config; use think\Config;
use think\Log;
use tools\Str; use tools\Str;
class Sms extends _Init class Sms extends _Init
@@ -19,6 +20,7 @@ class Sms extends _Init
public static function send($mobile) public static function send($mobile)
{ {
$code = Str::number(1, 9999); $code = Str::number(1, 9999);
$code = 6666;
$data = [ $data = [
'mobile' => $mobile, 'mobile' => $mobile,
'code' => $code, 'code' => $code,
@@ -33,6 +35,7 @@ class Sms extends _Init
if ($res) { if ($res) {
$result = self::ali($mobile, $code); $result = self::ali($mobile, $code);
$result = true;
if ($result) { if ($result) {
return true; return true;
} else { } else {

View File

@@ -10,8 +10,8 @@
return [ return [
'token' => '', 'token' => '',
'appid' => 'wx1c5ee7f76bfcb824', 'appid' => 'wx1c5ee7f76bfcb824',
'secret' => '2c81a59698a2cf70547ef9e88986ccc5', 'secret' => 'c720c4940d5ed64d5355c3b952e23e22',
'AESKey' => '', 'AESKey' => '',
'mch_id' => '', 'mch_id' => '1565916981',
'paykey' => '', 'paykey' => 'Oj8sgYcVNang9lWa6iPch8BgVbxR896q',
]; ];

View File

@@ -19,6 +19,7 @@ class Sms extends _Init
/** /**
* [短信验证码] * [短信验证码]
*
* @return [type] [description] * @return [type] [description]
*/ */
public function getsms() public function getsms()
@@ -33,7 +34,7 @@ class Sms extends _Init
$res = SmsService::send($mobile); $res = SmsService::send($mobile);
if ($res === true) { if ($res === true) {
return $this->success('发送成功'); return $this->success('发送成功:短信验证码6666');
} else { } else {
return $this->error($res); return $this->error($res);
} }
@@ -41,6 +42,7 @@ class Sms extends _Init
/** /**
* [短信验证码] * [短信验证码]
*
* @return [type] [description] * @return [type] [description]
*/ */
public function getresms() public function getresms()

View File

@@ -17,6 +17,7 @@ class Utils
{ {
/** /**
* 错误信息 * 错误信息
*
* @var array * @var array
*/ */
private static $errMsg = [ private static $errMsg = [
@@ -189,6 +190,7 @@ class Utils
/** /**
* 返回数据结果集 * 返回数据结果集
*
* @var mixed * @var mixed
*/ */
public static $result; public static $result;
@@ -201,6 +203,7 @@ class Utils
/** /**
* 发送HTTP请求方法目前只支持CURL发送请求 * 发送HTTP请求方法目前只支持CURL发送请求
*
* @param string $url 请求URL * @param string $url 请求URL
* @param array $params 请求参数 * @param array $params 请求参数
* @param string $method 请求方法GET/POST * @param string $method 请求方法GET/POST
@@ -244,6 +247,7 @@ class Utils
/** /**
* XML文档解析成数组并将键值转成小写 * XML文档解析成数组并将键值转成小写
*
* @param xml $xml * @param xml $xml
* @return array * @return array
*/ */
@@ -255,6 +259,7 @@ class Utils
/** /**
* 将数组转换成XML * 将数组转换成XML
*
* @param array $array * @param array $array
* @return xml * @return xml
*/ */
@@ -267,6 +272,7 @@ class Utils
/** /**
* 数据XML编码 * 数据XML编码
*
* @param xml $xml XML对象 * @param xml $xml XML对象
* @param mixed $data 数据 * @param mixed $data 数据
* @param string $item 数字索引时的节点名称 * @param string $item 数字索引时的节点名称
@@ -293,6 +299,7 @@ class Utils
/** /**
* 解析返回的json数据 * 解析返回的json数据
*
* @param [type] $json * @param [type] $json
* @return * @return
*/ */
@@ -314,6 +321,7 @@ class Utils
/** /**
* 解析错误信息 * 解析错误信息
*
* @param array $result * @param array $result
* @return string * @return string
*/ */