Files
2025-08-11 10:22:05 +08:00

38 lines
1008 B
PHP

<?php
namespace app\anchor\controller;
use think\Controller;
use think\Request;
use think\Db;
class Common extends Controller
{
public $uid;
public function initialize()
{
header('Access-Control-Allow-Origin: *');
// ajaxReturn(301, '系统维护');
$login_token = input('login_token', 0);
$reslut = model('User')->check_login_token($login_token);
if ($reslut['code'] == 201) {
return ajaxReturn(301, $reslut['msg'], $reslut['data']);
} else {
$this->uid = $reslut['data'];
}
add_operation(3, $this->uid); //用户行为日志
}
public function check_login_status()
{
$user_name = Db::name("user")->where(array("uid" => $this->uid))->value("user_name");
$data['data'] = $user_name;
ajaxReturn(1, '登录成功', $data);
}
public function get_menu_list()
{
$data = model('SystemMenu')->getSystemInit($this->uid);
return json($data);
}
}