spqr/app/controller/IndexController.php

33 lines
711 B
PHP
Raw Normal View History

2024-11-05 12:10:06 +08:00
<?php
namespace app\controller;
use support\Request;
class IndexController
{
public function index(Request $request)
{
$session = $request->session();
$user=$session->get('user',null);
$realname=$session->get('realname',null);
if($user==null||$realname==null){
$display='none';
}else{
$display='block';
}
return view('index', ['user' => $user,'realname' => $realname,'display' => $display]);
}
public function view(Request $request)
{
return view('index/view', ['name' => 'webman']);
}
public function json(Request $request)
{
return json(['code' => 0, 'msg' => 'ok']);
}
}