mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-05 05:42:45 +08:00
♻️ refactor: code
This commit is contained in:
parent
e793320d73
commit
a242f65e22
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description .eslintrc.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 = {
|
||||
|
@ -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 = {
|
||||
|
@ -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 {[]}
|
||||
*/
|
||||
|
@ -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",
|
||||
|
@ -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'
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 公共布局及样式自动引入
|
||||
*/
|
||||
|
||||
|
@ -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,如果正式用于生产环境时,记得去掉
|
||||
*/
|
||||
|
||||
|
@ -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文档中已提供路由的基础图标与小清新图标的配置方案,请仔细阅读
|
||||
*/
|
||||
|
||||
|
@ -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命名冲突,请勿修改。
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 异常捕获的状态拦截,请勿修改
|
||||
*/
|
||||
|
||||
|
@ -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'
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 所有全局配置的状态管理,如无必要请勿修改
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 代码生成机状态管理
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description tabsBar多标签页逻辑,前期借鉴了很多开源项目发现都有个共同的特点很繁琐并不符合框架设计的初衷,后来在github用户hipi的启发下完成了重构,请勿修改
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 登录、获取用户信息、退出登录、清除accessToken逻辑,不建议修改
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 全局加载动画
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description vue过渡动画
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 全局样式
|
||||
*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description 全局主题变量配置
|
||||
*/
|
||||
/* stylelint-disable */
|
||||
|
@ -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>|any|IDBRequest<any>|MediaKeyStatus|FormDataEntryValue|Function|Promise<Credential | null>}
|
||||
*/
|
||||
@ -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<void>}
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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<ArrayBuffer>}|*>}
|
||||
@ -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<ArrayBuffer>}
|
||||
|
@ -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
|
||||
|
@ -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(...[*]=)}
|
||||
*/
|
||||
|
@ -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}
|
||||
|
@ -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}
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @author https://vue-admin-beautiful.com (不想保留author可删除)
|
||||
* @author https://github.com/zxwk1998/vue-admin-better (不想保留author可删除)
|
||||
* @description cli配置
|
||||
*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user