Skip to content

Commit

Permalink
更新版本到2.2.32 具体更新内容看更新日志
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyan74 committed Mar 11, 2019
1 parent dc133d6 commit c7ae2d9
Show file tree
Hide file tree
Showing 108 changed files with 2,479 additions and 1,478 deletions.
5 changes: 3 additions & 2 deletions api/config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
],
'user.log.except.code' => [], // 不记录的code

// token有效期是否验证 默认不关闭验证
'user.accessTokenValidity' => false,
/** ------ token相关 ------ **/
// token有效期是否验证 默认开启验证
'user.accessTokenValidity' => true,
// token有效期 默认 2 小时
'user.accessTokenExpire' => 2 * 60 * 60,
// refresh token有效期是否验证 默认开启验证
Expand Down
5 changes: 4 additions & 1 deletion api/controllers/ActiveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ public function behaviors()
HttpBasicAuth::class,
HttpBearerAuth::class,
HttpHeaderAuth::class,
QueryParamAuth::class,
[
'class' => QueryParamAuth::class,
'tokenParam' => 'access-token'
],
],
// 不进行认证判断方法
'optional' => $this->optional,
Expand Down
2 changes: 1 addition & 1 deletion api/modules/v1/controllers/MiniProgramController.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function actionDecode()
{
$member = new MemberInfo();
$member->attributes = [
'sex' => $userinfo['gender'],
'gender' => $userinfo['gender'],
'nickname' => $userinfo['nickName'],
'head_portrait' => $userinfo['avatarUrl'],
];
Expand Down
2 changes: 1 addition & 1 deletion api/modules/v1/controllers/member/InfoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function actionView($id)
{
$model = $this->modelClass::find()
->where(['id' => $id, 'status' => StatusEnum::ENABLED])
->select(['id', 'username', 'nickname', 'realname', 'head_portrait', 'sex', 'qq', 'email', 'birthday', 'user_money', 'user_integral', 'status', 'created_at'])
->select(['id', 'username', 'nickname', 'realname', 'head_portrait', 'gender', 'qq', 'email', 'birthday', 'user_money', 'user_integral', 'status', 'created_at'])
->asArray()
->one();

Expand Down
2 changes: 1 addition & 1 deletion backend/assets/AppAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class AppAsset extends AssetBundle
'plugins/toastr/toastr.min.css', // 状态通知
'dist/css/AdminLTE.min.css',
'dist/css/rageframe.css',
'dist/css/wechat.css',
];

public $js = [
Expand All @@ -33,6 +32,7 @@ class AppAsset extends AssetBundle
'plugins/sweetalert/sweetalert.min.js',
'plugins/fancybox/jquery.fancybox.min.js',
'dist/js/adminlte.js',
'dist/js/demo.js',
'dist/js/template.js',
'dist/js/rageframe.js',
'dist/js/ueditor.all.min.js',
Expand Down
7 changes: 4 additions & 3 deletions backend/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'assetManager' => [
// 线上建议将forceCopy设置成false,如果访问量不大无所谓
'forceCopy' => true,
'appendTimestamp' => true,
// 'appendTimestamp' => true,
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => null,
Expand All @@ -108,8 +108,9 @@
'provinces' => [
'class' => 'backend\widgets\provinces\ProvincesController',
],
'wechat-select-attachment' => [
'class' => 'backend\widgets\wechatselectattachment\WechatSelectAttachment',
// 微信资源选择
'selector' => [
'class' => 'backend\widgets\selector\SelectorController',
],
],
'params' => $params,
Expand Down
11 changes: 5 additions & 6 deletions backend/config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
'adminAcronym' => 'RF',
'adminTitle' => 'RageFrame',

/** ------ 总管理员配置 ------ **/
'adminAccount' => 1,// 系统管理员账号id

/** ------ 日志记录 ------ **/
'user.log' => true,
'user.log.level' => ['error'], // 级别 ['info', 'warning', 'error']
Expand All @@ -15,13 +18,9 @@
],
'user.log.except.code' => [], // 不记录的code

/** ------ 总管理员配置 ------ **/
'adminAccount' => 1,// 系统管理员账号id

/** ------ 开发者信息 ------ **/
'exploitName' => '简言',
'exploitVersions' => '2.2.21',
'exploitSysName' => 'RageFrame应用开发引擎',
'exploitDeveloper' => '简言',
'exploitFullName' => 'RageFrame应用开发引擎',
'exploitOfficialWebsite' => '<a href="http://www.rageframe.com" target="_blank">www.rageframe.com</a>',
'exploitGitHub' => '<a href="https://github.com/jianyan74/rageframe2" target="_blank">https://github.com/jianyan74/rageframe2</a>',

Expand Down
40 changes: 14 additions & 26 deletions backend/controllers/AddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use common\helpers\AddonHelper;
use common\models\sys\AddonsAuthItemChild;
use common\helpers\AddonAuthHelper;
use common\helpers\DebrisHelper;
use backend\modules\wechat\models\RuleForm;

/**
Expand All @@ -33,7 +34,7 @@ public function behaviors()
'rules' => [
[
'allow' => true,
'roles' => ['@'],// 登录
'roles' => ['@'], // 登录
],
],
],
Expand All @@ -48,6 +49,14 @@ public function behaviors()
*/
public function beforeAction($action)
{
if (Yii::$app->user->isGuest)
{
throw new UnauthorizedHttpException('对不起,请先登录');
}

// 判断是否手机
Yii::$app->params['isMobile'] = DebrisHelper::isMobile();

// 验证是否登录且验证是否超级管理员
if (!Yii::$app->user->isGuest && Yii::$app->services->sys->isAuperAdmin())
{
Expand All @@ -61,9 +70,9 @@ public function beforeAction($action)

// 当前菜单路由
$route = $this->route;
in_array($action->id, ['cover', 'qr-code']) && $route = AddonsAuthItemChild::AUTH_COVER;
in_array($action->id, ['cover']) && $route = AddonsAuthItemChild::AUTH_COVER;
in_array($action->id, ['rule', 'rule-edit', 'rule-delete', 'ajax-update']) && $route = AddonsAuthItemChild::AUTH_RULE;
if (AddonAuthHelper::verify($route) == false)
if (AddonAuthHelper::verify($route) === false)
{
throw new UnauthorizedHttpException('对不起,您现在还没获此操作的权限');
}
Expand Down Expand Up @@ -113,8 +122,9 @@ public function actionRule()
$request = Yii::$app->request;
$keyword = $request->get('keyword', null);

$data = Rule::find()->with('ruleKeyword')
$data = Rule::find()
->where(['module' => Rule::RULE_MODULE_ADDON])
->with('ruleKeyword')
->joinWith('addon as b')
->andWhere(['b.addon' => Yii::$app->params['addon']['name']])
->andFilterWhere(['like', 'name', $keyword]);
Expand Down Expand Up @@ -248,26 +258,4 @@ public function actionAjaxUpdate($id)

return ResultDataHelper::json(200, '修改成功');
}

/**
* 二维码渲染
*
* @return mixed
* @throws \yii\base\InvalidConfigException
* @throws \yii\web\NotFoundHttpException
*/
public function actionQrCode()
{
// 初始化模块
AddonHelper::initAddon($this->addonName, $this->route);

$qr = Yii::$app->get('qr');
Yii::$app->response->format = Response::FORMAT_RAW;
Yii::$app->response->headers->add('Content-Type', $qr->getContentType());

return $qr->setText(Yii::$app->request->get('url', null))
->setSize(150)
->setMargin(7)
->writeString();
}
}
29 changes: 1 addition & 28 deletions backend/controllers/MController.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
<?php
namespace backend\controllers;

use common\helpers\AuthHelper;
use Yii;
use yii\web\UnauthorizedHttpException;
use yii\filters\AccessControl;
use common\helpers\AuthHelper;

/**
* 基类控制器
*
* Class MController
* @package backend\controllers
* @property \yii\db\ActiveRecord $modelClass;
* @property \EasyWeChat\OfficialAccount\Application $app;
* @property \common\services\Application $services;
* @author jianyan74 <[email protected]>
*/
class MController extends \common\controllers\BaseController
{
/**
* 微信实例化SDK
*
* @var
*/
protected $app;

/**
* 服务
*
* @var
*/
protected $services;

/**
* @throws \yii\base\InvalidConfigException
*/
public function init()
{
parent::init();

empty($this->app) && $this->app = Yii::$app->wechat->app;
empty($this->services) && $this->services = Yii::$app->services;
}

/**
* @return array
*/
Expand Down
1 change: 1 addition & 0 deletions backend/modules/member/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/**
* Class Module
* @package backend\modules\member
* @author jianyan74 <[email protected]>
*/
class Module extends \yii\base\Module
{
Expand Down
15 changes: 1 addition & 14 deletions backend/modules/member/views/auth/edit.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use common\enums\GenderEnum;
use common\enums\StatusEnum;
Expand Down Expand Up @@ -29,21 +28,9 @@
<?= $form->field($model, 'head_portrait')->widget('common\widgets\webuploader\Images', [
'config' => [
// 可设置自己的上传地址, 不设置则默认地址
// 'server' => '',
'pick' => [
'multiple' => false,
],
'formData' => [
// 不配置则不生成缩略图
// 'thumb' => [
// [
// 'widget' => 100,
// 'height' => 100,
// ],
// ]
],
'chunked' => false,// 开启分片上传
'chunkSize' => 512 * 1024,// 分片大小
]
]);?>
<?= $form->field($model, 'country')->textInput() ?>
Expand All @@ -68,7 +55,7 @@
<!-- /.box-body -->
<div class="box-footer">
<div class="col-sm-12 text-center">
<button class="btn btn-primary" type="submit" onclick="SendForm()">保存</button>
<button class="btn btn-primary" type="submit">保存</button>
<span class="btn btn-white" onclick="history.go(-1)">返回</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion backend/modules/member/views/member/ajax-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
</div>
</div>

<?php ActiveForm::end(); ?>
<?php ActiveForm::end(); ?>
4 changes: 1 addition & 3 deletions backend/modules/member/views/member/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>


<div class="row">
<div class="col-lg-12">
<div class="box">
Expand All @@ -19,7 +18,7 @@
<?php $form = ActiveForm::begin([
'fieldConfig' => [
'template' => "<div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}{hint}{error}</div>",
]
],
]); ?>
<div class="box-body">
<?= $form->field($model, 'realname')->textInput() ?>
Expand All @@ -46,7 +45,6 @@
],
'options'=>[
'class' => 'form-control no_bor',
'readonly' => 'readonly',// 禁止输入
]
]); ?>
<?= $form->field($model, 'status')->radioList(StatusEnum::$listExplain) ?>
Expand Down
Loading

0 comments on commit c7ae2d9

Please sign in to comment.