Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
system
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
_site-res
system
Commits
922dd7e0
Commit
922dd7e0
authored
May 08, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
header设置修复
parent
e3eefdf3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
Application.php
classes/fpf/yii_component/Application.php
+4
-2
CookieEdit.php
classes/fpf/yii_component/views/CookieEdit.php
+0
-3
No files found.
classes/fpf/yii_component/Application.php
View file @
922dd7e0
...
...
@@ -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'
);
}
...
...
classes/fpf/yii_component/views/CookieEdit.php
View file @
922dd7e0
<?php
header
(
'Content-type: text/html'
);
?>
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment