Commit 93317505 authored by tufengqi's avatar tufengqi

兼容本地开发环境

parent 448f62bf
......@@ -96,6 +96,7 @@ class Application extends Component
setcookie(VERSION_KEY, $set_cookie_val, time() + 3600 * 24 * 7);
\Yii::$app->response->format = Response::FORMAT_RAW;
\Yii::$app->response->headers->add('Content-type', 'application/javascript;charset=utf-8');
\Yii::$app->response->send();
return;
}
$app_self_config = Yii::$app->fpf->getConfig(self::APP_SELF_CONFIG_PREFIX . APP_NAME, 'common');
......@@ -104,6 +105,7 @@ class Application extends Component
$is_online_host = $this->isOnlineHost($host_name);
if ($this->isAllowIp($user_ip)) {
\Yii::$app->response->headers->add('Content-type', 'text/html');
\Yii::$app->response->send();
// 开关开启,用户IP是公司IP,内外IP,允许打开cookie编辑
include(__DIR__ . '/views/CookieEdit.php');
}
......
......@@ -87,6 +87,7 @@
<div class="content">
<div class="cookie_table">
<div class="notice_box"><span><?php
$version = '';
if (VERSION_VALUE) {
$patt = "/(file|cookie)-([a-zA-Z0-9]+)/";
if (preg_match($patt, VERSION_VALUE, $result)) {
......@@ -166,7 +167,7 @@ $(".submit_cookie").on("click",function(){
// 在这里,做想做的事。。。
if(wpoInfo['fpf-version']){
var str = wpoInfo['fpf-version'];
var patt = /(file|cookie)-([a-zA-Z0-9]+)/;
var patt = /(file|cookie)-([a-zA-Z0-9-]+)/;
var result;
if ((result = patt.exec(str)) != null) {
var type = result[1];
......
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