瀏覽代碼

使用umi的publicPath (#6820)

海军 5 年之前
父節點
當前提交
3b13ed1c18
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/pages/document.ejs

+ 3 - 3
src/pages/document.ejs

@@ -22,7 +22,7 @@
       content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
     />
     <title>Ant Design Pro</title>
-    <link rel="icon" href="/favicon.png" type="image/x-icon" />
+    <link rel="icon" href="<%= context.config.publicPath +'favicon.png'%>" type="image/x-icon" />
   </head>
   <body>
     <noscript>Out-of-the-box mid-stage front/design solution!</noscript>
@@ -36,7 +36,7 @@
           padding: 0;
         }
         #root {
-          background-image: url('/home_bg.png');
+          background-image: url('<%= context.config.publicPath +"home_bg.png"%>');
           background-repeat: no-repeat;
           background-size: 100% auto;
         }
@@ -191,7 +191,7 @@
           height: 100%;
         "
       >
-        <img src="/pro_icon.svg" alt="logo" width="256" />
+        <img src="<%= context.config.publicPath +'pro_icon.svg'%>" alt="logo" width="256" />
         <div class="page-loading-warp">
           <div class="ant-spin ant-spin-lg ant-spin-spinning">
             <span class="ant-spin-dot ant-spin-dot-spin"