Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
miniprogrem-webview
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
33bb0630
authored
Jul 25, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
1c30ed60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
Application/Home/Controller/IndexController.class.php
+24
-1
Application/Home/View/default/layout.tpl
+1
-1
No files found.
Application/Home/Controller/IndexController.class.php
View file @
33bb0630
...
...
@@ -22,5 +22,27 @@ class IndexController extends Controller
$this
->
display
();
}
public
function
wxconfig
(){
get_url_content
(
'http://dos-demo2.dev.izhida.cn/config.php'
))
}
function
get_url_content
(
$url
){
$user_agent
=
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)"
;
$ch
=
curl_init
();
//curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
//设置要访问的IP
curl_setopt
(
$ch
,
CURLOPT_USERAGENT
,
$user_agent
);
//模拟用户使用的浏览器
@
curl_setopt
(
$ch
,
CURLOPT_FOLLOWLOCATION
,
1
);
// 使用自动跳转
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
60
);
//设置超时时间
curl_setopt
(
$ch
,
CURLOPT_AUTOREFERER
,
1
);
// 自动设置Referer
curl_setopt
(
$ch
,
CURLOPT_COOKIEJAR
,
'c:\cookie.txt'
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
0
);
//显示返回的HEAD区域的内容
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_FOLLOWLOCATION
,
1
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
10
);
$result
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
return
$result
;
}
}
\ No newline at end of file
Application/Home/View/default/layout.tpl
View file @
33bb0630
...
...
@@ -127,7 +127,7 @@ $(function(){
var
returnData
=
false
;
$
.
ajax
({
type
:
"get"
,
url
:
'
http://dos-demo2.dev.izhida.cn/config.php
'
,
url
:
'
/index/wxconfig
'
,
data
:
[],
async
:
false
,
success
:
function
(
data
,
textStatus
,
jqXHR
){
...
...
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