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

出入库管理系统vue2前端开发服务器地址配置

【精选】vue.config.js 的完整配置(超详细)_vue.config.js配置_web学生网页设计的博客-CSDN博客

本项目需要修改两处:

1、vue开发服务器地址:config\index.js

'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.const path = require('path')module.exports = {dev: {// PathsassetsSubDirectory: 'static',assetsPublicPath: '/',proxyTable: {},// Various Dev Server settingshost: '10.0.180.203', //'localhost', // can be overwritten by process.env.HOSTport: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determinedautoOpenBrowser: false,errorOverlay: true,notifyOnErrors: true,poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-// Use Eslint Loader?// If true, your code will be linted during bundling and// linting errors and warnings will be shown in the console.useEslint: true,// If true, eslint errors and warnings will also be shown in the error overlay// in the browser.showEslintErrorsInOverlay: false,/*** Source Maps*/// https://webpack.js.org/configuration/devtool/#developmentdevtool: 'cheap-module-eval-source-map',// If you have problems debugging vue-files in devtools,// set this to false - it *may* help// https://vue-loader.vuejs.org/en/options.html#cachebustingcacheBusting: true,cssSourceMap: true},build: {// Template for index.htmlindex: path.resolve(__dirname, '../dist/index.html'),// PathsassetsRoot: path.resolve(__dirname, '../dist'),assetsSubDirectory: 'static',assetsPublicPath: './',/*** Source Maps*/productionSourceMap: true,// https://webpack.js.org/configuration/devtool/#productiondevtool: '#source-map',// Gzip off by default as many popular static hosts such as// Surge or Netlify already gzip all static assets for you.// Before setting to `true`, make sure to:// npm install --save-dev compression-webpack-pluginproductionGzip: true,productionGzipExtensions: ['js', 'css'],// Run the build command with an extra argument to// View the bundle analyzer report after build finishes:// `npm run build --report`// Set to `true` or `false` to always turn it on or offbundleAnalyzerReport: true}
}

2、后台接口地址:src\utils\request.js

