注销 和创建房间

This commit is contained in:
2025-12-08 10:42:58 +08:00
parent e4c3f572e5
commit c10f055585
3 changed files with 58 additions and 17 deletions

View File

@@ -7,6 +7,7 @@ use app\common\controller\NumberAuth;
use app\api\controller\Sms;
use http\Client;
use think\Controller;
use think\Db;
use think\Loader;
use Firebase\JWT\JWT;
use think\Log;
@@ -360,9 +361,32 @@ class Login extends Controller
//注销
public function cancel()
{
return V(0, '注销请联系客服', null);
$system = input('system','');
if(empty($system)){
$system = request()->header('system');
}
$login_device = input('deviceId','');
if(empty($login_device)){
$login_device = request()->header('deviceId');
}
$token = input('token');
$reslut = model('Login')->cancel($token);
$sms_code = input('sms_code', ''); //短信验证码
$user_info = db::name('user_token')->where('token', $token)->find();
$user_phone = db::name('user')->where(['id' => $user_info['user_id']])->value('mobile');
if ($user_phone) {
if(!$sms_code){
return V(0, '网络错误,请返回【我的】刷新后重新尝试!' );
}else{
//$event = default-默认登录1-更换手机号2绑定手机号3-忘记密码4-设置密码5-账号注销6-提现
$ret = model('sms')->verification_code(5,$user_phone, $sms_code);
if ($ret['code'] == 0) {
return V($ret['code'], $ret['msg'], null);
}
}
}
$reslut = model('Login')->cancel($token, $system,$login_device);
return V($reslut['code'], $reslut['msg'], $reslut['data']);
}