Java后端、PC前端学习备忘

1、vue中

复制代码
const row = this.$route.query.row

this.$router.go(-1)

能看出route和router的区别。

2、const APP_NAME = require('./package.json').name;

知道require是怎么回事。package.json文件内容是一个json内容,获取这个json内容的name。

3、vue.config.js中

复制代码
module.exports = {

// 配置转发代理

  devServer: {

    open: true,

    disableHostCheck: true,

    port: PORT,

    proxy: {



      // 示例代理:连接本地服务,放在"代理:统一入口"前边

//       '/api/act': {

//         target: "http://1.2.2.1:841",  

//         ws: true,

//         proxyTimeout: 10 * 60 * 1000,

//         timeout: 10 * 60 * 1000,

//         pathRewrite: {

//           '^/api/act': ''

//         }

//       },

      // '/api/produce':{

      //   // target: 'http://1.3.2.7:381',  // 代理跨域目标接口

      //   // target: 'http://m..com.cn/api/',  // 生产的

      //   target: 'http://11.0.1.9:40',  // 生产的

      //   ws: true,

      //         proxyTimeout: 10 * 60 * 1000,

      //         timeout: 10 * 60 * 1000,

      //   pathRewrite: {

      //     '^/api/produce': ''

      //   }

      // },

      '/api/produce':{

        // target: 'http://10.3.2.20:381',  // 代理跨域目标接口

        // target: 'http://m.com.cn/api/',  // 生产的

        target: 'http://localhost:4060',  // 生产的

        ws: true,

              proxyTimeout: 10 * 60 * 1000,

              timeout: 10 * 60 * 1000,

        pathRewrite: {

          '^/api/produce': ''

        }

      },



      // 代理:统一入口

      '/api': {

        target: url,

        // pathRewrite: {   //url连接本地服务放开

        //   '^/api': ''

        // }

      },



    }

  }

要知道在微前端架构中,登录和用户等公共服务公共前端要用公共的,自身要去调试的微前端、微服务要用自己本机的,便于独立开发前端或者后端,不会影响到开发环境的前端或者后端。

要同时改下后端的nacos下service(如果没有就得添加):

不能影响到nacos上的开发环境的服务。

相关推荐
Martin -Tang2 分钟前
uniapp 实现录音操作,长按录音,放开取消
前端·javascript·vue.js·uni-app·css3·录音
Full Stack Developme15 分钟前
Spring-web 解析
java·前端·spring
humcomm19 分钟前
AI编程对前端架构师技能的具体要求有哪些变化
前端·系统架构·ai编程
ZC跨境爬虫22 分钟前
跟着 MDN 学 HTML day_58:(构建行星数据表——HTML表格高级实战指南)
前端·javascript·ui·html·音视频
kyriewen27 分钟前
用户打开飞行模式都能打开你的网站?Service Worker 做离线缓存,PWA 实战
前端·javascript·面试
我是汪先生27 分钟前
学习 day8 memory
前端
栉甜38 分钟前
APIs学习
前端·javascript·css·学习·html
运营小白40 分钟前
2026 年 Shopify 关键词映射指南:从混乱到有序的实战经验
前端·一人公司·seonib·自动化内容·搜索流量
Dxy12393102161 小时前
HTML的Iframe详解
前端·html
dsyyyyy11011 小时前
CSS定位布局和网格布局
前端·css