Commit 922dd7e0 authored by tufengqi's avatar tufengqi

header设置修复

parent e3eefdf3
......@@ -4,10 +4,10 @@ namespace fpf\yii_component;
use Yii;
use yii\base\Component;
use yii\base\InvalidConfigException;
use yii\web\Response;
class Application extends Component
{
use \fpf\response\ResponseApi;
private $trace_config;
public $terry;
private $configures = [];
......@@ -94,12 +94,14 @@ class Application extends Component
if ($set_cookie_val) {
$cookies = Yii::$app->response->cookies;
setcookie(VERSION_KEY, $set_cookie_val, time() + 3600 * 24 * 7);
header('Content-type: application/javascript;charset=utf-8');
\Yii::$app->response->format = Response::FORMAT_RAW;
\Yii::$app->response->headers->add('Content-type', 'application/javascript;charset=utf-8');
return;
}
$app_self_config = Yii::$app->fpf->getConfig(self::APP_SELF_CONFIG_PREFIX . APP_NAME, 'common');
$user_ip = Yii::$app->request->userIP;
if ($this->isAllowIp($user_ip)) {
\Yii::$app->response->headers->add('Content-type', 'text/html');
// 开关开启,用户IP是公司IP,内外IP,允许打开cookie编辑
include(__DIR__ . '/views/CookieEdit.php');
}
......
<?php
header('Content-type: text/html');
?>
<!DOCTYPE html>
<html lang="en">
<head>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment