public static function writeLog() { if (Config::get('is_write_log', true) !== true) { return false; } $SystemLog = new \App\Task\model\SystemLog(); $_SESSION = !empty($_SESSION) ? $_SESSION : array(); $model = in_array($v = strtolower(SsdPHP::getModel()), self::$_model_map) ? array_search($v, self::$_model_map) : 7; $logData = ['date' => date('Ymd'), 'model' => 1, 'controller' => SsdPHP::getController(), 'action' => SsdPHP::getAction(), 'session_id' => session_id(), 'session_val' => json_encode($_SESSION, JSON_UNESCAPED_UNICODE), 'custom_val' => json_encode(Response::getData(), JSON_UNESCAPED_UNICODE), 'create_time' => $_SERVER['REQUEST_TIME'], 'sql' => json_encode(Mysql::getSqlRecord())]; $s = $SystemLog->addLog($logData); }
function jstoken() { $accessKey = Config::getField("Qiniu", "AK"); $secretKey = Config::getField("Qiniu", "SK"); $auth = new Auth($accessKey, $secretKey); // 空间名 http://developer.qiniu.com/docs/v6/api/overview/concepts.html#bucket $bucket = Config::getField("Qiniu", "bucket"); // 生成上传Token $token = $auth->uploadToken($bucket, $key = null, 3600, array()); $t = array("uptoken" => $token, "domain" => Config::getField("Qiniu", "domain")); Response::apiJsonResult($t, 1); }