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

vue3整合springboot打完整jar包

 更新時間:2023年09月11日 15:18:24   作者:華山令狐蟲  
本文主要介紹了vue3整合springboot打完整jar包,文中通過示例代碼介紹的非常詳細,對大家的學(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)文章

最新評論

仪征市| 自贡市| 甘南县| 保定市| 阳原县| 柳河县| 穆棱市| 漳浦县| 婺源县| 马鞍山市| 革吉县| 永年县| 克什克腾旗| 靖州| 台南县| 通江县| 南郑县| 西昌市| 陕西省| 沙洋县| 望奎县| 顺平县| 铜川市| 连城县| 出国| 宜宾县| 临高县| 白城市| 石棉县| 永济市| 河池市| 乐安县| 和静县| 如东县| 张掖市| 兰溪市| 资阳市| 奈曼旗| 英山县| 交口县| 上饶市|