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

文化建设意义湛江网站seo

文化建设意义,湛江网站seo,网站开发架构有哪些,仙桃网站设计【精选】vue.config.js 的完整配置(超详细)_vue.config.js配置_web学生网页设计的博客-CSDN博客 本项目需要修改两处: 1、vue开发服务器地址:config\index.js use strict // Template version: 1.3.1 // see http://vuejs-templa…

【精选】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博客

http://www.yayakq.cn/news/469385/

相关文章:

  • 深圳建模板网站桂林市是几线城市
  • 网站建设首选玖艺建站信得过wordpress 全站404
  • 天津哪里有做网站的做服装搭配图的网站
  • 购物网站排名前十名手机上可以做网站吗
  • 做网站的思想体会销售app软件大概需要多少钱
  • 沧州网站群网站seo诊断报告例子
  • 建站公司 转型经验兰州市做网站的
  • 网站建设企业战略到哪里建网站
  • 建设企业网站公司价格买房网站排名
  • 唐尧文化 网站建设工作总结贵阳论坛网站建设
  • 如何使用天翼云主机建设网站全flash网站制作教程
  • 网站哪里买外链做网站要在阿里云上买几个贡献
  • 恒基建设集团网站外贸公司如何寻找客户
  • 设计公司网站欣赏无锡中小企业网站制作
  • 网站如何做反链网站图片轮播怎么做
  • 济南做网站比较好的thinkphp 网站下载
  • 北京建设网网站哈尔滨建设职工大学
  • jsp网站开发实例视频教程上海知名建站公司
  • 做外贸怎么能上国外网站南京华夏商务网做网站怎么样
  • 网站首页设计教程双语网站建设哪家便宜
  • thinkphp企业网站模板下载胶州城乡建设局网站
  • 深圳网站建设深正互联asp做网站简介页面
  • 天猫与京东的网站建设管理离退休工作网站建设方案
  • 电商网站是什么wordpress和新浪微博同步
  • 天猫与京东的网站建设管理wordpress多个主题
  • 蘑菇街的网站建设衣柜 技术支持 东莞网站建设
  • 如何建一个手机网站找产品代理去哪个网站
  • 河南建设厅网站首页兰州城市建设学校网上报名网站
  • 蒲城网站建设seo建站要求
  • 两个女孩子怎么做网站小程序源码教程