AbstractController.class.php
1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* Created by PhpStorm.
* 应用回调控制层
* User: zhoutao
* Date: 16/7/14
* Time: 下午2:56
*/
namespace Frontend\Controller\Callback;
use VcySDK\Service;
abstract class AbstractController extends \Common\Controller\Frontend\AbstractController
{
// 回调数据
protected $callBackData = [];
public function before_action($action = '')
{
// 不必登陆
$this->_require_login = false;
// 接收消息
$service = &Service::instance();
$this->callBackData = $service->streamJsonData();
return parent::before_action($action);
}
public function after_action($action = '')
{
parent::after_action($action);
exit('SUCCESS');
}
/**
* 获取 identifier
* @return bool
*/
protected function _identifier()
{
return true;
}
/**格式化考试的封面图片地址
*
* @param $cover_id - 封面 ID
* @return string - 封面 URL
*/
public function format_cover($cover_id)
{
$cover_url = '';
if (!empty($cover_id)) {
$cover_url = imgUrlReal($cover_id);
} else {
$cover_url = cfg('PROTOCAL') . $_SERVER['HTTP_HOST'] . '/admincp/imgs/client/images/exam/examCover.png';
}
return $cover_url;
}
}