render('res'); } /* * 静态资源缓存清理 * */ public function actionStaticcacheclear() { $cache = Yii::$app->cache; switch (Yii::$app->request->post('type')){ case 1: $name = Yii::$app->params['resourceCacheKey']['mobile']; break; case 2: $name = Yii::$app->params['resourceCacheKey']['frontend']; break; case 3: $name = Yii::$app->params['resourceCacheKey']['backend']; break; default: return Help::JsonCode(Help::ERROR,Yii::t('app','edit_error')); } if($cache->set($name,time())) { return Help::JsonCode(Help::SUCCESS,Yii::t('app','edit_success')); } return Help::JsonCode(Help::ERROR,Yii::t('app','edit_error')); } }