建立適合桌面和 Web 部署的多功能 Vue+Electron 應用程式
P粉418214279
P粉418214279 2024-03-29 15:40:18
0
1
414

我已經使用這個模板來開發我的應用程序,它是一個帶有 Electron 建構器的 Vue 應用程式。現在我有一個問題: 我需要建立生產並部署我的專案一次作為電子包,另一次部署為託管在 Web 伺服器上的 Web 應用程式。我也不想將它分成兩個儲存庫。有人有建議嗎?

我嘗試使用 dist 資料夾作為網站的根資料夾,並添加了一個 web.config 文件,如下所示,但出現錯誤。

web.config檔內容:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Vue" stopProcessing="true">
                    <match url=".*" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_URI}" pattern="^/api/.*" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="/" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

IIS 上的錯誤:

P粉418214279
P粉418214279

全部回覆(1)
P粉068510991

是的,您需要在 IIS 上安裝 url 重寫模組。否則,IIS 將無法理解 <rewrite> <rules> <rule name="Vue" stopProcessing="true"> 在 web.config 中的意義。

此處下載

#
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!