2017-04-26 37 views
0

我試圖設置Oauth2.0服務器,使用PassportLaravel 5.4之後,按照https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13。 我能夠在local host上設置它,但是當我複製了我的prod server上的目錄並嘗試訪問它時,我的vue組件未加載。 我的數據庫和所有的東西都在工作,我能夠註冊新的客戶端,但它沒有加載vue component面板。Vue組件在本地主機上顯示,但不在服務器上使用Laravel 5.4:Passport

PS我認爲這可能與一種方式,這是我的文件夾複製到服務器,但我不知道>我可以提供任何其他信息,如果需要

我有點新的laravel和小白在Vue,所以任何幫助將不勝感激。

我app.js

require('./bootstrap'); 

window.Vue = require('vue'); 

/** 
* Next, we will create a fresh Vue application instance and attach it to 
* the page. Then, you may begin adding components to this application 
* or customize the JavaScript scaffolding to fit your unique needs. 
*/ 

Vue.component('example', require('./components/Example.vue')); 

Vue.component(
    'passport-clients', 
    require('./components/passport/Clients.vue')); 

Vue.component(
    'passport-authorized-clients', 
    require('./components/passport/AuthorizedClients.vue')); 

Vue.component(
    'passport-personal-access-tokens', 
    require('./components/passport/PersonalAccessTokens.vue')); 

const app = new Vue({ 
    el: '#app' 
}); 

我home.blade

@extends('layouts.app') 

@section('content') 
<div class="container"> 
    <div class="row"> 
     <div class="col-md-8 col-md-offset-2"> 
      <div class="panel panel-default"> 
       <passport-clients></passport-clients> 
       <passport-authorized-clients></passport-authorized-clients> 
       <passport-personal-access-tokens></passport-personal-access-tokens> 
     </div> 
    </div> 
</div> 
@endsection 
+0

控制檯上有任何錯誤嗎?你的元素與id應用程序在哪裏?它是在你的佈局?你有沒有嘗試安裝vue開發工具的chrome?然後你可以檢查你的綁定等等。你有ssh訪問權限,你是否在服務器或本地運行你的mix/webpack構建,然後上傳所有內容? –

+0

@FrankProvost嗨,基於評論我運行構建生產模式,然後將其上傳到服務器vue組件工作順利。但我碰到另一個問題,我無法創建新的客戶端和訪問令牌,但會解決它們。謝謝人 –

回答

0

我面臨的問題是由於我跑的組合通過npm run dev即發展建設。正確的行動方式是使用npm run production構建它,然後將其上傳到服務器。

0

Checkout的layout.app刀片,在這部分代碼,你告訴VUE搜索與ID標籤= 「應用程序」 來初始化VUE:

const app = new Vue({ 
    el: '#app' 
}); 

所以,如果你沒有任何,放置

<div id="app"> 

包裝爲您的網頁(或使用範圍或改變選擇)

https://vuejs.org/v2/guide/index.html#Declarative-Rendering

+0

它已經在那裏。 –

相關問題