Commit 1a8eff59 by doszhang

dos

parent ac9cec8a
...@@ -14,7 +14,7 @@ return array( ...@@ -14,7 +14,7 @@ return array(
'DB_TYPE' => 'mysql', 'DB_TYPE' => 'mysql',
'DB_HOST' => 'localhost', 'DB_HOST' => 'localhost',
'DB_PORT' => '3306', 'DB_PORT' => '3306',
'DB_NAME' => '', // <--- 修改这里 'DB_NAME' => 'dev_pingan_20200311_promise', // <--- 修改这里
'DB_USER' => 'dev', // <--- 修改这里 'DB_USER' => 'dev', // <--- 修改这里
'DB_PWD' => '1q2w3e', // <--- 修改这里 'DB_PWD' => '1q2w3e', // <--- 修改这里
'DB_PREFIX' => '', 'DB_PREFIX' => '',
......
...@@ -19,6 +19,25 @@ class IndexController extends Controller ...@@ -19,6 +19,25 @@ class IndexController extends Controller
public function index() public function index()
{ {
session_start();
$_SESSION['joinTime'] = time();
$this->display(); $this->display();
} }
public function addNum(){
$referer = $_SERVER['HTTP_REFERER'];
$refererInfo = parse_url( $referer );
if( $refererInfo['host'] != $_SERVER['HTTP_HOST'] )
{
header("HTTP/1.0 404 Not Found");
exit;
}
session_start();
if(!$_SESSION['joinTime'] || time() - $_SESSION['joinTime'] < 2)
{
header("HTTP/1.0 404 Not Found");
exit;
}
M('num')->where('id=1')->setInc('num');
}
} }
\ No newline at end of file
...@@ -165,6 +165,11 @@ function createPoster(name, business) { ...@@ -165,6 +165,11 @@ function createPoster(name, business) {
$('#notification_area').remove(); $('#notification_area').remove();
my_notify('正在生成海报,请稍候', 60000); my_notify('正在生成海报,请稍候', 60000);
$.ajax({
url: '/index/addNum',
type: 'POST'
});
let oldPosterIndex = nowPosterIndex; let oldPosterIndex = nowPosterIndex;
nowPosterIndex = RandomNumBoth(1, 3, oldPosterIndex); nowPosterIndex = RandomNumBoth(1, 3, oldPosterIndex);
console.log('nowPosterIndex:', nowPosterIndex); console.log('nowPosterIndex:', nowPosterIndex);
......
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 sign in to comment