移除compression-webpack-plugin、js-cookie

This commit is contained in:
chuzhixin 2020-10-04 22:14:50 +08:00
parent c056ab6ae2
commit 80f4d8892f
4 changed files with 2 additions and 27 deletions

View File

@ -45,7 +45,6 @@
"echarts": "^4.9.0",
"echarts-wordcloud": "^1.1.3",
"element-ui": "^2.13.2",
"js-cookie": "^2.2.1",
"jsencrypt": "^3.0.0-rc.1",
"lodash": "^4.17.20",
"maptalks": "^0.49.1",
@ -78,7 +77,6 @@
"body-parser": "^1.19.0",
"chalk": "^4.1.0",
"chokidar": "^3.4.2",
"compression-webpack-plugin": "^6.0.2",
"eslint": "^7.10.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^7.0.0",
@ -87,7 +85,6 @@
"lint-staged": "^10.4.0",
"plop": "^2.7.4",
"prettier": "^2.1.2",
"raw-loader": "^4.0.1",
"sass": "^1.26.11",
"sass-loader": "^10.0.2",
"stylelint": "^13.7.2",

View File

@ -42,9 +42,9 @@ module.exports = {
loadingText: "正在加载中...",
//token名称
tokenName: "accessToken",
//token在localStorage、sessionStorage、cookie存储的key的名称
//token在localStorage、sessionStorage存储的key的名称
tokenTableName: "vue-admin-beautiful",
//token存储位置localStorage sessionStorage cookie
//token存储位置localStorage sessionStorage
storage: "localStorage",
//token失效回退到登录页时是否记录本次的路由
recordRoute: true,

View File

@ -1,5 +1,4 @@
import { storage, tokenTableName } from "@/config/settings";
import cookie from "js-cookie";
/**
* @author chuzhixin 1204505056@qq.com 不想保留author可删除
@ -12,8 +11,6 @@ export function getAccessToken() {
return localStorage.getItem(tokenTableName);
} else if ("sessionStorage" === storage) {
return sessionStorage.getItem(tokenTableName);
} else if ("cookie" === storage) {
return cookie.get(tokenTableName);
} else {
return localStorage.getItem(tokenTableName);
}
@ -34,8 +31,6 @@ export function setAccessToken(accessToken) {
return localStorage.setItem(tokenTableName, accessToken);
} else if ("sessionStorage" === storage) {
return sessionStorage.setItem(tokenTableName, accessToken);
} else if ("cookie" === storage) {
return cookie.set(tokenTableName, accessToken);
} else {
return localStorage.setItem(tokenTableName, accessToken);
}
@ -55,8 +50,6 @@ export function removeAccessToken() {
return localStorage.removeItem(tokenTableName);
} else if ("sessionStorage" === storage) {
return sessionStorage.clear();
} else if ("cookie" === storage) {
return cookie.remove(tokenTableName);
} else {
return localStorage.removeItem(tokenTableName);
}

View File

@ -26,7 +26,6 @@ const FileManagerPlugin = require("filemanager-webpack-plugin");
const dayjs = require("dayjs");
const date = dayjs().format("YYYY_M_D");
const time = dayjs().format("YYYY-M-D HH:mm:ss");
const CompressionWebpackPlugin = require("compression-webpack-plugin");
const productionGzipExtensions = ["html", "js", "css", "svg"];
process.env.VUE_APP_TITLE = title || "vue-admin-beautiful";
process.env.VUE_APP_AUTHOR = author || "chuzhixin 1204505056@qq.com";
@ -132,20 +131,6 @@ module.exports = {
.plugin("banner")
.use(Webpack.BannerPlugin, [`${webpackBanner}${time}`])
.end();
config
.plugin("compression")
.use(CompressionWebpackPlugin, [
{
filename: "[path].gz[query]",
algorithm: "gzip",
test: new RegExp(
"\\.(" + productionGzipExtensions.join("|") + ")$"
),
threshold: 8192,
minRatio: 0.8,
},
])
.end();
config.module
.rule("images")
.use("image-webpack-loader")