AJAX_TOKEN::ajax_make PHP Method

ajax_make() public method

ajax_check function.
public ajax_make ( ) : void
return void
    function ajax_make()
    {
        if ($this->adminLogged["alert"] == "y020102") {
            //$_str_token  = fn_token(); //生成令牌
            $_str_alert = "y030102";
            $_str_msg = "ok";
        } else {
            //$_str_token  = "none";
            $_str_alert = "x020404";
            $_str_msg = $this->obj_ajax->alert["x020404"];
            //未登录,抛出错误信息
        }
        $arr_re = array("alert" => $_str_alert, "msg" => $_str_msg);
        exit(json_encode($arr_re));
    }

Usage Example

Example #1
0
<?php

/*-----------------------------------------------------------------
!!!!警告!!!!
以下为系统文件,请勿修改
-----------------------------------------------------------------*/
//不能非法包含或直接执行
if (!defined("IN_BAIGO")) {
    exit("Access Denied");
}
include_once BG_PATH_FUNC . "include.func.php";
fn_include(true, true, "Content-type: application/json; charset=utf-8", true, "ajax", true);
include_once BG_PATH_CONTROL . "admin/ajax/token.class.php";
//载入令牌 ajax 控制器
$ajax_token = new AJAX_TOKEN();
switch ($GLOBALS["act_get"]) {
    case "make":
        $ajax_token->ajax_make();
        //滚动令牌
        break;
}