Files

42 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2025-08-11 10:22:05 +08:00
<?php
namespace app\api\controller;
use think\Controller;
class Mode extends Common
{
//开启/关闭青少年模式
public function open_teen_mode(){
$uid = $this->uid;
$key_name = "api:user:open_teen_mode:".$uid;
redis_lock_exit($key_name);
$type = input('type', 1);
$password = input('password', '');
$again_password = input('again_password', '');
$reslut = model('UserMode')->open_teen_mode($uid, $type, $password, $again_password);
redis_unlock($key_name);
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
}
//关闭青少年模式、确认青少年模式密码
public function close_teen_mode(){
$uid = $this->uid;
$key_name = "api:user:close_teen_mode:".$uid;
redis_lock_exit($key_name);
$type = input('type', 1);
$password = input('password', '');
$reslut = model('UserMode')->close_teen_mode($uid, $type, $password);
redis_unlock($key_name);
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
}
/**
* 申诉身份验证
* @return void
*/
public function edit_teen_mode(){
$card_id=input('card_id','');
$real_name=input('real_name','');
$reslut = model('UserMode')->edit_teen_mode($this->uid,$card_id,$real_name);
return ajaxReturn($reslut['code'],$reslut['msg'],$reslut['data']);
}
}