最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue3整合springboot打完整jar包

 更新時間:2023年09月11日 15:18:24   作者:華山令狐蟲  
本文主要介紹了vue3整合springboot打完整jar包,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

前端

  • .env.developmen
VITE_APP_BASE_URL='/api'
  • .env.production
VITE_APP_BASE_URL='/'

axios 配置

axios.defaults.baseURL = import.meta.env.VITE_APP_BASE_URL

package.json

  "scripts": {
    "dev": "vite --mode development",
    "build": "vite build --mode production"
  }

vite.config.js

 server: {
    port: 4000, //設(shè)置服務(wù)啟動端口號,是一個可選項,不要設(shè)置為本機的端口號,可能會發(fā)生沖突
    open: true, //是否自動打開瀏覽器,可選項
    cors: true, //允許跨域。
    // 設(shè)置代理
    proxy: {
      '/api': {
        target: 'http://localhost:8053/', //這是你要跨域請求的地址前綴
        changeOrigin: true, //開啟跨域
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }

后端

pom.xml

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <id>exec-pnpm-install</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>pnpm</executable>
                            <arguments>
                                <argument>install</argument>
                            </arguments>
                            <workingDirectory>${basedir}/src/ui</workingDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>exec-pnpm-run-build</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>pnpm</executable>
                            <arguments>
                                <argument>build</argument>
                            </arguments>
                            <workingDirectory>${basedir}/src/ui</workingDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

到此這篇關(guān)于vue3整合springboot打完整jar包的文章就介紹到這了,更多相關(guān)vue3 springboot打jar包內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家! 

相關(guān)文章

最新評論

松江区| 华蓥市| 金沙县| 双辽市| 桐柏县| 南乐县| 晋宁县| 新田县| 靖边县| 大足县| 娄底市| 广德县| 盐山县| 临洮县| 丘北县| 克什克腾旗| 湟源县| 益阳市| 桐庐县| 山阳县| 临猗县| 青浦区| 灵璧县| 安陆市| 富顺县| 潞西市| 乳山市| 星子县| 宁国市| 呼图壁县| 海兴县| 黄大仙区| 平江县| 鱼台县| 武夷山市| 土默特右旗| 章丘市| 沂南县| 滦平县| 防城港市| 南靖县|