当前位置: 首页 > news >正文

vscode 配置网址

首先我的项目是一个面向医院的系统

我是在三个文件里都配置了网址

第一个文件:vue.config.js

const path = require('path')
const webpack = require('webpack')
const createThemeColorReplacerPlugin = require('./config/plugin.config')function resolve (dir) {return path.join(__dirname, dir)
}const vueConfig = {publicPath: '/dist',configureWebpack: {plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)],externals: {}},chainWebpack: (config) => {config.resolve.alias.set('@$', resolve('src'))const svgRule = config.module.rule('svg')svgRule.uses.clear()svgRule.oneOf('inline').resourceQuery(/inline/).use('vue-svg-icon-loader').loader('vue-svg-icon-loader').end().end().oneOf('external').use('file-loader').loader('file-loader').options({name: 'assets/[name].[hash:8].[ext]'})},css: {loaderOptions: {less: {javascriptEnabled: true}}},devServer: {port: 8000,proxy: {'/admin': {// target: 'http://压缩的网址:端口号',target: 'http://正常调试的网址:端口号',ws: false,changeOrigin: true}}},productionSourceMap: false,transpileDependencies: [],runtimeCompiler: true
}
if (process.env.VUE_APP_PREVIEW === 'true') {console.log('VUE_APP_PREVIEW', true)vueConfig.configureWebpack.plugins.push(createThemeColorReplacerPlugin())
}module.exports = vueConfig

这个文件里最重要的代码是

  devServer: {port: 8000,proxy: {'/admin': {// target: 'http://压缩网址:端口号',target: 'http://正常网址:端口号',ws: false,changeOrigin: true}}},

第二个出现的地方 是根据自己需要 因为我用到了视频通话 需要建立连接

    // 建立socket及rtconsocket () {if ('WebSocket' in window) {const onlyKey = moment().valueOf() + '_pc'// 生产环境// const url = window.location.hostname + ':8080' + '/websocket?Bedno=' + onlyKey// this.ws = new WebSocket('ws://' + url)// 开发环境this.ws = new WebSocket('ws://网址:端口号/websocket?Bedno=' + onlyKey)this.socket.setWs(this.ws)} else {this.$message.info('您的浏览器不支持websocket')}this.ws.onmessage = this.onmessagethis.ws.onopen = this.onopenthis.ws.onerror = this.onerrorthis.ws.onclose = this.onclose},

所以小伙伴在实际运用中,需要用到视频通话,记得需要建立socket!!

第三个出现的地方是 需要用到文件上传 所以在mounted里也需要加上

  mounted () {// 生产环境// this.originUrl = window.location.protocol + '//' + window.location.host + '/files/'// 开发环境=this.originUrl = 'http://网址:端口号/files/'this.getfilelist()}

 友情提示:小伙伴根据自己的实际需要,去增加、删除网址出现的地方!!!

http://www.lryc.cn/news/169590.html

相关文章:

  • git 本地工作区和仓库区基本使用
  • 有效的括号(栈的高频面试题)
  • GIS跟踪监管系统电子围栏
  • 蓝桥杯2023年第十四届省赛真题-买瓜--Java题解
  • Chatbot到底提供了哪些便利?来看看“中文版Chatbase”
  • 2023-09-18 LeetCode每日一题(打家劫舍 III)
  • Python一行代码实现文件共享【内网穿透公网访问】
  • uni-app 之 下拉刷新,上拉加载,获取网络列表数据
  • 笔记1.2 计算机网络结构
  • 使用Ansible Template模块进行配置文件管理
  • Secrets of RLHF in Large Language Models Part I: PPO
  • Java手写AVL树应用拓展案例
  • vue3+ts+uniapp小程序封装获取授权hook函数
  • 绘图(一)弹球小游戏
  • uniapp滑动事件
  • 入门人工智能 —— 学习 python 使用 IDE :vscode 完成编程 (2)
  • MyBatis字段名和属性名不一样的解决方案
  • Postman应用——Collection、Folder和Request
  • 驱动开发,stm32mp157a开发板的led灯控制实验
  • 黑客入侵机构,导致2万条信息被卖
  • 循环购:让消费者和商家共赢的新型电商模式
  • 分布式缓冲-Redis
  • C# 流Stream详解(3)——FileStream源码
  • C语言的文件操作(炒详解)
  • 27.基于ADS的不等分威尔金森功分器设计
  • Linux自用命令
  • clickhouse union all之后数据量不一致
  • 力扣刷题19-删除链表的倒数第N个节点
  • Unity中的简单数据存储办法
  • Pytorch-MLP-CIFAR10