出入库管理系统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。…...
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软件设置文件类型介绍
作为远程技术指导人员,下面这个功能对你来说可能非常有帮助。 在PicoScope 7 软件的文件保存格式里,通常选择的是<PS 数据文件>类型,容易忽略其他实用的保存文件类型,下面我们介绍<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 {} \; # 示例命令,将/home/kaf…...

VISA机制
需要用到VISA的3种机制:属性机制、锁定机制和事件机制。以写资源为例,3种机制的作用如图 (1)属性机制 属性机制用来控制资源的各种属性,这些属性分为两种:只读属性和可读可写属性。 (2…...

基于开源项目OCR做一个探究(chineseocr_lite)
背景:基于图片识别的技术有很多,应用与各行各业,我们公司围绕电子身份证识别自动录入需求开展,以下是我的研究心得 技术栈:python3.6,chineseocr_lite的onnx推理 环境部署:直接上截图ÿ…...

工作常遇,Web自动化测试疑难解答,测试老鸟带你一篇打通...
目录:导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结(尾部小惊喜) 前言 1、自动化测试中隐…...
H5判断当前环境是否为微信小程序
H5判断当前环境是否为微信小程序 场景代码 场景 H5需要判断当前环境是否为微信小程序,然后做一些交互调整。 代码 isWxMiniCodeWebviewEnv() {return navigator.userAgent.match(/miniprogram/i) || window.__wxjs_environment miniprogram }...

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

计算图片中两个任意形状多边形相交部分的大小
一张图片中两个任意多边形相交的面积计算方法。本文参考https://blog.csdn.net/PanYHHH/article/details/110940428;加了一个简单的示例,也对代码做了一点清淅化。原博客中还有其他链接,是C代码,没有看原理,但以下代码…...
JavaScript的函数
在JavaScript中,函数是一种强大而灵活的工具,它们不仅可以执行特定的任务,还可以作为变量、参数和返回值进行传递。本文将介绍JavaScript函数的各个方面,包括函数的定义和调用、函数参数和返回值、匿名函数和箭头函数,…...
stm32 - Cortex
stm32 - Cortex 概念Cortex-M4 的工作模式和工作状态寄存器 概念 Cortex-M4 的工作模式和工作状态 处理模式 当处理器发生了异常或者中断,则进入处理模式进行处理,处理完成后返回到线程模式 权限大,访问处理器中所有的资源 线程模式 芯片复…...

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

思维导图软件 Xmind mac中文版软件特点
XMind mac是一款思维导图软件,可以帮助用户创建各种类型的思维导图和概念图。 XMind mac软件特点 - 多样化的导图类型:XMind提供了多种类型的导图,如鱼骨图、树形图、机构图等,可以满足不同用户的需求。 - 强大的功能和工具&#…...
群晖 DSM 7.0 Synology Photos IOS | Android 客户端下载
安卓版本低-官方说明:https://www.synology.com/zh-tw/dsm/7.1/software_spec/synology_photos Synology Photos Android 客户端下载大全: 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…...

【HarmonyOS 5.0】DevEco Testing:鸿蒙应用质量保障的终极武器
——全方位测试解决方案与代码实战 一、工具定位与核心能力 DevEco Testing是HarmonyOS官方推出的一体化测试平台,覆盖应用全生命周期测试需求,主要提供五大核心能力: 测试类型检测目标关键指标功能体验基…...

相机从app启动流程
一、流程框架图 二、具体流程分析 1、得到cameralist和对应的静态信息 目录如下: 重点代码分析: 启动相机前,先要通过getCameraIdList获取camera的个数以及id,然后可以通过getCameraCharacteristics获取对应id camera的capabilities(静态信息)进行一些openCamera前的…...
解决本地部署 SmolVLM2 大语言模型运行 flash-attn 报错
出现的问题 安装 flash-attn 会一直卡在 build 那一步或者运行报错 解决办法 是因为你安装的 flash-attn 版本没有对应上,所以报错,到 https://github.com/Dao-AILab/flash-attention/releases 下载对应版本,cu、torch、cp 的版本一定要对…...
实现弹窗随键盘上移居中
实现弹窗随键盘上移的核心思路 在Android中,可以通过监听键盘的显示和隐藏事件,动态调整弹窗的位置。关键点在于获取键盘高度,并计算剩余屏幕空间以重新定位弹窗。 // 在Activity或Fragment中设置键盘监听 val rootView findViewById<V…...
Device Mapper 机制
Device Mapper 机制详解 Device Mapper(简称 DM)是 Linux 内核中的一套通用块设备映射框架,为 LVM、加密磁盘、RAID 等提供底层支持。本文将详细介绍 Device Mapper 的原理、实现、内核配置、常用工具、操作测试流程,并配以详细的…...
Fabric V2.5 通用溯源系统——增加图片上传与下载功能
fabric-trace项目在发布一年后,部署量已突破1000次,为支持更多场景,现新增支持图片信息上链,本文对图片上传、下载功能代码进行梳理,包含智能合约、后端、前端部分。 一、智能合约修改 为了增加图片信息上链溯源,需要对底层数据结构进行修改,在此对智能合约中的农产品数…...
比较数据迁移后MySQL数据库和OceanBase数据仓库中的表
设计一个MySQL数据库和OceanBase数据仓库的表数据比较的详细程序流程,两张表是相同的结构,都有整型主键id字段,需要每次从数据库分批取得2000条数据,用于比较,比较操作的同时可以再取2000条数据,等上一次比较完成之后,开始比较,直到比较完所有的数据。比较操作需要比较…...

【从零开始学习JVM | 第四篇】类加载器和双亲委派机制(高频面试题)
前言: 双亲委派机制对于面试这块来说非常重要,在实际开发中也是经常遇见需要打破双亲委派的需求,今天我们一起来探索一下什么是双亲委派机制,在此之前我们先介绍一下类的加载器。 目录 编辑 前言: 类加载器 1. …...
tomcat指定使用的jdk版本
说明 有时候需要对tomcat配置指定的jdk版本号,此时,我们可以通过以下方式进行配置 设置方式 找到tomcat的bin目录中的setclasspath.bat。如果是linux系统则是setclasspath.sh set JAVA_HOMEC:\Program Files\Java\jdk8 set JRE_HOMEC:\Program Files…...

Matlab实现任意伪彩色图像可视化显示
Matlab实现任意伪彩色图像可视化显示 1、灰度原始图像2、RGB彩色原始图像 在科研研究中,如何展示好看的实验结果图像非常重要!!! 1、灰度原始图像 灰度图像每个像素点只有一个数值,代表该点的亮度(或…...