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
93317505
Commit
93317505
authored
May 09, 2018
by
tufengqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容本地开发环境
parent
448f62bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Application.php
classes/fpf/yii_component/Application.php
+2
-0
CookieEdit.php
classes/fpf/yii_component/views/CookieEdit.php
+2
-1
No files found.
classes/fpf/yii_component/Application.php
View file @
93317505
...
@@ -96,6 +96,7 @@ class Application extends Component
...
@@ -96,6 +96,7 @@ class Application extends Component
setcookie
(
VERSION_KEY
,
$set_cookie_val
,
time
()
+
3600
*
24
*
7
);
setcookie
(
VERSION_KEY
,
$set_cookie_val
,
time
()
+
3600
*
24
*
7
);
\Yii
::
$app
->
response
->
format
=
Response
::
FORMAT_RAW
;
\Yii
::
$app
->
response
->
format
=
Response
::
FORMAT_RAW
;
\Yii
::
$app
->
response
->
headers
->
add
(
'Content-type'
,
'application/javascript;charset=utf-8'
);
\Yii
::
$app
->
response
->
headers
->
add
(
'Content-type'
,
'application/javascript;charset=utf-8'
);
\Yii
::
$app
->
response
->
send
();
return
;
return
;
}
}
$app_self_config
=
Yii
::
$app
->
fpf
->
getConfig
(
self
::
APP_SELF_CONFIG_PREFIX
.
APP_NAME
,
'common'
);
$app_self_config
=
Yii
::
$app
->
fpf
->
getConfig
(
self
::
APP_SELF_CONFIG_PREFIX
.
APP_NAME
,
'common'
);
...
@@ -104,6 +105,7 @@ class Application extends Component
...
@@ -104,6 +105,7 @@ class Application extends Component
$is_online_host
=
$this
->
isOnlineHost
(
$host_name
);
$is_online_host
=
$this
->
isOnlineHost
(
$host_name
);
if
(
$this
->
isAllowIp
(
$user_ip
))
{
if
(
$this
->
isAllowIp
(
$user_ip
))
{
\Yii
::
$app
->
response
->
headers
->
add
(
'Content-type'
,
'text/html'
);
\Yii
::
$app
->
response
->
headers
->
add
(
'Content-type'
,
'text/html'
);
\Yii
::
$app
->
response
->
send
();
// 开关开启,用户IP是公司IP,内外IP,允许打开cookie编辑
// 开关开启,用户IP是公司IP,内外IP,允许打开cookie编辑
include
(
__DIR__
.
'/views/CookieEdit.php'
);
include
(
__DIR__
.
'/views/CookieEdit.php'
);
}
}
...
...
classes/fpf/yii_component/views/CookieEdit.php
View file @
93317505
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
<div
class=
"content"
>
<div
class=
"content"
>
<div
class=
"cookie_table"
>
<div
class=
"cookie_table"
>
<div
class=
"notice_box"
><span>
<?php
<div
class=
"notice_box"
><span>
<?php
$version
=
''
;
if
(
VERSION_VALUE
)
{
if
(
VERSION_VALUE
)
{
$patt
=
"/(file|cookie)-([a-zA-Z0-9]+)/"
;
$patt
=
"/(file|cookie)-([a-zA-Z0-9]+)/"
;
if
(
preg_match
(
$patt
,
VERSION_VALUE
,
$result
))
{
if
(
preg_match
(
$patt
,
VERSION_VALUE
,
$result
))
{
...
@@ -166,7 +167,7 @@ $(".submit_cookie").on("click",function(){
...
@@ -166,7 +167,7 @@ $(".submit_cookie").on("click",function(){
// 在这里,做想做的事。。。
// 在这里,做想做的事。。。
if
(
wpoInfo
[
'fpf-version'
]){
if
(
wpoInfo
[
'fpf-version'
]){
var
str
=
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
;
var
result
;
if
((
result
=
patt
.
exec
(
str
))
!=
null
)
{
if
((
result
=
patt
.
exec
(
str
))
!=
null
)
{
var
type
=
result
[
1
];
var
type
=
result
[
1
];
...
...
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