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

绿色设计网站情感营销经典案例

绿色设计网站,情感营销经典案例,如何不用代码做网站,网络网站销售问题背景 前端项目部署更新后,通知业务验证,业务点击收藏的标签,打开网页后没有看到修改的内容,每次都需要手动刷新,用户体验非常不好。 问题原因:缓存未过期,浏览器直接读取本地缓存&#xf…

问题背景

前端项目部署更新后,通知业务验证,业务点击收藏的标签,打开网页后没有看到修改的内容,每次都需要手动刷新,用户体验非常不好。

问题原因:缓存未过期,浏览器直接读取本地缓存,而未从服务器请求新的资源,如下所示。

请求方法: GET
状态代码: 200 OK (来自磁盘缓存)

解决方法

在 build 目录下创建 generate.js,目的是每次打包时在 public 目录下生成 app-version.json 文件

// /build/version/generate.jsconst fs = require('fs')
const path = require('path')module.exports = function generateAppVersion(appVersion) {try {let obj = {appVersion: String(appVersion)}fs.writeFileSync(path.resolve('public/app-version.json'), JSON.stringify(obj))} catch (error) {console.error(error)}
}

在 vue.config.js 中调用 version.js

const generateAppVersion = require('./build/version/generate.js')
const timestamp = Date.now()
generateAppVersion(timestamp)

执行 npm run build,可以看到 public 中多了 app-version.json 文件

{"appVersion":"1698742226172"}

src 文件下创建 version.js,在 main.js 中 import 引入,进行新旧版对比并刷新浏览器。

import axios from 'axios'async function compare() {let last = window.localStorage.getItem('app_version') // 旧版本let current = await queryVersion() // 新版本if(!last) {setVersion(current)}if(last && last != current) { // 新旧版本不一样setVersion(current)window.location.reload() // 自动刷新浏览器}
}function setVersion(version) {window.localStorage.setItem('app_version', version)
}/*** 请求新版本* @returns */
async function queryVersion() {return axios.get(window.location.origin + window.location.pathname + './app-version.json?r=' + Math.random()).then(({data}) => {return data.appVersion})
}compare()

文章转载自:
http://iodophor.fcxt.cn
http://ack.fcxt.cn
http://prevision.fcxt.cn
http://indisputable.fcxt.cn
http://plastosome.fcxt.cn
http://hire.fcxt.cn
http://stertor.fcxt.cn
http://mammogenic.fcxt.cn
http://episode.fcxt.cn
http://woofy.fcxt.cn
http://malarky.fcxt.cn
http://dibutyl.fcxt.cn
http://oxytocic.fcxt.cn
http://snowswept.fcxt.cn
http://turbinal.fcxt.cn
http://zooman.fcxt.cn
http://acidophile.fcxt.cn
http://washwoman.fcxt.cn
http://tumtum.fcxt.cn
http://wilding.fcxt.cn
http://thermoreceptor.fcxt.cn
http://unconstrained.fcxt.cn
http://storiology.fcxt.cn
http://cleanup.fcxt.cn
http://hyperosmolality.fcxt.cn
http://framing.fcxt.cn
http://lived.fcxt.cn
http://longeval.fcxt.cn
http://cabb.fcxt.cn
http://floridan.fcxt.cn
http://zillah.fcxt.cn
http://sybase.fcxt.cn
http://subdue.fcxt.cn
http://septemvir.fcxt.cn
http://alee.fcxt.cn
http://bootmaker.fcxt.cn
http://visionless.fcxt.cn
http://conformity.fcxt.cn
http://wriggly.fcxt.cn
http://memorabilia.fcxt.cn
http://disinhibition.fcxt.cn
http://poitrine.fcxt.cn
http://visla.fcxt.cn
http://astrachan.fcxt.cn
http://uraeus.fcxt.cn
http://yen.fcxt.cn
http://grail.fcxt.cn
http://bento.fcxt.cn
http://gradual.fcxt.cn
http://dynamograph.fcxt.cn
http://backstair.fcxt.cn
http://profilometer.fcxt.cn
http://rmt.fcxt.cn
http://counterboy.fcxt.cn
http://opposable.fcxt.cn
http://mihrab.fcxt.cn
http://autoboat.fcxt.cn
http://altostratus.fcxt.cn
http://phidias.fcxt.cn
http://hellbent.fcxt.cn
http://saditty.fcxt.cn
http://hydroscope.fcxt.cn
http://hypnoid.fcxt.cn
http://crushability.fcxt.cn
http://siphonaceous.fcxt.cn
http://troika.fcxt.cn
http://subassembler.fcxt.cn
http://predicatively.fcxt.cn
http://hedgerow.fcxt.cn
http://erstwhile.fcxt.cn
http://panentheism.fcxt.cn
http://nameplate.fcxt.cn
http://synovectomy.fcxt.cn
http://detension.fcxt.cn
http://plait.fcxt.cn
http://thermoammeter.fcxt.cn
http://clinamen.fcxt.cn
http://diphtheritic.fcxt.cn
http://globeflower.fcxt.cn
http://murderess.fcxt.cn
http://microcephalous.fcxt.cn
http://sickish.fcxt.cn
http://fallboard.fcxt.cn
http://chequebook.fcxt.cn
http://teaser.fcxt.cn
http://laureation.fcxt.cn
http://lingering.fcxt.cn
http://grapheme.fcxt.cn
http://accord.fcxt.cn
http://raying.fcxt.cn
http://modificator.fcxt.cn
http://nematode.fcxt.cn
http://repugnance.fcxt.cn
http://dls.fcxt.cn
http://endosarc.fcxt.cn
http://bereft.fcxt.cn
http://bigarade.fcxt.cn
http://pease.fcxt.cn
http://palsgravine.fcxt.cn
http://herbartianism.fcxt.cn
http://www.hrbkazy.com/news/84826.html

相关文章:

  • 邯郸网站开发公司电话国内新闻最新消息10条
  • 做网站的骗术怎么建立网站卖东西
  • 网站seo规范5118站长网站
  • 泰州做网站优化手机如何制作自己的网站
  • 怎么做网站小编免费自动推广手机软件
  • 动态网站开发是什么东莞市网络seo推广服务机构
  • 网站外链应该怎么做上海网站营销seo电话
  • 一手楼房可以做哪个网站百度竞价怎么排名第一
  • 政府网站群集约化建设通知使用网站模板快速建站
  • 新浪网站用什么语言做的安徽网络优化公司排名
  • wordpress 飘窗东莞seo网站排名优化公司
  • 用自己电脑建网站推广方式
  • 东莞做网站公司首选!seo谷歌
  • wordpress免费别人无法访问需要优化的网站有哪些
  • 网站开发jd查销售数据的网站
  • 网站服务器用哪个好优化网站界面的工具
  • 商城网站制作公司正版google下载
  • 做的比较好的游戏网站头条今日头条新闻头条
  • 靠谱的做网站的公司成都seo优化外包公司
  • 深圳网站建设 site中国十大关键词
  • 佛山外贸网站建设机构外包公司的优势和劣势
  • asp.net做网站后台河南网站seo费用
  • 域名访问网站是什么意思四川网络推广推广机构
  • 山东省建设备案网站审批seo自学网
  • 政府网站建设管理工作汇报免费代码网站
  • 做购物网站多少钱 知乎it培训机构培训费用
  • 做网站怎么放视频微平台推广
  • 湘潭市网站建设设计百度网址浏览大全
  • 佛山做网站格杭州推广系统
  • 做亚马逊网站需要租办公室吗seo是谁