import axios from 'axios'
import {message, Modal, notification} from 'ant-design-vue'
import moment from 'moment'
import store from '../store'
import db from 'utils/localstorage'
moment.locale('zh-cn')// 统一配置
let FEBS_REQUEST = axios.create({baseURL: 'http://10.0.180.203:9527/', // 'http://127.0.0.1:9527/',responseType: 'json',validateStatus (status) {// 200 外的状态码都认定为失败return status === 200}
})// 拦截请求
FEBS_REQUEST.interceptors.request.use((config) => {let expireTime = store.state.account.expireTimelet now = moment().format('YYYYMMDDHHmmss')// 让token早10秒种过期,提升“请重新登录”弹窗体验if (now - expireTime >= -10) {Modal.error({title: '登录已过期',content: '很抱歉,登录已过期,请重新登录',okText: '重新登录',mask: false,onOk: () => {return new Promise((resolve, reject) => {db.clear()location.reload()})}})}// 有 token就带上if (store.state.account.token) {config.headers.Authentication = store.state.account.token}return config
}, (error) => {return Promise.reject(error)
})// 拦截响应
FEBS_REQUEST.interceptors.response.use((config) => {return config
}, (error) => {if (error.response) {let errorMessage = error.response.data === null ? '系统内部异常,请联系网站管理员' : error.response.data.messageswitch (error.response.status) {case 404:notification.error({message: '系统提示',description: '很抱歉,资源未找到',duration: 4})breakcase 403:case 401:notification.warn({message: '系统提示',description: '很抱歉,您无法访问该资源,可能是因为没有相应权限或者登录已失效',duration: 4})breakdefault:notification.error({message: '系统提示',description: errorMessage,duration: 4})break}}return Promise.reject(error)
})const request = {post (url, params) {return FEBS_REQUEST.post(url, params, {transformRequest: [(params) => {let result = ''Object.keys(params).forEach((key) => {if (!Object.is(params[key], undefined) && !Object.is(params[key], null)) {result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&'}})return result}],headers: {'Content-Type': 'application/x-www-form-urlencoded'}})},put (url, params) {return FEBS_REQUEST.put(url, params, {transformRequest: [(params) => {let result = ''Object.keys(params).forEach((key) => {if (!Object.is(params[key], undefined) && !Object.is(params[key], null)) {result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&'}})return result}],headers: {'Content-Type': 'application/x-www-form-urlencoded'}})},get (url, params) {let _paramsif (Object.is(params, undefined)) {_params = ''} else {_params = '?'for (let key in params) {if (params.hasOwnProperty(key) && params[key] !== null) {_params += `${key}=${params[key]}&`}}}return FEBS_REQUEST.get(`${url}${_params}`)},delete (url, params) {let _paramsif (Object.is(params, undefined)) {_params = ''} else {_params = '?'for (let key in params) {if (params.hasOwnProperty(key) && params[key] !== null) {_params += `${key}=${params[key]}&`}}}return FEBS_REQUEST.delete(`${url}${_params}`)},export (url, params = {}) {message.loading('导出数据中')return FEBS_REQUEST.post(url, params, {transformRequest: [(params) => {let result = ''Object.keys(params).forEach((key) => {if (!Object.is(params[key], undefined) && !Object.is(params[key], null)) {result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&'}})return result}],responseType: 'blob'}).then((r) => {const content = r.dataconst blob = new Blob([content])const fileName = `${new Date().getTime()}_导出结果.xlsx`if ('download' in document.createElement('a')) {const elink = document.createElement('a')elink.download = fileNameelink.style.display = 'none'elink.href = URL.createObjectURL(blob)document.body.appendChild(elink)elink.click()URL.revokeObjectURL(elink.href)document.body.removeChild(elink)} else {navigator.msSaveBlob(blob, fileName)}}).catch((r) => {console.error(r)message.error('导出失败')})},download (url, params, filename) {message.loading('文件传输中')return FEBS_REQUEST.post(url, params, {transformRequest: [(params) => {let result = ''Object.keys(params).forEach((key) => {if (!Object.is(params[key], undefined) && !Object.is(params[key], null)) {result += encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) + '&'}})return result}],responseType: 'blob'}).then((r) => {const content = r.dataconst blob = new Blob([content])if ('download' in document.createElement('a')) {const elink = document.createElement('a')elink.download = filenameelink.style.display = 'none'elink.href = URL.createObjectURL(blob)document.body.appendChild(elink)elink.click()URL.revokeObjectURL(elink.href)document.body.removeChild(elink)} else {navigator.msSaveBlob(blob, filename)}}).catch((r) => {console.error(r)message.error('下载失败')})},upload (url, params) {return FEBS_REQUEST.post(url, params, {headers: {'Content-Type': 'multipart/form-data'}})}
}export default request

解析vue中的process.env_vue process-CSDN博客

相关文章:

出入库管理系统vue2前端开发服务器地址配置

【精选】vue.config.js 的完整配置(超详细)_vue.config.js配置_web学生网页设计的博客-CSDN博客 本项目需要修改两处: 1、vue开发服务器地址:config\index.js use strict // Template version: 1.3.1 // see http://vuejs-templa…...

民安智库(第三方满意度调研公司):助力奢侈品品牌提升客户满意度

在奢侈品行业中,客户满意度是衡量品牌价值和市场竞争力的关键因素。为了准确了解客户的需求和反馈,民安智库(北京第三方社会调查评估)以其专业的满意度调查方法,受委托对某奢侈品品牌进行全面的客户满意度调查。 此次…...

蓝牙特征值示例1-迈金L308自行车尾灯夜骑智能表情尾灯的

了解商品级蓝牙特征值 1 服务器(设备)描述 0x02-01-06 05-03-0F180A18 09-FF-FFFF166B001C0101 0A-09-4C3330385F37393937 01设备标识 03服务UUID FF厂商自定义数据(厂家编号:FFFF-166B001C0101) 完整设备名称: L308-7997 2 服…...

Three 笔记

一:常用函数封装 1、实例化three 场景、相机、渲染器 import * as THREE from three;/*** 实例化three 场景、相机、渲染器* param container: dom容器 * param fov: 视野角度 * param near: 相机视锥体近裁截面相对相机的距离 * param far: 相机视锥体远裁截面相…...

Crypto | Affine password 第二届“奇安信”杯网络安全技能竞赛

题目描述: 明文经过仿射函数y3x9加密之后变为JYYHWVPIDCOZ,请对其进行解密,flag的格式为flag{明文的大写形式}。 密文: JYYHWVPIDCOZ解题思路: 1、使用在线网站直接破解或手工计算破解,获得flag。&#xf…...

android使用notification消息通知(工具类封装)

代码直接复制粘贴就可以用了,参数可以更具自己需求添加 private NotificationManager manager;private Notification notification;private static final String NORMAL_CHANNEL_ID "my_notification_normal";private static final String IMPORTANT_CHA…...

PicoDiagnostics (NVH设备软件)-PS软件设置文件类型介绍

作为远程技术指导人员&#xff0c;下面这个功能对你来说可能非常有帮助。 在PicoScope 7 软件的文件保存格式里&#xff0c;通常选择的是<PS 数据文件>类型&#xff0c;容易忽略其他实用的保存文件类型&#xff0c;下面我们介绍<PS设置文件>类型。 PS 数据文件&…...

Linux 定时删除7天前的文件

一、编写脚本 #!/bin/bash find /home/kafka/logs -mtime 10 -name "*.*" -exec rm -rf {} \;保存到home目录下的logs_delete.sh 二、解释 # 命令格式 find 对应目录 -mtime 天数 -name "文件名" -exec rm -rf {} \; # 示例命令&#xff0c;将/home/kaf…...

VISA机制

需要用到VISA的3种机制&#xff1a;属性机制、锁定机制和事件机制。以写资源为例&#xff0c;3种机制的作用如图 &#xff08;1&#xff09;属性机制 属性机制用来控制资源的各种属性&#xff0c;这些属性分为两种&#xff1a;只读属性和可读可写属性。 &#xff08;2&#xf…...

基于开源项目OCR做一个探究(chineseocr_lite)

背景&#xff1a;基于图片识别的技术有很多&#xff0c;应用与各行各业&#xff0c;我们公司围绕电子身份证识别自动录入需求开展&#xff0c;以下是我的研究心得 技术栈&#xff1a;python3.6&#xff0c;chineseocr_lite的onnx推理 环境部署&#xff1a;直接上截图&#xff…...

工作常遇,Web自动化测试疑难解答,测试老鸟带你一篇打通...

目录&#xff1a;导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结&#xff08;尾部小惊喜&#xff09; 前言 1、自动化测试中隐…...

H5判断当前环境是否为微信小程序

H5判断当前环境是否为微信小程序 场景代码 场景 H5需要判断当前环境是否为微信小程序&#xff0c;然后做一些交互调整。 代码 isWxMiniCodeWebviewEnv() {return navigator.userAgent.match(/miniprogram/i) || window.__wxjs_environment miniprogram }...

桌面云架构讲解(VDI、IDV、VOI/TCI、RDS)

目录 云桌面架构 VDI 虚拟桌面基础架构 IDV 智能桌面虚拟化 VOI/TCI VOI 虚拟系统架构 TCI 透明计算机架构 RDS 远程桌面服务 不同厂商云桌面架构 桌面传输协议 什么是云桌面 桌面云是虚拟化技术成熟后发展起来的一种应用&#xff0c;桌面云通常也称为云桌面、VDI等 …...

计算图片中两个任意形状多边形相交部分的大小

一张图片中两个任意多边形相交的面积计算方法。本文参考https://blog.csdn.net/PanYHHH/article/details/110940428&#xff1b;加了一个简单的示例&#xff0c;也对代码做了一点清淅化。原博客中还有其他链接&#xff0c;是C代码&#xff0c;没有看原理&#xff0c;但以下代码…...

JavaScript的函数

在JavaScript中&#xff0c;函数是一种强大而灵活的工具&#xff0c;它们不仅可以执行特定的任务&#xff0c;还可以作为变量、参数和返回值进行传递。本文将介绍JavaScript函数的各个方面&#xff0c;包括函数的定义和调用、函数参数和返回值、匿名函数和箭头函数&#xff0c;…...

stm32 - Cortex

stm32 - Cortex 概念Cortex-M4 的工作模式和工作状态寄存器 概念 Cortex-M4 的工作模式和工作状态 处理模式 当处理器发生了异常或者中断&#xff0c;则进入处理模式进行处理&#xff0c;处理完成后返回到线程模式 权限大&#xff0c;访问处理器中所有的资源 线程模式 芯片复…...

计算机组成原理之概述

概述 计组主要讲的是计算机的硬件实现方式。 机器字长 比如8080处理器&#xff0c;如果想处理16位数的整数运算&#xff0c;就需要执行两次。 可见&#xff0c;机器字长会影响到数据的处理速度。 计算机硬件的基本组成 早期的冯诺依曼机 冯诺依曼提出了“存储程序”的概念&…...

思维导图软件 Xmind mac中文版软件特点

XMind mac是一款思维导图软件&#xff0c;可以帮助用户创建各种类型的思维导图和概念图。 XMind mac软件特点 - 多样化的导图类型&#xff1a;XMind提供了多种类型的导图&#xff0c;如鱼骨图、树形图、机构图等&#xff0c;可以满足不同用户的需求。 - 强大的功能和工具&#…...

群晖 DSM 7.0 Synology Photos IOS | Android 客户端下载

安卓版本低-官方说明&#xff1a;https://www.synology.com/zh-tw/dsm/7.1/software_spec/synology_photos Synology Photos Android 客户端下载大全&#xff1a; https://archive.synology.cn/download/Mobile 官网-Synology Photos | 群暉科技 Synology Inc. 全新的 DSM…...

@CacheInvalidate(name = “xxx“, key = “#results.![a+b]“,multi = true)是什么意思

@CacheInvalidate 注解是 JetCache 框架提供的注解,它是由阿里巴巴开源的组织 Alibaba Group 开发和维护的。JetCache 是一款基于注解的缓存框架,提供了丰富的缓存功能和灵活的配置选项,可用于增强应用程序的性能和可扩展性。JetCache 支持多种缓存后端,包括内存缓存、Redi…...

19c补丁后oracle属主变化,导致不能识别磁盘组

补丁后服务器重启&#xff0c;数据库再次无法启动 ORA01017: invalid username/password; logon denied Oracle 19c 在打上 19.23 或以上补丁版本后&#xff0c;存在与用户组权限相关的问题。具体表现为&#xff0c;Oracle 实例的运行用户&#xff08;oracle&#xff09;和集…...

DAY 47

三、通道注意力 3.1 通道注意力的定义 # 新增&#xff1a;通道注意力模块&#xff08;SE模块&#xff09; class ChannelAttention(nn.Module):"""通道注意力模块(Squeeze-and-Excitation)"""def __init__(self, in_channels, reduction_rat…...

YSYX学习记录(八)

C语言&#xff0c;练习0&#xff1a; 先创建一个文件夹&#xff0c;我用的是物理机&#xff1a; 安装build-essential 练习1&#xff1a; 我注释掉了 #include <stdio.h> 出现下面错误 在你的文本编辑器中打开ex1文件&#xff0c;随机修改或删除一部分&#xff0c;之后…...

《基于Apache Flink的流处理》笔记

思维导图 1-3 章 4-7章 8-11 章 参考资料 源码&#xff1a; https://github.com/streaming-with-flink 博客 https://flink.apache.org/bloghttps://www.ververica.com/blog 聚会及会议 https://flink-forward.orghttps://www.meetup.com/topics/apache-flink https://n…...

代理篇12|深入理解 Vite中的Proxy接口代理配置

在前端开发中,常常会遇到 跨域请求接口 的情况。为了解决这个问题,Vite 和 Webpack 都提供了 proxy 代理功能,用于将本地开发请求转发到后端服务器。 什么是代理(proxy)? 代理是在开发过程中,前端项目通过开发服务器,将指定的请求“转发”到真实的后端服务器,从而绕…...

Reasoning over Uncertain Text by Generative Large Language Models

https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...

uniapp 实现腾讯云IM群文件上传下载功能

UniApp 集成腾讯云IM实现群文件上传下载功能全攻略 一、功能背景与技术选型 在团队协作场景中&#xff0c;群文件共享是核心需求之一。本文将介绍如何基于腾讯云IMCOS&#xff0c;在uniapp中实现&#xff1a; 群内文件上传/下载文件元数据管理下载进度追踪跨平台文件预览 二…...

API网关Kong的鉴权与限流:高并发场景下的核心实践

&#x1f525;「炎码工坊」技术弹药已装填&#xff01; 点击关注 → 解锁工业级干货【工具实测|项目避坑|源码燃烧指南】 引言 在微服务架构中&#xff0c;API网关承担着流量调度、安全防护和协议转换的核心职责。作为云原生时代的代表性网关&#xff0c;Kong凭借其插件化架构…...

算法—栈系列

一&#xff1a;删除字符串中的所有相邻重复项 class Solution { public:string removeDuplicates(string s) {stack<char> st;for(int i 0; i < s.size(); i){char target s[i];if(!st.empty() && target st.top())st.pop();elsest.push(s[i]);}string ret…...

【java面试】微服务篇

【java面试】微服务篇 一、总体框架二、Springcloud&#xff08;一&#xff09;Springcloud五大组件&#xff08;二&#xff09;服务注册和发现1、Eureka2、Nacos &#xff08;三&#xff09;负载均衡1、Ribbon负载均衡流程2、Ribbon负载均衡策略3、自定义负载均衡策略4、总结 …...