init: 从宝塔同步到 Gitea
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
namespace app\disguise\controller;
|
||||
use \think\Controller;
|
||||
use \think\Session;
|
||||
use \think\Cookie;
|
||||
use \think\Request;
|
||||
use \think\Db;
|
||||
|
||||
class Index Extends Controller{
|
||||
public function index(){
|
||||
$referral_code = Request::instance()->get('referral_code');
|
||||
if($referral_code){
|
||||
Cookie::set('referral_code',$referral_code,3600);
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
public function do_disguise(){
|
||||
if(Request::instance()->post()){
|
||||
// 接收参数
|
||||
$code = Request::instance()->post('code');
|
||||
if(!$code){
|
||||
die(json_encode(['code'=>0,'msg'=>'請輸入會議碼!']));
|
||||
}
|
||||
if($code != DISGUISE_CODE){
|
||||
die(json_encode(['code'=>0,'msg'=>'會議碼錯誤']));
|
||||
}else{
|
||||
Cookie::set('disguise_login',1,86400);
|
||||
die(json_encode(['code'=>1,'msg'=>'驗證成功']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user