// nuxt.config.js
ssr: true,
target: 'server'
nuxt generate
server {
listen 443 ssl;
server_name ~^(www\.)?(?<lang>en|ru)\.site\.com;
location / {
proxy_pass http://localhost:3000/$lang;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server {
listen 443 ssl;
server_name site.com;
rewrite ^(.*)$ http://en.site.com;
}
'attributes'=>[PDO::ATTR_STRINGIFY_FETCHES => true],
->select([
'id',
'parent_id',
'type',
'TO_CHAR(text) AS text',
'status',
'client_file',
'client',
'create_at'
])
export default {
install(Vue, options) {
Vue.prototype.$myMethod = function (methodOptions) {
console.log('hello from my plugin')
},
Vue.prototype.getPost = () => {
console.log("jnfjknfdjkngkjdfngjkndfjg");
}
}
}
import MyPlugin from './helper'
Vue.use(MyPlugin)
public function beforeAction($action){
$user_action = $action->controller->id.'/'.$action->id;
if (!in_array($user_action, Yii::$app->user->identity['rols']) && Yii::$app->controller->id != 'default' ) {
$this->redirect(['/admin/default/error']);
return false;
}
return parent::beforeAction($action);
}