From a242f65e22f8e13bf69654323c315e6aeda02354 Mon Sep 17 00:00:00 2001 From: zxwk Date: Wed, 26 Jun 2024 12:21:16 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- .stylelintrc.js | 2 +- babel.config.js | 2 +- mock/utils/index.js | 4 +- package.json | 2 +- src/config/permission.js | 2 +- src/layouts/export.js | 2 +- src/layouts/index.vue | 408 +++++++++++++++++----------------- src/main.js | 2 +- src/router/index.js | 2 +- src/store/index.js | 2 +- src/store/modules/errorLog.js | 2 +- src/store/modules/routes.js | 2 +- src/store/modules/settings.js | 2 +- src/store/modules/table.js | 2 +- src/store/modules/tabsBar.js | 2 +- src/store/modules/user.js | 2 +- src/styles/loading.scss | 2 +- src/styles/transition.scss | 2 +- src/styles/vab.scss | 2 +- src/styles/variables.scss | 2 +- src/utils/accessToken.js | 6 +- src/utils/clipboard.js | 2 +- src/utils/encrypt.js | 4 +- src/utils/handleRoutes.js | 6 +- src/utils/index.js | 22 +- src/utils/pageTitle.js | 2 +- src/utils/permission.js | 2 +- src/utils/request.js | 2 +- src/utils/validate.js | 2 +- vue.config.js | 2 +- 31 files changed, 250 insertions(+), 250 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 61d1e3a..e371f9b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description .eslintrc.js */ diff --git a/.stylelintrc.js b/.stylelintrc.js index a4f5c2c..834a5a2 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description stylelint */ module.exports = { diff --git a/babel.config.js b/babel.config.js index d0205a4..33ba09a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description babel.config */ module.exports = { diff --git a/mock/utils/index.js b/mock/utils/index.js index d4c6255..8014ca3 100644 --- a/mock/utils/index.js +++ b/mock/utils/index.js @@ -3,7 +3,7 @@ const { join } = require('path') const fs = require('fs') /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 随机生成图片url。 * @param width * @param height @@ -14,7 +14,7 @@ function handleRandomImage(width = 50, height = 50) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 处理所有 controller 模块,npm run serve时在node环境中自动输出controller文件夹下Mock接口,请勿修改。 * @returns {[]} */ diff --git a/package.json b/package.json index 2a4aa5d..bb503a5 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "serve:mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "build:mac": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "lint": "vue-cli-service lint --fix", - "lint:eslint": "eslint {src,mock,library}/**/*.{vue,js,ts} --fix", + "lint:eslint": "eslint {src,mock,library}/**/*.{vue,js} --fix", "lint:prettier": "prettier {src,mock,library}/**/*.{html,vue,css,sass,scss,js,ts,md} --write", "clear": "rimraf node_modules&&npm install --registry=--registry=https://registry.npmmirror.com", "update": "ncu -u --reject webpack,eslint-plugin-prettier,@vue/eslint-config-prettier,prettier,layouts,sass-loader,sass,screenfull,eslint,chalk,vue,vue-template-compiler,vue-router,vuex,@vue/cli-plugin-babel,@vue/cli-plugin-eslint,@vue/cli-service,eslint-plugin-vue --registry=https://registry.npmmirror.com&&pnpm i", diff --git a/src/config/permission.js b/src/config/permission.js index 095adf2..387588e 100644 --- a/src/config/permission.js +++ b/src/config/permission.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 路由守卫,目前两种模式:all模式与intelligence模式 */ import router from '@/router' diff --git a/src/layouts/export.js b/src/layouts/export.js index b67c6ea..2c24e49 100644 --- a/src/layouts/export.js +++ b/src/layouts/export.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 公共布局及样式自动引入 */ diff --git a/src/layouts/index.vue b/src/layouts/index.vue index 97e1a68..792eba9 100644 --- a/src/layouts/index.vue +++ b/src/layouts/index.vue @@ -45,259 +45,259 @@ diff --git a/src/main.js b/src/main.js index f2f98a3..1f12473 100644 --- a/src/main.js +++ b/src/main.js @@ -5,7 +5,7 @@ import router from './router' import './plugins' import '@/layouts/export' /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 生产环境默认都使用mock,如果正式用于生产环境时,记得去掉 */ diff --git a/src/router/index.js b/src/router/index.js index bfe6743..9cb513d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description router全局配置,如有必要可分文件抽离,其中asyncRoutes只有在intelligence模式下才会用到,vip文档中已提供路由的基础图标与小清新图标的配置方案,请仔细阅读 */ diff --git a/src/store/index.js b/src/store/index.js index 865afd3..efc3487 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 导入所有 vuex 模块,自动加入namespaced:true,用于解决vuex命名冲突,请勿修改。 */ diff --git a/src/store/modules/errorLog.js b/src/store/modules/errorLog.js index 0b47da2..08c7c03 100644 --- a/src/store/modules/errorLog.js +++ b/src/store/modules/errorLog.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 异常捕获的状态拦截,请勿修改 */ diff --git a/src/store/modules/routes.js b/src/store/modules/routes.js index 28c54d5..cd10451 100644 --- a/src/store/modules/routes.js +++ b/src/store/modules/routes.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 路由拦截状态管理,目前两种模式:all模式与intelligence模式,其中partialRoutes是菜单暂未使用 */ import { asyncRoutes, constantRoutes } from '@/router' diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index a6ff855..02d0aed 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 所有全局配置的状态管理,如无必要请勿修改 */ diff --git a/src/store/modules/table.js b/src/store/modules/table.js index 08a3ffe..616eda5 100644 --- a/src/store/modules/table.js +++ b/src/store/modules/table.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 代码生成机状态管理 */ diff --git a/src/store/modules/tabsBar.js b/src/store/modules/tabsBar.js index 874093e..a1097e1 100644 --- a/src/store/modules/tabsBar.js +++ b/src/store/modules/tabsBar.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description tabsBar多标签页逻辑,前期借鉴了很多开源项目发现都有个共同的特点很繁琐并不符合框架设计的初衷,后来在github用户hipi的启发下完成了重构,请勿修改 */ diff --git a/src/store/modules/user.js b/src/store/modules/user.js index cef23a5..b0e97b5 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 登录、获取用户信息、退出登录、清除accessToken逻辑,不建议修改 */ diff --git a/src/styles/loading.scss b/src/styles/loading.scss index a0acbc3..4aceb61 100644 --- a/src/styles/loading.scss +++ b/src/styles/loading.scss @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 全局加载动画 */ diff --git a/src/styles/transition.scss b/src/styles/transition.scss index a2d3390..ea742ce 100644 --- a/src/styles/transition.scss +++ b/src/styles/transition.scss @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description vue过渡动画 */ diff --git a/src/styles/vab.scss b/src/styles/vab.scss index 682128d..bb58263 100644 --- a/src/styles/vab.scss +++ b/src/styles/vab.scss @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 全局样式 */ diff --git a/src/styles/variables.scss b/src/styles/variables.scss index 4a4dad1..618d237 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 全局主题变量配置 */ /* stylelint-disable */ diff --git a/src/utils/accessToken.js b/src/utils/accessToken.js index ca9ca8f..548ebb6 100644 --- a/src/utils/accessToken.js +++ b/src/utils/accessToken.js @@ -1,7 +1,7 @@ import { storage, tokenTableName } from '@/config' /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 获取accessToken * @returns {string|ActiveX.IXMLDOMNode|Promise|any|IDBRequest|MediaKeyStatus|FormDataEntryValue|Function|Promise} */ @@ -20,7 +20,7 @@ export function getAccessToken() { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 存储accessToken * @param accessToken * @returns {void|*} @@ -40,7 +40,7 @@ export function setAccessToken(accessToken) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 移除accessToken * @returns {void|Promise} */ diff --git a/src/utils/clipboard.js b/src/utils/clipboard.js index e9ba22f..4c86324 100644 --- a/src/utils/clipboard.js +++ b/src/utils/clipboard.js @@ -10,7 +10,7 @@ function clipboardError() { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 复制数据 * @param text * @param event diff --git a/src/utils/encrypt.js b/src/utils/encrypt.js index 66b4405..7e61b1e 100644 --- a/src/utils/encrypt.js +++ b/src/utils/encrypt.js @@ -5,7 +5,7 @@ const privateKey = 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMFPa+v52FkSUXvcUnrGI/XzW3EpZRI0s9BCWJ3oNQmEYA5luWW5p8h0uadTIoTyYweFPdH4hveyxlwmS7oefvbIdiP+o+QIYW/R4Wjsb4Yl8MhR4PJqUE3RCy6IT9fM8ckG4kN9ECs6Ja8fQFc6/mSl5dJczzJO3k1rWMBhKJD/AgMBAAECgYEAucMakH9dWeryhrYoRHcXo4giPVJsH9ypVt4KzmOQY/7jV7KFQK3x//27UoHfUCak51sxFw9ek7UmTPM4HjikA9LkYeE7S381b4QRvFuf3L6IbMP3ywJnJ8pPr2l5SqQ00W+oKv+w/VmEsyUHr+k4Z+4ik+FheTkVWp566WbqFsECQQDjYaMcaKw3j2Zecl8T6eUe7fdaRMIzp/gcpPMfT/9rDzIQk+7ORvm1NI9AUmFv/FAlfpuAMrdL2n7p9uznWb7RAkEA2aP934kbXg5bdV0R313MrL+7WTK/qdcYxATUbMsMuWWQBoS5irrt80WCZbG48hpocJavLNjbtrjmUX3CuJBmzwJAOJg8uP10n/+ZQzjEYXh+BszEHDuw+pp8LuT/fnOy5zrJA0dO0RjpXijO3vuiNPVgHXT9z1LQPJkNrb5ACPVVgQJBALPeb4uV0bNrJDUb5RB4ghZnIxv18CcaqNIft7vuGCcFBAIPIRTBprR+RuVq+xHDt3sNXdsvom4h49+Hky1b0ksCQBBwUtVaqH6ztCtwUF1j2c/Zcrt5P/uN7IHAd44K0gIJc1+Csr3qPG+G2yoqRM8KVqLI8Z2ZYn9c+AvEE+L9OQY=' /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description RSA加密 * @param data * @returns {Promise<{param: PromiseLike}|*>} @@ -29,7 +29,7 @@ export async function encryptedData(data) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description RSA解密 * @param data * @returns {PromiseLike} diff --git a/src/utils/handleRoutes.js b/src/utils/handleRoutes.js index 78082ee..e6c9e31 100644 --- a/src/utils/handleRoutes.js +++ b/src/utils/handleRoutes.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description all模式渲染后端返回路由 * @param constantRoutes * @returns {*} @@ -24,7 +24,7 @@ export function convertRouter(asyncRoutes) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 判断当前路由是否包含权限 * @param permissions * @param route @@ -39,7 +39,7 @@ function hasPermission(permissions, route) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description intelligence模式根据permissions数组拦截路由 * @param routes * @param permissions diff --git a/src/utils/index.js b/src/utils/index.js index 3d5b557..3d826f7 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 格式化时间 * @param time * @param cFormat @@ -45,7 +45,7 @@ export function parseTime(time, cFormat) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 格式化时间 * @param time * @param option @@ -80,7 +80,7 @@ export function formatTime(time, option) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 将url请求参数转为json格式 * @param url * @returns {{}|any} @@ -94,7 +94,7 @@ export function paramObj(url) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 父子关系的数组转换成树形结构数据 * @param data * @returns {*} @@ -119,7 +119,7 @@ export function translateDataToTree(data) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 树形结构数据转换成父子关系的数组 * @param data * @returns {[]} @@ -146,7 +146,7 @@ export function translateTreeToData(data) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 10位时间戳转换 * @param time * @returns {string} @@ -168,7 +168,7 @@ export function tenBitTimestamp(time) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 13位时间戳转换 * @param time * @returns {string} @@ -190,7 +190,7 @@ export function thirteenBitTimestamp(time) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 获取随机id * @param length * @returns {string} @@ -205,7 +205,7 @@ export function uuid(length = 32) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description m到n的随机数 * @param m * @param n @@ -216,7 +216,7 @@ export function random(m, n) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description addEventListener * @type {function(...[*]=)} */ @@ -229,7 +229,7 @@ export const on = (function () { })() /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description removeEventListener * @type {function(...[*]=)} */ diff --git a/src/utils/pageTitle.js b/src/utils/pageTitle.js index 62297f6..3fb78c1 100644 --- a/src/utils/pageTitle.js +++ b/src/utils/pageTitle.js @@ -1,7 +1,7 @@ import { title } from '@/config' /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 设置标题 * @param pageTitle * @returns {string} diff --git a/src/utils/permission.js b/src/utils/permission.js index 44ebc04..04fae07 100644 --- a/src/utils/permission.js +++ b/src/utils/permission.js @@ -1,7 +1,7 @@ import store from '@/store' /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 检查权限 * @param value * @returns {boolean} diff --git a/src/utils/request.js b/src/utils/request.js index 50d6295..2ee0204 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -19,7 +19,7 @@ import { isArray } from '@/utils/validate' let loadingInstance /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 处理code异常 * @param {*} code * @param {*} msg diff --git a/src/utils/validate.js b/src/utils/validate.js index fe79949..30be911 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -9,7 +9,7 @@ export function isExternal(path) { } /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description 校验密码是否小于6位 * @param str * @returns {boolean} diff --git a/vue.config.js b/vue.config.js index a0576a8..c95717e 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,5 @@ /** - * @author https://vue-admin-beautiful.com (不想保留author可删除) + * @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除) * @description cli配置 */