如何修复仅在非我自己的计算机上可以正常渲染的Laravel项目?

时间:2018-06-27 09:51:44

标签: css laravel heroku

我的OS X计算机无法正确渲染特定的Laravel项目。我可以登录,但是似乎所有CSS都被阻止了。它看起来像这样:

enter image description here

它应该看起来像这样:

enter image description here

我做过大部分编码的朋友也有Mac,它可以在他的计算机上工作。但不是我的。我没有编写任何代码。我尝试了3种浏览器(FF,Chrome,Safari),但都无济于事。它可以在我的Android手机和另一台Windows计算机上使用。

在此处可见:https://shielded-lowlands-91684.herokuapp.com/

我可以在Gitlab(https://gitlab.com/kaspis912/blog)或Heroku上共享仓库。但是,Gitlab我需要单独添加一个人,因为它是私人的。

我还可以添加单个文件,这将对您有所帮助。这是一个: App.blade.php

<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Blog') }}</title>
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
    <div id="app">
        <nav class="navbar navbar-default navbar-static-top">
            <div class="container">
                <div class="navbar-header">

                    <!-- Collapsed Hamburger -->
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse" aria-expanded="false">
                        <span class="sr-only">Toggle Navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <!-- Branding Image -->
                    <a class="navbar-brand" href="{{ url('/') }}">
                        {{ config('app.name') }}
                    </a>
                </div>

                <div class="collapse navbar-collapse" id="app-navbar-collapse">
                    <!-- Left Side Of Navbar -->
                    @if(Auth::user())
                    <ul class="nav navbar-nav">
                        <li><a href="{{ route('articles.index') }}">Articles</a></li>
                    </ul>
                    @endif

                    <!-- Right Side Of Navbar -->
                    <ul class="nav navbar-nav navbar-right">
                        <!-- Authentication Links -->
                        @guest
                            <li><a href="{{ route('login') }}">Login</a></li>
                            <li><a href="{{ route('register') }}">Register</a></li>
                        @else
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true">
                                    {{ Auth::user()->name }} <span class="caret"></span>
                                </a>

                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="{{ route('logout') }}"
                                            onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                            Logout
                                        </a>

                                        <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                            {{ csrf_field() }}
                                        </form>
                                    </li>
                                    <li>
                                        <a id="delete-btn" href="#">
                                            Delete Account
                                        </a>
                                        <form id="delete-form" method="POST" action="{{ route('users.destroy', Auth::id()) }}" accept-charset="UTF-8">
                                            {{ method_field('DELETE') }}
                                            {{csrf_field()}}
                                        </form>
                                    </li>
                                </ul>
                            </li>
                        @endguest
                    </ul>
                </div>
            </div>
        </nav>

        @yield('content')
    </div>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}"></script>
    <script>
        $('.confirm-delete').on('click', function(event){
            return confirm('Are you sure you want to delete this item?');
        });

        $('#delete-btn').on('click', function(event){
            event.preventDefault();
            var confirm_delete = confirm('Are you sure you want to delete your account?');
            if(confirm_delete== true){
                $('#delete-form').submit();
            }
        });
    </script>
</body>
</html>

以下是我尝试检查chrome中的元素时发生的一些情况。似乎有些CSS变灰了。我不知道为什么。enter image description here

1 个答案:

答案 0 :(得分:5)

使用var willIGetNewPhone = ()=>new Promise( (resolve, reject)=>{ setTimeout(()=>{ var reason = new Error('mom is not happy'); reject(reason); }, 1000); } ); willIGetNewPhone() .catch(error=>{ console.log(error.message); });

更改这两行

using (HttpClient httpClient = new HttpClient())
        {
            var formContent = new FormUrlEncodedContent(new[]
            {
                new KeyValuePair<string, string>("grant_type", "authorization_code"),
                new KeyValuePair<string, string>("client_id", _appSettings.DynamicsCredentials.ClientId),
                new KeyValuePair<string, string>("code", _exerciceExecutionObject.AuthCode),
                new KeyValuePair<string, string>("resource", _appSettings.DynamicsCredentials.Tenant),
                new KeyValuePair<string, string>("redirect_uri", _appSettings.DynamicsCredentials.RedirectUrl)
            });

            HttpResponseMessage response = await httpClient.PostAsync(_adfsCredentials.TokenEndpoint, formContent);
            response.EnsureSuccessStatusCode();
        }

使用

secure_asset