mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-06 03:58:00 +08:00
移除compression-webpack-plugin、js-cookie
This commit is contained in:
parent
c056ab6ae2
commit
80f4d8892f
@ -45,7 +45,6 @@
|
|||||||
"echarts": "^4.9.0",
|
"echarts": "^4.9.0",
|
||||||
"echarts-wordcloud": "^1.1.3",
|
"echarts-wordcloud": "^1.1.3",
|
||||||
"element-ui": "^2.13.2",
|
"element-ui": "^2.13.2",
|
||||||
"js-cookie": "^2.2.1",
|
|
||||||
"jsencrypt": "^3.0.0-rc.1",
|
"jsencrypt": "^3.0.0-rc.1",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"maptalks": "^0.49.1",
|
"maptalks": "^0.49.1",
|
||||||
@ -78,7 +77,6 @@
|
|||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"chalk": "^4.1.0",
|
"chalk": "^4.1.0",
|
||||||
"chokidar": "^3.4.2",
|
"chokidar": "^3.4.2",
|
||||||
"compression-webpack-plugin": "^6.0.2",
|
|
||||||
"eslint": "^7.10.0",
|
"eslint": "^7.10.0",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"eslint-plugin-vue": "^7.0.0",
|
"eslint-plugin-vue": "^7.0.0",
|
||||||
@ -87,7 +85,6 @@
|
|||||||
"lint-staged": "^10.4.0",
|
"lint-staged": "^10.4.0",
|
||||||
"plop": "^2.7.4",
|
"plop": "^2.7.4",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.1.2",
|
||||||
"raw-loader": "^4.0.1",
|
|
||||||
"sass": "^1.26.11",
|
"sass": "^1.26.11",
|
||||||
"sass-loader": "^10.0.2",
|
"sass-loader": "^10.0.2",
|
||||||
"stylelint": "^13.7.2",
|
"stylelint": "^13.7.2",
|
||||||
|
@ -42,9 +42,9 @@ module.exports = {
|
|||||||
loadingText: "正在加载中...",
|
loadingText: "正在加载中...",
|
||||||
//token名称
|
//token名称
|
||||||
tokenName: "accessToken",
|
tokenName: "accessToken",
|
||||||
//token在localStorage、sessionStorage、cookie存储的key的名称
|
//token在localStorage、sessionStorage存储的key的名称
|
||||||
tokenTableName: "vue-admin-beautiful",
|
tokenTableName: "vue-admin-beautiful",
|
||||||
//token存储位置localStorage sessionStorage cookie
|
//token存储位置localStorage sessionStorage
|
||||||
storage: "localStorage",
|
storage: "localStorage",
|
||||||
//token失效回退到登录页时是否记录本次的路由
|
//token失效回退到登录页时是否记录本次的路由
|
||||||
recordRoute: true,
|
recordRoute: true,
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { storage, tokenTableName } from "@/config/settings";
|
import { storage, tokenTableName } from "@/config/settings";
|
||||||
import cookie from "js-cookie";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author chuzhixin 1204505056@qq.com (不想保留author可删除)
|
* @author chuzhixin 1204505056@qq.com (不想保留author可删除)
|
||||||
@ -12,8 +11,6 @@ export function getAccessToken() {
|
|||||||
return localStorage.getItem(tokenTableName);
|
return localStorage.getItem(tokenTableName);
|
||||||
} else if ("sessionStorage" === storage) {
|
} else if ("sessionStorage" === storage) {
|
||||||
return sessionStorage.getItem(tokenTableName);
|
return sessionStorage.getItem(tokenTableName);
|
||||||
} else if ("cookie" === storage) {
|
|
||||||
return cookie.get(tokenTableName);
|
|
||||||
} else {
|
} else {
|
||||||
return localStorage.getItem(tokenTableName);
|
return localStorage.getItem(tokenTableName);
|
||||||
}
|
}
|
||||||
@ -34,8 +31,6 @@ export function setAccessToken(accessToken) {
|
|||||||
return localStorage.setItem(tokenTableName, accessToken);
|
return localStorage.setItem(tokenTableName, accessToken);
|
||||||
} else if ("sessionStorage" === storage) {
|
} else if ("sessionStorage" === storage) {
|
||||||
return sessionStorage.setItem(tokenTableName, accessToken);
|
return sessionStorage.setItem(tokenTableName, accessToken);
|
||||||
} else if ("cookie" === storage) {
|
|
||||||
return cookie.set(tokenTableName, accessToken);
|
|
||||||
} else {
|
} else {
|
||||||
return localStorage.setItem(tokenTableName, accessToken);
|
return localStorage.setItem(tokenTableName, accessToken);
|
||||||
}
|
}
|
||||||
@ -55,8 +50,6 @@ export function removeAccessToken() {
|
|||||||
return localStorage.removeItem(tokenTableName);
|
return localStorage.removeItem(tokenTableName);
|
||||||
} else if ("sessionStorage" === storage) {
|
} else if ("sessionStorage" === storage) {
|
||||||
return sessionStorage.clear();
|
return sessionStorage.clear();
|
||||||
} else if ("cookie" === storage) {
|
|
||||||
return cookie.remove(tokenTableName);
|
|
||||||
} else {
|
} else {
|
||||||
return localStorage.removeItem(tokenTableName);
|
return localStorage.removeItem(tokenTableName);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ const FileManagerPlugin = require("filemanager-webpack-plugin");
|
|||||||
const dayjs = require("dayjs");
|
const dayjs = require("dayjs");
|
||||||
const date = dayjs().format("YYYY_M_D");
|
const date = dayjs().format("YYYY_M_D");
|
||||||
const time = dayjs().format("YYYY-M-D HH:mm:ss");
|
const time = dayjs().format("YYYY-M-D HH:mm:ss");
|
||||||
const CompressionWebpackPlugin = require("compression-webpack-plugin");
|
|
||||||
const productionGzipExtensions = ["html", "js", "css", "svg"];
|
const productionGzipExtensions = ["html", "js", "css", "svg"];
|
||||||
process.env.VUE_APP_TITLE = title || "vue-admin-beautiful";
|
process.env.VUE_APP_TITLE = title || "vue-admin-beautiful";
|
||||||
process.env.VUE_APP_AUTHOR = author || "chuzhixin 1204505056@qq.com";
|
process.env.VUE_APP_AUTHOR = author || "chuzhixin 1204505056@qq.com";
|
||||||
@ -132,20 +131,6 @@ module.exports = {
|
|||||||
.plugin("banner")
|
.plugin("banner")
|
||||||
.use(Webpack.BannerPlugin, [`${webpackBanner}${time}`])
|
.use(Webpack.BannerPlugin, [`${webpackBanner}${time}`])
|
||||||
.end();
|
.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
|
config.module
|
||||||
.rule("images")
|
.rule("images")
|
||||||
.use("image-webpack-loader")
|
.use("image-webpack-loader")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user