Commit 247ca615 authored by 杨培's avatar 杨培

七牛回调地址改为根据环境判断

加入我的会员页面
订单页面加入权限控制
parent 2b6e0e85
...@@ -134,14 +134,16 @@ class Qiniu extends Object ...@@ -134,14 +134,16 @@ class Qiniu extends Object
$config = $this->storages[$storage]; $config = $this->storages[$storage];
$callbackUrl = Url::to(['qiniu-callback/rem-upload'], true); $callbackUrl = YII_ENV == 'dev'
? 'http://t.pp.cc/tmp/qiniu_callback.php'
: Url::to(['qiniu-callback/rem-upload'], true);
$policy = [ $policy = [
'returnBody' => '{"key":$(key)}', 'returnBody' => '{"key":$(key)}',
'saveKey' => $filename, 'saveKey' => $filename,
'fsizeLimit' => $config['fsizeLimit'], 'fsizeLimit' => $config['fsizeLimit'],
'mimeLimit' => $config['mimeLimit'], 'mimeLimit' => $config['mimeLimit'],
'callbackUrl' => 'http://t.pp.cc/tmp/qiniu_callback.php', 'callbackUrl' => $callbackUrl,
'callbackBody' => 'key=$(key)&storage='.$storage.'&bucket='.$config['bucket'] 'callbackBody' => 'key=$(key)&storage='.$storage.'&bucket='.$config['bucket']
.'&uuid=$(uuid)&time=$(year)-$(mon)-$(day)+$(hour)%3A$(min)%3A$(sec)&fsize=$(fsize)' .'&uuid=$(uuid)&time=$(year)-$(mon)-$(day)+$(hour)%3A$(min)%3A$(sec)&fsize=$(fsize)'
.'&w=$(imageInfo.width)&h=$(imageInfo.height)' .'&w=$(imageInfo.width)&h=$(imageInfo.height)'
......
...@@ -3,13 +3,35 @@ ...@@ -3,13 +3,35 @@
namespace frontend\controllers; namespace frontend\controllers;
use common\models\Income; use common\models\Income;
use frontend\components\ClassesFilter;
use Yii; use Yii;
use yii\filters\AccessControl;
class MyIncomeController extends \yii\web\Controller class MyIncomeController extends \yii\web\Controller
{ {
public $layout = 'classCenter'; public $layout = 'classCenter';
/**
* @inheritdoc
*/
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
//'only' => ['index', 'publish', 'submit'],
'rules' => [
[
'allow' => true,
'roles' => ['@']
]
]
],
'classes' => ClassesFilter::className()
];
}
/** /**
* 售课记录 * 售课记录
* @return string * @return string
......
...@@ -4,6 +4,9 @@ namespace frontend\controllers; ...@@ -4,6 +4,9 @@ namespace frontend\controllers;
class MyMemberController extends \yii\web\Controller class MyMemberController extends \yii\web\Controller
{ {
public $layout = 'classCenter';
public function actionIndex() public function actionIndex()
{ {
return $this->render('index'); return $this->render('index');
......
...@@ -31,9 +31,10 @@ class QiniuCallbackController extends \yii\web\Controller ...@@ -31,9 +31,10 @@ class QiniuCallbackController extends \yii\web\Controller
//验证回调请求 //验证回调请求
$requestBody = file_get_contents('php://input'); $requestBody = file_get_contents('php://input');
$authorization = isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : ''; $authorization = isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : '';
$currentUrl = Yii::$app->request->hostInfo.Yii::$app->request->getUrl();
$currentUrl = 'http://t.pp.cc/tmp/qiniu_callback.php'; $currentUrl = YII_ENV == 'dev'
? 'http://t.pp.cc/tmp/qiniu_callback.php'
: Yii::$app->request->hostInfo.Yii::$app->request->getUrl();
if (!$auth->verifyCallback($_SERVER['CONTENT_TYPE'], $authorization, $currentUrl, $requestBody)) { if (!$auth->verifyCallback($_SERVER['CONTENT_TYPE'], $authorization, $currentUrl, $requestBody)) {
return ['error'=>'回调验证失败!']; return ['error'=>'回调验证失败!'];
......
...@@ -33,7 +33,7 @@ $this->beginContent('@app/views/layouts/center.php'); ...@@ -33,7 +33,7 @@ $this->beginContent('@app/views/layouts/center.php');
<li> <li>
<div class="link"><i class="icon-fingerprint"></i>我的会员<i class="icon-navigate_next"></i></div> <div class="link"><i class="icon-fingerprint"></i>我的会员<i class="icon-navigate_next"></i></div>
<ul class="submenu"> <ul class="submenu">
<li><a href="#">会员列表</a></li> <li><a href="/my-member">会员列表</a></li>
</ul> </ul>
</li> </li>
<li> <li>
......
...@@ -36,4 +36,7 @@ $qiniu = \Yii::$app->qiniu; ...@@ -36,4 +36,7 @@ $qiniu = \Yii::$app->qiniu;
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<?=LinkPager::widget(['pagination'=>$pagination])?>
\ No newline at end of file <div class="text-center">
<?=LinkPager::widget(['pagination'=>$pagination])?>
</div>
<?php <?php
/* @var $this yii\web\View */ /* @var $this yii\web\View */
?> ?>
<h1>my-member/index</h1> <div class="vip-top">
<div class="col-md-6">
<div class="reg-vip-box">
<b>47</b>
<span>全部会员</span>
<i class="icon-verified_user"></i>
</div>
</div>
<div class="col-md-6">
<div class="money-vip-box">
<b>23</b>
<span>付费会员</span>
<i class="icon-heart"></i>
</div>
</div>
</div>
<p> <div class="con-md-12">
You may change the content of this page by modifying <div class="table-responsive table-box">
the file <code><?= __FILE__; ?></code>. <table class="table table-hover">
</p> <thead>
<tr>
<th>注册时间</th>
<th>会员信息</th>
<th>来自</th>
<th>首次购买</th>
<th>累计消费</th>
</tr>
</thead>
<tbody>
<tr>
<td>2016-12-11</td>
<td>18788860327 / 百丐洪七公</td>
<td>推广</td>
<td>《中国为什么这么久还没有进入社会主义社会》</td>
<td>¥123.00</td>
</tr>
<tr>
<td>2016-12-11</td>
<td>18788860327 / 百丐洪七公</td>
<td>推广</td>
<td>《中国为什么这么久还没有进入社会主义社会》</td>
<td>¥123.00</td>
</tr>
</tbody>
</table>
<div class="text-center hide">
<ul class="pagination pagination-sm">
<li><a href="#">&laquo;</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">&raquo;</a></li>
</ul>
</div>
</div>
</div>
\ No newline at end of file
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 to comment