Compare commits
2 Commits
8c9532125b
...
477eb6bbe8
| Author | SHA1 | Date |
|---|---|---|
|
|
477eb6bbe8 | |
|
|
3d0d0bb891 |
|
|
@ -0,0 +1,12 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
|
@ -5,4 +5,4 @@ VITE_APP_TITLE=里派基础框架
|
|||
VITE_APP_ENV='development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API='/dev-api'
|
||||
VITE_API_BASE='/dev-api'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ VITE_APP_TITLE=里派基础框架
|
|||
VITE_APP_ENV='production'
|
||||
|
||||
# 生产环境
|
||||
VITE_APP_BASE_API='/prod-api'
|
||||
VITE_API_BASE='/prod-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS=gzip
|
||||
|
|
@ -5,7 +5,7 @@ VITE_APP_TITLE=里派基础框架
|
|||
VITE_APP_ENV='staging'
|
||||
|
||||
# 生产环境
|
||||
VITE_APP_BASE_API='/staging-api'
|
||||
VITE_API_BASE='/staging-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS=gzip
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "admin",
|
||||
"version": "1.0.0",
|
||||
"description": "one basic framework",
|
||||
"description": "a basic framework",
|
||||
"author": "cfn",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"eslint": "^9.27.0",
|
||||
"sass": "^1.89.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.5"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 97 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
|
|
@ -5,8 +5,8 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { computed } from 'vue'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import {computed} from 'vue'
|
||||
|
||||
const config = {
|
||||
size: "default",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
const modules = import.meta.glob('./model/**/*.ts') // 异步加载
|
||||
|
||||
// 使用示例
|
||||
const loadModel = async (modelName: string) => {
|
||||
const path = `./model/${modelName}.ts`
|
||||
const module = await modules[path]()
|
||||
return module.default
|
||||
const files = import.meta.glob('./model/*.ts', {
|
||||
eager: true,
|
||||
import: 'default' // 可选,指定要导入的 export
|
||||
})
|
||||
const modules = {}
|
||||
for (const path in files) {
|
||||
modules[path.replace(/(\.\/model\/|\.ts)/g, '')] = files[path]
|
||||
}
|
||||
export default modules
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import http from "@/utils/request"
|
||||
|
||||
export default {
|
||||
login: async function (data = {}) {
|
||||
return await http.post("v1/login", data);
|
||||
},
|
||||
menu: async function (data = {}) {
|
||||
return await http.get("v1/menu", data)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,16 @@
|
|||
export default {
|
||||
//
|
||||
APP_NAME: import.meta.env.VITE_APP_TITLE,
|
||||
//接口地址
|
||||
API_URL: import.meta.env.VITE_API_BASE,
|
||||
//请求超时
|
||||
TIMEOUT: 10000,
|
||||
//请求是否开启缓存
|
||||
REQUEST_CACHE: false,
|
||||
//语言
|
||||
LANG: 'zh-cn',
|
||||
//TokenName
|
||||
TOKEN_NAME: "Authorization",
|
||||
//Token前缀,注意最后有个空格,如不需要需设置空字符串
|
||||
TOKEN_PREFIX: "Bearer ",
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<template>
|
||||
<div class="router-err">
|
||||
<div class="router-err__icon">
|
||||
<img src="./img/404.png"/>
|
||||
</div>
|
||||
<div class="router-err__content">
|
||||
<h2>无权限或找不到页面</h2>
|
||||
<p>当前页面无权限访问或者打开了一个不存在的链接,请检查当前账户权限和链接的可访问性。</p>
|
||||
<el-button type="primary" plain round @click="gohome">返回首页</el-button>
|
||||
<el-button type="primary" plain round @click="gologin">重新登录</el-button>
|
||||
<el-button type="primary" round @click="goback">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {useRouter} from 'vue-router';
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const gohome = () => {
|
||||
location.href = "#/"
|
||||
}
|
||||
|
||||
const goback = () => {
|
||||
router.go(-1);
|
||||
}
|
||||
const gologin = () => {
|
||||
router.push("/login");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.router-err {
|
||||
display: flex;
|
||||
width: 900px;
|
||||
margin: 50px auto;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.router-err__icon {
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.router-err__icon img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.router-err__content {
|
||||
flex: 1;
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.router-err__content h2 {
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.router-err__content p {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
margin: 15px 0 30px 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
.router-err {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.router-err__icon {
|
||||
width: 280px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
14
src/main.ts
14
src/main.ts
|
|
@ -3,19 +3,19 @@ import ElementPlus from 'element-plus'
|
|||
import 'element-plus/dist/index.css'
|
||||
import 'element-plus/theme-chalk/display.css'
|
||||
import i18n from './locales'
|
||||
|
||||
// import leapy from './leapy'
|
||||
// import router from './router'
|
||||
// import store from './store'
|
||||
import App from './App.vue'
|
||||
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import pi from './pi'
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
// app.use(store);
|
||||
// app.use(router);
|
||||
app.use(store);
|
||||
app.use(router);
|
||||
app.use(ElementPlus);
|
||||
app.use(i18n);
|
||||
// app.use(leapy);
|
||||
app.use(pi);
|
||||
|
||||
//挂载app
|
||||
app.mount('#app');
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import config from "./config"
|
||||
import api from './api'
|
||||
import tools from './utils/tools'
|
||||
import http from "./utils/request"
|
||||
|
||||
import * as elIcons from '@element-plus/icons-vue'
|
||||
import {App} from "vue";
|
||||
|
||||
export default {
|
||||
install(app: App) {
|
||||
//挂载全局对象
|
||||
app.config.globalProperties.$CONFIG = config;
|
||||
app.config.globalProperties.$TOOLS = tools;
|
||||
app.config.globalProperties.$HTTP = http;
|
||||
app.config.globalProperties.$API = api;
|
||||
|
||||
//统一注册el-icon图标
|
||||
for (let icon in elIcons) {
|
||||
app.component(`ElIcon${icon}`, elIcons[icon])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
import {createRouter, createWebHashHistory} from 'vue-router';
|
||||
import {ElNotification} from 'element-plus';
|
||||
import config from "@/config"
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import tools from '@/utils/tools';
|
||||
import api from "@/api";
|
||||
import sRouter from './system';
|
||||
import {beforeEach, afterEach} from '@/utils/route';
|
||||
|
||||
//系统路由
|
||||
const routes = sRouter
|
||||
|
||||
//系统特殊路由
|
||||
const routes_404 = {
|
||||
path: "/:pathMatch(.*)*",
|
||||
hidden: true,
|
||||
component: () => import('@/layout/404'),
|
||||
}
|
||||
|
||||
let routes_404_r = () => {
|
||||
}
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: routes
|
||||
})
|
||||
|
||||
//设置标题
|
||||
document.title = config.APP_NAME
|
||||
|
||||
//判断是否已加载过动态/静态路由
|
||||
var isGetRouter = false;
|
||||
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start()
|
||||
//动态标题
|
||||
document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}`
|
||||
|
||||
let token = tools.data.get("TOKEN");
|
||||
if (to.path === "/login") {
|
||||
//删除路由(替换当前layout路由)
|
||||
router.addRoute(routes[0])
|
||||
//删除路由(404)
|
||||
routes_404_r()
|
||||
isGetRouter = false;
|
||||
next();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (routes.findIndex(r => r.path === to.path) >= 0) {
|
||||
next();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!token) {
|
||||
next({
|
||||
path: '/login'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
//整页路由处理
|
||||
if (to.meta.fullpage) {
|
||||
to.matched = [to.matched[to.matched.length - 1]]
|
||||
}
|
||||
|
||||
//加载动态/静态路由
|
||||
if (!isGetRouter) {
|
||||
// 动态加载菜单
|
||||
// const [res, err] = await tools.go(api.auth.menu())
|
||||
// console.log(res)
|
||||
// if (err) {
|
||||
// return false
|
||||
// }
|
||||
// tools.data.set("MENU", tools.makeMenu(res.data.menus, 0))
|
||||
// tools.data.set("PERMISSIONS", res.data.buttons)
|
||||
// tools.data.set("ROLE", res.data.roles)
|
||||
|
||||
let apiMenu = tools.data.get("MENU") || []
|
||||
let userInfo = tools.data.get("USER_INFO")
|
||||
let userMenu = treeFilter([], node => {
|
||||
return node.meta.role ? node.meta.role.filter(item => userInfo.role.indexOf(item) > -1).length > 0 : true
|
||||
})
|
||||
let menu = [...userMenu, ...apiMenu]
|
||||
var menuRouter = filterAsyncRouter(menu)
|
||||
menuRouter = flatAsyncRoutes(menuRouter)
|
||||
menuRouter.forEach(item => {
|
||||
router.addRoute("layout", item)
|
||||
})
|
||||
routes_404_r = router.addRoute(routes_404)
|
||||
if (to.matched.length == 0) {
|
||||
router.push(to.fullPath);
|
||||
}
|
||||
isGetRouter = true;
|
||||
}
|
||||
beforeEach(to, from)
|
||||
next();
|
||||
});
|
||||
|
||||
router.afterEach((to, from) => {
|
||||
afterEach(to)
|
||||
NProgress.done()
|
||||
});
|
||||
|
||||
router.onError((error) => {
|
||||
NProgress.done();
|
||||
ElNotification.error({
|
||||
title: '路由错误',
|
||||
message: error.message
|
||||
});
|
||||
});
|
||||
|
||||
//入侵追加自定义方法、对象
|
||||
// router.sc_getMenu = () => {
|
||||
// var apiMenu = tools.data.get("MENU") || []
|
||||
// let userInfo = tools.data.get("USER_INFO")
|
||||
// let userMenu = treeFilter([], node => {
|
||||
// return node.meta.role ? node.meta.role.filter(item=>userInfo.role.indexOf(item)>-1).length > 0 : true
|
||||
// })
|
||||
// var menu = [...userMenu, ...apiMenu]
|
||||
// return menu
|
||||
// }
|
||||
|
||||
//转换
|
||||
function filterAsyncRouter(routerMap) {
|
||||
const accessedRouters = []
|
||||
routerMap.forEach(item => {
|
||||
item.meta = item.meta ? item.meta : {};
|
||||
//处理外部链接特殊路由
|
||||
if (item.meta.type == 'iframe') {
|
||||
item.meta.url = item.path;
|
||||
item.path = `/i/${item.name}`;
|
||||
}
|
||||
//MAP转路由对象
|
||||
var route = {
|
||||
path: item.path,
|
||||
name: item.name,
|
||||
meta: item.meta,
|
||||
redirect: item.redirect,
|
||||
children: item.children ? filterAsyncRouter(item.children) : null,
|
||||
component: loadComponent(item.component)
|
||||
}
|
||||
accessedRouters.push(route)
|
||||
})
|
||||
return accessedRouters
|
||||
}
|
||||
|
||||
function loadComponent(component: string) {
|
||||
if (component) {
|
||||
return () => import(/* @vite-ignore */`@/views/${component}`)
|
||||
} else {
|
||||
return () => import(`@/layout/empty`)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//路由扁平化
|
||||
function flatAsyncRoutes(routes, breadcrumb = []) {
|
||||
let res = []
|
||||
routes.forEach(route => {
|
||||
const tmp = {...route}
|
||||
if (tmp.children) {
|
||||
let childrenBreadcrumb = [...breadcrumb]
|
||||
childrenBreadcrumb.push(route)
|
||||
let tmpRoute = {...route}
|
||||
tmpRoute.meta.breadcrumb = childrenBreadcrumb
|
||||
delete tmpRoute.children
|
||||
res.push(tmpRoute)
|
||||
let childrenRoutes = flatAsyncRoutes(tmp.children, childrenBreadcrumb)
|
||||
childrenRoutes.map(item => {
|
||||
res.push(item)
|
||||
})
|
||||
} else {
|
||||
let tmpBreadcrumb = [...breadcrumb]
|
||||
tmpBreadcrumb.push(tmp)
|
||||
tmp.meta.breadcrumb = tmpBreadcrumb
|
||||
res.push(tmp)
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
|
||||
//过滤树
|
||||
function treeFilter(tree, func) {
|
||||
return tree.map(node => ({...node})).filter(node => {
|
||||
node.children = node.children && treeFilter(node.children, func)
|
||||
return func(node) || (node.children && node.children.length)
|
||||
})
|
||||
}
|
||||
|
||||
export default router
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
//系统路由
|
||||
import {RouteRecordRaw} from "vue-router";
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: "layout",
|
||||
path: "/",
|
||||
component: () => import('@/layout'),
|
||||
redirect: '/dashboard',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
path: "/login",
|
||||
component: () => import('@/views/system/login'),
|
||||
meta: {
|
||||
title: "登录"
|
||||
}
|
||||
}
|
||||
]
|
||||
export default routes;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import {createStore} from 'vuex';
|
||||
|
||||
const files = import.meta.glob('./model/*.ts', {
|
||||
eager: true,
|
||||
import: 'default'
|
||||
})
|
||||
|
||||
const modules = {}
|
||||
for (const path in files) {
|
||||
modules[path.replace(/(\.\/model\/|\.ts)/g, '')] = files[path]
|
||||
}
|
||||
|
||||
export default createStore({
|
||||
modules
|
||||
});
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import router from '@/router'
|
||||
|
||||
export default {
|
||||
state: {
|
||||
viewTags: []
|
||||
},
|
||||
mutations: {
|
||||
pushViewTags(state, route){
|
||||
let backPathIndex = state.viewTags.findIndex(item => item.fullPath == router.options.history.state.back)
|
||||
let target = state.viewTags.find((item) => item.fullPath === route.fullPath)
|
||||
let isName = route.name
|
||||
if(!target && isName){
|
||||
if(backPathIndex == -1){
|
||||
state.viewTags.push(route)
|
||||
}else{
|
||||
state.viewTags.splice(backPathIndex+1, 0, route)
|
||||
}
|
||||
}
|
||||
},
|
||||
removeViewTags(state, route){
|
||||
state.viewTags.forEach((item, index) => {
|
||||
if (item.fullPath === route.fullPath){
|
||||
state.viewTags.splice(index, 1)
|
||||
}
|
||||
})
|
||||
},
|
||||
updateViewTags(state, route){
|
||||
state.viewTags.forEach((item) => {
|
||||
if (item.fullPath == route.fullPath){
|
||||
item = Object.assign(item, route)
|
||||
}
|
||||
})
|
||||
},
|
||||
updateViewTagsTitle(state, title=''){
|
||||
const nowFullPath = location.hash.substring(1)
|
||||
state.viewTags.forEach((item) => {
|
||||
if (item.fullPath == nowFullPath){
|
||||
item.meta.title = title
|
||||
}
|
||||
})
|
||||
},
|
||||
clearViewTags(state){
|
||||
state.viewTags = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
/* 全局 */
|
||||
#app, body, html {width: 100%;height: 100%;background-color: #f6f8f9;font-size: 12px;}
|
||||
a {color: #333;text-decoration: none;}
|
||||
a:hover, a:focus {color: #000;text-decoration: none;}
|
||||
a:link {text-decoration: none;}
|
||||
a:-webkit-any-link {text-decoration: none;}
|
||||
a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: border-box;outline:none !important; -webkit-appearance: none;}
|
||||
* {margin: 0;padding: 0;box-sizing: border-box;outline: none;}
|
||||
|
||||
/* 大布局样式 */
|
||||
.aminui {display: flex;flex-flow: column;}
|
||||
.aminui-wrapper {display: flex;flex:1;overflow: auto;}
|
||||
|
||||
/* 全局滚动条样式 */
|
||||
.scrollable {-webkit-overflow-scrolling: touch;}
|
||||
::-webkit-scrollbar {width: 5px;height: 5px;}
|
||||
::-webkit-scrollbar-thumb {background-color: rgba(50, 50, 50, 0.3);}
|
||||
::-webkit-scrollbar-thumb:hover {background-color: rgba(50, 50, 50, 0.6);}
|
||||
::-webkit-scrollbar-track {background-color: rgba(50, 50, 50, 0.1);}
|
||||
::-webkit-scrollbar-track:hover {background-color: rgba(50, 50, 50, 0.2);}
|
||||
|
||||
/*布局设置*/
|
||||
.layout-setting {position: fixed;width: 40px;height: 40px;border-radius: 3px 0 0 3px;bottom: 100px;right: 0px;z-index: 100;background: #409EFF;display: flex;flex-direction: column;align-items: center;justify-content: center;cursor: pointer;}
|
||||
.layout-setting i {font-size: 18px;color: #fff;}
|
||||
|
||||
/* 头部 */
|
||||
.adminui-header {height: 58px;background: #222b45;color: #fff;display: flex;justify-content:space-between;}
|
||||
.adminui-header-left {display: flex;align-items: center;padding-left:20px;}
|
||||
.adminui-header-right {display: flex;align-items: center;}
|
||||
.adminui-header .logo-bar {font-size: 20px;font-weight: bold;display: flex;align-items: center;}
|
||||
.adminui-header .logo-bar .logo {margin-right: 10px;width: 35px;height: 35px;}
|
||||
.adminui-header .nav {display: flex;height: 100%;margin-left: 40px;}
|
||||
.adminui-header .nav li {padding:0 10px;margin: 0 10px 0 0;font-size: 14px;color: rgba(255, 255, 255, 0.6);list-style: none;height: 100%;display: flex;align-items: center;cursor: pointer;}
|
||||
.adminui-header .nav li i {margin-right: 5px;}
|
||||
.adminui-header .nav li:hover {color: #fff;}
|
||||
.adminui-header .nav li.active {background: rgba(255, 255, 255, 0.1);color: #fff;}
|
||||
.adminui-header .user-bar .panel-item:hover {background: rgba(255, 255, 255, 0.1)!important;}
|
||||
.adminui-header .user-bar .user label{color: #fff;}
|
||||
|
||||
/* 左侧菜单 */
|
||||
.aminui-side-split {width:65px;flex-shrink:0;background: #222b45;display: flex;flex-flow: column;}
|
||||
.aminui-side-split-top {height: 49px;}
|
||||
.aminui-side-split-top a {display: inline-block;width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;}
|
||||
.aminui-side-split-top .logo {height:30px;vertical-align: bottom;}
|
||||
.adminui-side-split-scroll {overflow: auto;overflow-x:hidden;height: 100%;flex: 1;}
|
||||
.aminui-side-split li {cursor: pointer;width: 65px;height: 65px;color: #fff;text-align: center;display: flex;flex-direction: column;align-items: center;justify-content: center;}
|
||||
.aminui-side-split li i {font-size: 18px;}
|
||||
.aminui-side-split li p {margin-top:5px;}
|
||||
.aminui-side-split li:hover {background: rgba(255, 255, 255, 0.1);}
|
||||
.aminui-side-split li.active {background: #409EFF;}
|
||||
|
||||
.adminui-side-split-scroll::-webkit-scrollbar-thumb {background-color: rgba(255, 255, 255, 0.4);border-radius:5px;}
|
||||
.adminui-side-split-scroll::-webkit-scrollbar-thumb:hover {background-color: rgba(255, 255, 255, 0.5);}
|
||||
.adminui-side-split-scroll::-webkit-scrollbar-track {background-color: rgba(255, 255, 255, 0);}
|
||||
.adminui-side-split-scroll::-webkit-scrollbar-track:hover {background-color: rgba(255, 255, 255, 0);}
|
||||
|
||||
.aminui-side {display: flex;flex-flow: column;flex-shrink:0;width:210px;background: #fff;box-shadow: 2px 0 8px 0 rgba(29,35,41,.05);border-right: 1px solid #e6e6e6;transition:width 0.3s;}
|
||||
.adminui-side-top {border-bottom: 1px solid #ebeef5;height:50px;line-height: 50px;}
|
||||
.adminui-side-top h2 {padding:0 20px;font-size: 17px;color: #3c4a54;}
|
||||
.adminui-side-scroll {overflow: auto;overflow-x:hidden;flex: 1;}
|
||||
.adminui-side-bottom {border-top: 1px solid #ebeef5;height:51px;cursor: pointer;display: flex;align-items: center;justify-content: center;}
|
||||
.adminui-side-bottom i {font-size: 16px;}
|
||||
.adminui-side-bottom:hover {color: var(--el-color-primary);}
|
||||
.aminui-side.isCollapse {width: 65px;}
|
||||
.el-menu .menu-tag {position: absolute;height: 18px;line-height: 18px;background: var(--el-color-danger);font-size: 12px;color: #fff;right: 20px;border-radius:18px;padding:0 6px;}
|
||||
.el-menu .el-sub-menu__title .menu-tag {right: 40px;}
|
||||
.el-menu--horizontal > li .menu-tag {display: none;}
|
||||
|
||||
/* 右侧内容 */
|
||||
.aminui-body {flex: 1;display: flex;flex-flow: column;}
|
||||
|
||||
.adminui-topbar {height: 50px;border-bottom: 1px solid #ebeef5;background: #fff;box-shadow: 0 1px 4px rgba(0,21,41,.08);display: flex;justify-content:space-between;}
|
||||
.adminui-topbar .left-panel {display: flex;align-items: center;}
|
||||
.adminui-topbar .right-panel {display: flex;align-items: center;}
|
||||
|
||||
.right-panel-search {display: flex;align-items: center;}
|
||||
.right-panel-search > * + * {margin-left:10px;}
|
||||
|
||||
.adminui-tags {height:35px;background: #fff;border-bottom: 1px solid #e6e6e6;}
|
||||
.adminui-tags ul {display: flex;overflow: hidden;}
|
||||
.adminui-tags li {cursor: pointer;display: inline-block;float: left;height:34px;line-height: 34px;position: relative;flex-shrink: 0;}
|
||||
.adminui-tags li::after {content: " ";width:1px;height:100%;position: absolute;right:0px;background-image: linear-gradient(#fff, #e6e6e6);}
|
||||
.adminui-tags li a {display: inline-block;padding:0 10px;width:100%;height:100%;color: #999;text-decoration:none;display: flex;align-items: center;}
|
||||
.adminui-tags li i {margin-left:10px;border-radius: 3px;width:18px;height:18px;display: flex;align-items: center;justify-content: center;}
|
||||
.adminui-tags li i:hover {background: rgba(0,0,0,.2);color: #fff;}
|
||||
.adminui-tags li:hover {background: #ecf5ff;}
|
||||
.adminui-tags li.active {background: #409EFF;}
|
||||
.adminui-tags li.active a {color: #fff;}
|
||||
.adminui-tags li.sortable-ghost {opacity: 0;}
|
||||
|
||||
.adminui-main {overflow: auto;background-color: #f6f8f9;flex: 1;}
|
||||
|
||||
/*页面最大化*/
|
||||
.aminui.main-maximize {
|
||||
.main-maximize-exit {display: block;}
|
||||
.aminui-side-split, .aminui-side, .adminui-header, .adminui-topbar, .adminui-tags {display: none;}
|
||||
}
|
||||
.main-maximize-exit {display: none;position: fixed;z-index: 3000;top:-20px;left:50%;margin-left: -20px;border-radius: 50%;width: 40px;height: 40px;cursor: pointer;background: rgba(0,0,0,0.2);text-align: center;}
|
||||
.main-maximize-exit i {font-size: 14px;margin-top: 22px;color: #fff;}
|
||||
.main-maximize-exit:hover {background: rgba(0,0,0,0.4);}
|
||||
|
||||
/*定宽页面*/
|
||||
.sc-page {width: 1230px;margin: 0 auto;}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
@import '~element-plus/theme-chalk/src/dark/css-vars.scss';
|
||||
|
||||
html.dark {
|
||||
//变量
|
||||
--el-text-color-primary: #d0d0d0;
|
||||
--el-color-primary-dark-2: var(--el-color-primary-light-2) !important;
|
||||
--el-color-primary-light-9: var(--el-color-primary-dark-8) !important;
|
||||
--el-color-primary-light-8: var(--el-color-primary-dark-7) !important;
|
||||
--el-color-primary-light-7: var(--el-color-primary-dark-6) !important;
|
||||
--el-color-primary-light-5: var(--el-color-primary-dark-4) !important;
|
||||
--el-color-primary-light-3: var(--el-color-primary-dark-3) !important;
|
||||
|
||||
//背景
|
||||
#app {background: var(--el-bg-color);}
|
||||
|
||||
//登录背景
|
||||
.login_bg {background: var(--el-bg-color);}
|
||||
|
||||
//框架
|
||||
.adminui-header {background: var(--el-bg-color-overlay);border-bottom: 1px solid var(--el-border-color-light);height:59px;}
|
||||
.aminui-side-split {background: var(--el-bg-color);}
|
||||
.aminui-side-split li {color: var(--el-text-color-primary);}
|
||||
.aminui-side {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);}
|
||||
.adminui-side-top, .adminui-side-bottom {border-color: var(--el-border-color-light);}
|
||||
.adminui-side-top h2 {color: var(--el-text-color-primary);}
|
||||
.adminui-topbar, .adminui-tags {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);}
|
||||
.adminui-main {background: var(--el-bg-color);}
|
||||
.drawerBG {background: var(--el-bg-color);}
|
||||
.adminui-header-menu .el-menu {--el-menu-bg-color:var(--el-bg-color-overlay) !important;--el-menu-hover-bg-color: #171819 !important;}
|
||||
|
||||
//组件
|
||||
.el-header, .el-main.nopadding, .el-footer {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);}
|
||||
.el-main {background: var(--el-bg-color);}
|
||||
.el-aside {background: var(--el-bg-color-overlay);border-color: var(--el-border-color-light);}
|
||||
.el-table .el-table__body-wrapper {background: var(--el-bg-color);}
|
||||
.el-table th.is-sortable:hover {background: #111;}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
/* 覆盖element-plus样式 */
|
||||
|
||||
:root {
|
||||
--el-color-primary: #409EFF;
|
||||
--el-color-primary-light-1: #53a7ff;
|
||||
--el-color-primary-light-2: #66b1ff;
|
||||
--el-color-primary-light-3: #79bbff;
|
||||
--el-color-primary-light-4: #8cc4ff;
|
||||
--el-color-primary-light-5: #9fceff;
|
||||
--el-color-primary-light-6: #b2d8ff;
|
||||
--el-color-primary-light-7: #c5e1ff;
|
||||
--el-color-primary-light-8: #d8ebff;
|
||||
--el-color-primary-light-9: #ebf5ff;
|
||||
--el-color-primary-dark-1: #398ee5;
|
||||
--el-color-primary-dark-2: #337ecc;
|
||||
--el-color-primary-dark-3: #2c6eb2;
|
||||
--el-color-primary-dark-4: #265e99;
|
||||
--el-color-primary-dark-5: #204f7f;
|
||||
--el-color-primary-dark-6: #193f66;
|
||||
--el-color-primary-dark-7: #132f4c;
|
||||
--el-color-primary-dark-8: #0c1f32;
|
||||
--el-color-primary-dark-9: #060f19;
|
||||
}
|
||||
|
||||
.el-menu {border: none!important;}
|
||||
.el-menu .el-menu-item a {color: inherit;text-decoration: none;display: block;width:100%;height:100%;position: absolute;top:0px;left:0px;}
|
||||
.el-form-item-msg {font-size: 12px;color: #999;clear: both;width: 100%;}
|
||||
.el-container {height: 100%;}
|
||||
.el-aside {border-right: 1px solid var(--el-border-color-light);}
|
||||
.el-container + .el-aside {border-right: 0;border-left: 1px solid var(--el-border-color-light);}
|
||||
.el-header {background: #fff;border-bottom: 1px solid var(--el-border-color-light);padding:13px 15px;display: flex;justify-content: space-between;align-items: center;}
|
||||
.el-header .left-panel {display: flex;align-items: center;}
|
||||
.el-header .right-panel {display: flex;align-items: center;}
|
||||
.el-header .right-panel > * + * {margin-left:10px;}
|
||||
.el-footer {background: #fff;border-top: 1px solid var(--el-border-color-light);padding:13px 15px;height: 51px;}
|
||||
.el-main {padding:15px;}
|
||||
.el-main.nopadding {padding:0;background: #fff;}
|
||||
.el-main.bgfff {background: #fff;}
|
||||
.el-drawer__body {overflow: auto;padding:0;}
|
||||
.el-popconfirm__main {margin: 14px 0;}
|
||||
.el-card__header {border-bottom: 0;font-size: 17px;font-weight: bold;padding:15px 20px 0px 20px;}
|
||||
.el-dialog__title {font-size: 17px;font-weight: bold;}
|
||||
.el-drawer__header>:first-child {font-size: 17px;font-weight: bold;}
|
||||
.el-tree.menu .el-tree-node__content {height:36px;}
|
||||
.el-tree.menu .el-tree-node__content .el-tree-node__label .icon {margin-right: 5px;}
|
||||
.el-progress__text {font-size: 12px!important;}
|
||||
.el-progress__text i {font-size: 14.4px!important;}
|
||||
.el-step.is-horizontal .el-step__line {height:1px;}
|
||||
.el-step__title {font-size: 14px;}
|
||||
.drawerBG {background: #f6f8f9;}
|
||||
.el-button+.el-dropdown {margin-left: 10px;}
|
||||
.el-button-group+.el-dropdown {margin-left: 10px;}
|
||||
.el-tag+.el-tag {margin-left: 10px;}
|
||||
.el-button-group+.el-button-group {margin-left: 10px;}
|
||||
.el-tabs__nav-wrap::after {height: 1px;}
|
||||
.el-table th.is-sortable {transition: .1s;}
|
||||
.el-table th.is-sortable:hover {background: #eee;}
|
||||
.el-table .el-table__body-wrapper {background: #f6f8f9;}
|
||||
.el-col .el-card {margin-bottom: 15px;}
|
||||
.el-main {flex-basis: 100%;}
|
||||
.el-main > .scTable .el-table--border::before {display: none;}
|
||||
.el-main > .scTable .el-table--border::after {display: none;}
|
||||
.el-main > .scTable .el-table--border .el-table__inner-wrapper::after {display: none;}
|
||||
.el-main > .scTable .el-table__border-left-patch {display: none;}
|
||||
.el-main > .scTable .el-table--border .el-table__inner-wrapper tr:first-child td:first-child {border-left: 0;}
|
||||
.el-main > .scTable .el-table--border .el-table__inner-wrapper tr:first-child th:first-child {border-left: 0;}
|
||||
.el-table.el-table--large {font-size: 14px;}
|
||||
.el-table.el-table--small {font-size: 12px;}
|
||||
.el-table {font-size: 12px;}
|
||||
.el-radio-button__inner {font-size: 12px;}
|
||||
.el-checkbox-button__inner {font-size: 12px;}
|
||||
.el-sub-menu .el-icon {font-size: 17px;}
|
||||
.el-sub-menu .el-sub-menu__icon-arrow {font-size: 12px;}
|
||||
|
||||
.el-dropdown-link {cursor: pointer;color: var(--el-color-primary);line-height: 22px;font-size: 12px;}
|
||||
|
||||
.aminui-side-split li.active {background-color: var(--el-color-primary);}
|
||||
.adminui-tags li:hover {background-color: var(--el-color-primary-light-9);}
|
||||
.adminui-tags li.active {background-color: var(--el-color-primary)!important;}
|
||||
.contextmenu li:hover {background-color: var(--el-color-primary-light-9)!important;color: var(--el-color-primary-light-2)!important;}
|
||||
.data-box .item-background {background-color: var(--el-color-primary)!important;}
|
||||
.layout-setting,.diy-grid-setting {background-color: var(--el-color-primary)!important;}
|
||||
|
||||
/* 覆盖tinymce样式 */
|
||||
.sceditor .tox-tinymce {border: 1px solid #DCDFE6;border-radius: 0;}
|
||||
body .tox-tinymce-aux {z-index: 5700;}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
@media (max-width: 992px){
|
||||
// 移动端样式覆盖
|
||||
.el-form-item {display: block;}
|
||||
.el-form-item__label {display: block;text-align: left;padding: 0 0 10px;}
|
||||
.el-dialog {width: 90%!important;}
|
||||
.el-dialog.is-fullscreen {width: 100%!important;}
|
||||
.el-drawer.rtl {width: 90%!important;}
|
||||
.el-form-item__content {margin-left: 0px!important;}
|
||||
|
||||
.adminui-main {
|
||||
>.el-container {display: block;height:auto;}
|
||||
>.el-container > .el-aside {width: 100%!important;border: 0}
|
||||
}
|
||||
.scTable {
|
||||
.el-table,
|
||||
.el-table__body-wrapper {display: block!important;height:auto!important;}
|
||||
.el-scrollbar__wrap {height:auto!important;}
|
||||
.scTable-page {padding: 0 5px!important;}
|
||||
.el-pagination__total,
|
||||
.el-pagination__jump,
|
||||
.el-pagination__sizes {display: none!important;}
|
||||
}
|
||||
|
||||
.headerPublic {
|
||||
height: auto!important;display: block;
|
||||
.left-panel {overflow: auto;}
|
||||
.left-panel::-webkit-scrollbar{display: none;}
|
||||
.right-panel {display: block;border-top: 1px solid var(--el-border-color-light);margin-top: 15px;}
|
||||
.right-panel .right-panel-search {display: block;}
|
||||
.right-panel .right-panel-search >* {width: 100%;margin: 0;margin-top: 15px;}
|
||||
}
|
||||
.adminui-main > .el-container >*:first-child:not(.el-aside):not(.el-header) {border: 0;margin-top: 0;}
|
||||
.adminui-main > .el-container >*:first-child:not(.el-aside):not(.el-header) + .el-aside {margin-top: 0;}
|
||||
.adminui-main > .el-container > .el-aside {border-bottom: 1px solid var(--el-border-color-light)!important;}
|
||||
.adminui-main > .el-container > .el-container {border-top: 1px solid var(--el-border-color-light);border-bottom: 1px solid var(--el-border-color-light);margin-top: 15px;}
|
||||
.adminui-main > .el-container > .el-container + .el-aside {border-top: 1px solid var(--el-border-color-light);margin-top: 15px;}
|
||||
.adminui-main > .el-container > .el-header {@extend .headerPublic;}
|
||||
.adminui-main > .el-container > .el-main.nopadding {border-top: 1px solid var(--el-border-color-light);border-bottom: 1px solid var(--el-border-color-light);margin-top: 15px;}
|
||||
.adminui-main > .el-container > .el-main + .el-aside {border-left: 0!important;border-top: 1px solid var(--el-border-color-light);margin-top: 15px;}
|
||||
.adminui-main > .el-container > .el-footer {margin-top: 15px;border-bottom: 1px solid var(--el-border-color-light);}
|
||||
.adminui-main > .el-container > .el-container > .el-header {@extend .headerPublic}
|
||||
.adminui-main > .el-container > .el-container > .el-header .left-panel {display: block;}
|
||||
.adminui-main > .el-container > .el-container > .el-header .right-panel {display: block;margin-top: 15px;}
|
||||
|
||||
.sc-page {width: 100%;margin: 0;}
|
||||
|
||||
.common-main .el-form {width: 100% !important;}
|
||||
.common-header-logo label {display: none;}
|
||||
.common-header-title {display: none;}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/* USERCENTER */
|
||||
.page-user {
|
||||
.user-info-top {text-align: center;}
|
||||
.user-info-top h2 {font-size: 18px;margin-top: 5px;}
|
||||
.user-info-top p {margin: 8px 0 10px 0;}
|
||||
.menu {background: none;}
|
||||
.menu .el-menu-item {font-size: 12px;--el-menu-item-height:50px;}
|
||||
.menu .el-menu-item-group {border-top: 1px solid var(--el-border-color-light);}
|
||||
.menu .el-menu-item-group:first-child {border: 0;}
|
||||
}
|
||||
|
||||
/*static-table*/
|
||||
.static-table {border-collapse: collapse;width: 100%;font-size: 14px;margin-bottom: 45px;line-height: 1.5em;}
|
||||
.static-table th {text-align: left;white-space: nowrap;color: #909399;font-weight: 400;border-bottom: 1px solid #dcdfe6;padding: 15px;max-width: 250px;}
|
||||
.static-table td {border-bottom: 1px solid #dcdfe6;padding: 15px;max-width: 250px;color: #606266;}
|
||||
|
||||
/*header-tabs*/
|
||||
.header-tabs {padding:10px 0 0 0;display:block;border:0!important;height:50px;background: none;}
|
||||
.header-tabs .el-tabs__header {padding-left:10px;margin: 0;}
|
||||
.header-tabs .el-tabs__content {display: none;}
|
||||
.header-tabs .el-tabs__nav {border-radius: 0 !important;}
|
||||
.header-tabs .el-tabs__item {font-size: 13px;}
|
||||
.header-tabs .el-tabs__item.is-active {background-color: var(--el-bg-color-overlay);}
|
||||
|
||||
/*common-page*/
|
||||
.common-page {}
|
||||
.common-header-left {display: flex;align-items: center;}
|
||||
.common-header-logo {display: flex;align-items: center;}
|
||||
.common-header-logo img {height:30px;margin-right: 10px;vertical-align: bottom;}
|
||||
.common-header-logo label {font-size: 20px;}
|
||||
.common-header-title {font-size: 16px;border-left: 1px solid var(--el-border-color-light);margin-left: 15px;padding-left: 15px;}
|
||||
.common-header-right {display: flex;align-items: center;}
|
||||
.common-header-right a {font-size: 14px;color: var(--el-color-primary);cursor: pointer;}
|
||||
.common-header-right a:hover {color: var(--el-color-primary-light-3);}
|
||||
.common-container {max-width: 1240px;margin:30px auto 30px auto;}
|
||||
.common-main {padding:20px;}
|
||||
.common-title {font-size: 26px;margin-bottom: 20px;font-weight: normal;}
|
||||
.common-main .el-form {width: 500px;margin:30px auto;}
|
||||
.common-main .el-steps .el-step__title {font-size: 14px;}
|
||||
.common-main .el-steps .el-step__icon {border: 1px solid;}
|
||||
.common-main .yzm {display: flex;width: 100%;}
|
||||
.common-main .yzm .el-button {margin-left: 10px;}
|
||||
.common-main .link {color: var(--el-color-primary);cursor: pointer;}
|
||||
.common-main .link:hover {color: var(--el-color-primary-light-3);}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
@import 'app.scss';
|
||||
@import 'fix.scss';
|
||||
@import 'pages.scss';
|
||||
@import 'media.scss';
|
||||
@import 'dark.scss';
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
import axios from 'axios';
|
||||
import {ElNotification} from 'element-plus';
|
||||
import sConfig from "@/config";
|
||||
import tools from '@/utils/tools';
|
||||
import router from '@/router';
|
||||
|
||||
// 请求地址
|
||||
axios.defaults.baseURL = sConfig.API_URL
|
||||
// 超时时间
|
||||
axios.defaults.timeout = sConfig.TIMEOUT
|
||||
// 请求拦截
|
||||
axios.interceptors.request.use((config) => {
|
||||
let token = tools.data.get("TOKEN")
|
||||
if (token) {
|
||||
config.headers[sConfig.TOKEN_NAME] = sConfig.TOKEN_PREFIX + token
|
||||
}
|
||||
// get请求添加时间戳
|
||||
if (!sConfig.REQUEST_CACHE && config.method === 'get') {
|
||||
config.params = config.params || {};
|
||||
config.params['_'] = new Date().getTime();
|
||||
}
|
||||
return config;
|
||||
})
|
||||
//响应拦截
|
||||
axios.interceptors.response.use((response) => {
|
||||
let res = response.data
|
||||
if (res.code == 0) {
|
||||
return Promise.resolve(res)
|
||||
} else if (res.code == 1) { // 操作失败拦截
|
||||
ElNotification.error({title: '操作失败', message: res.msg});
|
||||
return Promise.reject(res)
|
||||
} else if (res.code == 2) { // 权限不足拦截
|
||||
ElNotification.error({title: '权限不足', message: res.msg});
|
||||
return Promise.reject(res)
|
||||
} else { // 登录失效拦截
|
||||
ElNotification.error({title: '登录失效', message: res.msg});
|
||||
router.replace({path: '/login'}).then(r => {
|
||||
});
|
||||
}
|
||||
}, (error) => {
|
||||
if (error.response) {
|
||||
if (error.response.status === 404) {
|
||||
ElNotification.error({title: '请求错误', message: "Status:404,正在请求不存在的资源!"});
|
||||
} else if (error.response.status === 500) {
|
||||
ElNotification.error({
|
||||
title: '请求错误',
|
||||
message: error.response.data.message || "Status:500,服务器发生错误!"
|
||||
});
|
||||
} else {
|
||||
ElNotification.error({
|
||||
title: '请求错误',
|
||||
message: error.message || `Status:${error.response.status},未知错误!`
|
||||
});
|
||||
}
|
||||
} else {
|
||||
ElNotification.error({title: '请求错误', message: "请求服务器无响应!"});
|
||||
}
|
||||
return Promise.reject(error.response);
|
||||
})
|
||||
|
||||
const http = {
|
||||
/** get 请求
|
||||
* @param url 请求地址
|
||||
* @param params 参数
|
||||
* @param config 配置
|
||||
*/
|
||||
get: function (url: string, params = {}, config = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
params: params,
|
||||
...config
|
||||
}).then((response) => {
|
||||
resolve(response);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/** post 请求
|
||||
* @param url 请求地址
|
||||
* @param data 参数
|
||||
* @param config 配置
|
||||
*/
|
||||
post: function (url: string, data = {}, config = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
method: 'post',
|
||||
url: url,
|
||||
data: data,
|
||||
...config
|
||||
}).then((response) => {
|
||||
resolve(response);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/** put 请求
|
||||
* @param url 请求地址
|
||||
* @param data 参数
|
||||
* @param config 配置
|
||||
*/
|
||||
put: function (url: string, data = {}, config = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
method: 'put',
|
||||
url: url,
|
||||
data: data,
|
||||
...config
|
||||
}).then((response) => {
|
||||
resolve(response);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/** delete 请求
|
||||
* @param url 请求地址
|
||||
* @param params 参数
|
||||
* @param config 配置
|
||||
*/
|
||||
delete: function (url: string, params = {}, config = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
method: 'delete',
|
||||
url: url,
|
||||
params: params,
|
||||
...config
|
||||
}).then((response) => {
|
||||
resolve(response);
|
||||
}).catch((error) => {
|
||||
reject(error);
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default http;
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
// import store from '@/store'
|
||||
import {nextTick} from 'vue'
|
||||
import {RouteLocationNormalized, RouteLocationNormalizedLoaded} from "vue-router";
|
||||
|
||||
export function beforeEach(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded) {
|
||||
const adminMain = document.querySelector('#pi-main');
|
||||
if (!adminMain) {
|
||||
return false
|
||||
}
|
||||
// store.commit("updateViewTags", {
|
||||
// fullPath: from.fullPath,
|
||||
// scrollTop: adminMain.scrollTop
|
||||
// })
|
||||
}
|
||||
|
||||
export function afterEach(to: RouteLocationNormalized) {
|
||||
const adminMain = document.querySelector('#pi-main');
|
||||
if (!adminMain) {
|
||||
return false
|
||||
}
|
||||
// nextTick(() => {
|
||||
// const beforeRoute = store.state.views.viewTags.filter(v => v.fullPath == to.fullPath)[0];
|
||||
// if (beforeRoute) {
|
||||
// adminMain.scrollTop = beforeRoute.scrollTop || 0
|
||||
// }
|
||||
// }).then(r => {})
|
||||
}
|
||||
|
|
@ -33,12 +33,20 @@ const tools = {
|
|||
}
|
||||
},
|
||||
base64: {
|
||||
encrypt(data){
|
||||
encrypt(data) {
|
||||
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(data))
|
||||
},
|
||||
decrypt(cipher){
|
||||
decrypt(cipher) {
|
||||
return CryptoJS.enc.Base64.parse(cipher).toString(CryptoJS.enc.Utf8)
|
||||
}
|
||||
},
|
||||
go: async function (fn: Function) {
|
||||
try {
|
||||
let res = await fn
|
||||
return [res, null]
|
||||
} catch (err) {
|
||||
return [null, err]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header style="height:50px;">
|
||||
<div class="common-header-left">
|
||||
<div class="common-header-logo">
|
||||
<img :alt="$CONFIG.APP_NAME" src="img/logo.png">
|
||||
<label>{{$CONFIG.APP_NAME}}</label>
|
||||
</div>
|
||||
<div class="common-header-title">{{title}}</div>
|
||||
</div>
|
||||
<div class="common-header-right">
|
||||
<router-link to="/login">{{$t('login.back_login')}}</router-link>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main>
|
||||
<div class="common-container">
|
||||
<h2 class="common-title">{{title}}</h2>
|
||||
<div class="common-main el-card">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: { type: String, default: "" }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
<template>
|
||||
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
|
||||
<el-form-item prop="user">
|
||||
<el-input v-model="form.username" prefix-icon="el-icon-user" clearable :placeholder="$t('login.userPlaceholder')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="form.password" prefix-icon="el-icon-lock" clearable show-password :placeholder="$t('login.PWPlaceholder')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="veryCode">
|
||||
<el-input v-model="form.code" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.codePlaceholder')">
|
||||
<template #append>
|
||||
<el-image :src="verImage" @click="getCode" style="padding: 1px;"/>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-bottom: 10px;">
|
||||
<el-col :span="12">
|
||||
<el-checkbox :label="$t('login.rememberMe')" v-model="form.autologin"></el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="12" class="login-forgot">
|
||||
<router-link to="/reset_password">{{ $t('login.forgetPassword') }}?</router-link>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
username: "",
|
||||
password: "",
|
||||
code: "",
|
||||
uuid: "",
|
||||
autologin: false
|
||||
},
|
||||
verImage: '',
|
||||
rules: {
|
||||
username: [
|
||||
{required: true, message: this.$t('login.userError'), trigger: 'blur'}
|
||||
],
|
||||
password: [
|
||||
{required: true, message: this.$t('login.PWError'), trigger: 'blur'}
|
||||
],
|
||||
code: [
|
||||
{required: true, message: this.$t('login.codeError'), trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
islogin: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getCode()
|
||||
this.rememberMe()
|
||||
},
|
||||
methods: {
|
||||
rememberMe() {
|
||||
const data = this.$TOOLS.data.get("ACCOUNT")
|
||||
if (data) {
|
||||
this.form.username = data.username
|
||||
this.form.password = data.password
|
||||
this.form.autologin = true
|
||||
}
|
||||
},
|
||||
async getCode() {
|
||||
// const res = await this.$API.auth.verify();
|
||||
// this.form.uuid = res.data.uuid
|
||||
// this.verImage = res.data.image
|
||||
this.form.code = "";
|
||||
},
|
||||
async login(){
|
||||
// 校验登录
|
||||
const validate = await this.$refs.loginForm.validate().catch(() => {});
|
||||
if(!validate){ return false }
|
||||
|
||||
this.islogin = true
|
||||
const data = {
|
||||
username: this.form.username,
|
||||
password: this.$TOOL.crypto.MD5(this.form.password),
|
||||
uuid: this.form.uuid,
|
||||
code: this.form.code
|
||||
};
|
||||
// 登录接口
|
||||
const [res, err] = await this.$TOOLS.go(this.$API.auth.token(data))
|
||||
this.islogin = false
|
||||
if (err) {
|
||||
await this.getCode();
|
||||
return false;
|
||||
}
|
||||
this.$TOOL.data.set("TOKEN", res.data.token, res.data.expireIn)
|
||||
// 记住密码
|
||||
if (this.form.autologin) {
|
||||
this.$TOOL.data.set("ACCOUNT", {
|
||||
username: this.form.username,
|
||||
password: this.form.password
|
||||
})
|
||||
}
|
||||
// 获取账号信息
|
||||
await this.getInfo()
|
||||
// 获取菜单信息
|
||||
// await this.getMenu()
|
||||
},
|
||||
async getInfo() {
|
||||
const [res, err] = await this.$TOOLS.go(this.$API.auth.getAccountInfo())
|
||||
if (err) {
|
||||
return false
|
||||
}
|
||||
this.$TOOL.data.set("USER_INFO", res.data)
|
||||
// 登录成功跳转首页
|
||||
this.$router.replace({path: '/'})
|
||||
this.$message.success("Login Success 登录成功")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:deep(.el-input-group__append, .el-input-group__prepend) {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
<template>
|
||||
<sc-dialog v-model="showWechatLogin" title="扫码登录" :width="400" destroy-on-close :showFullscreen="false" @closed="$emit('closed')">
|
||||
<div class="qrCodeLogin">
|
||||
<sc-qr-code class="qrCode" :text="wechatLoginCode" :size="200"></sc-qr-code>
|
||||
<p class="msg">{{wechatLoginMsg}}</p>
|
||||
<div class="qrCodeLogin-result" v-if="isWechatLoginResult">
|
||||
<el-result v-if="loading" icon="success" :sub-title="wechatLoginMsg"></el-result>
|
||||
<el-result v-else icon="error" :sub-title="wechatLoginMsg">
|
||||
<template #extra>
|
||||
<el-button type="primary" link @click="reGetCode()">重新获取</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
</div>
|
||||
</sc-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "wechatLogin",
|
||||
data() {
|
||||
return {
|
||||
showWechatLogin: false,
|
||||
wechatLoginCode: "",
|
||||
isWechatLoginResult: false,
|
||||
wechatLoginMsg: "",
|
||||
t1: null,
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
unmounted() {
|
||||
this.clearTimer()
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.getLogin()
|
||||
this.showWechatLogin = true;
|
||||
return this
|
||||
},
|
||||
reGetCode() {
|
||||
this.isWechatLoginResult = false
|
||||
this.wechatLoginCode = ""
|
||||
this.wechatLoginMsg = ""
|
||||
this.loading = true
|
||||
this.getLogin()
|
||||
},
|
||||
async getLogin() {
|
||||
if (!this.wechatLoginCode) {
|
||||
await this.getCode()
|
||||
}
|
||||
const that = this;
|
||||
that.t1 = setInterval(async ()=>{
|
||||
const res = await that.$API.auth.getQrCode({qrcode: this.wechatLoginCode});
|
||||
that.wechatLoginMsg = res.msg
|
||||
if (res.data.state == 1) { // 已扫码待授权
|
||||
that.isWechatLoginResult = true
|
||||
that.loading = true
|
||||
}else if(res.data.state == 2) { // 授权成功
|
||||
that.isWechatLoginResult = true
|
||||
that.loading = true
|
||||
that.clearTimer()
|
||||
// 登录
|
||||
this.$TOOL.data.set("TOKEN", res.data.token, res.data.expireIn)
|
||||
// 获取账号信息
|
||||
await this.getInfo()
|
||||
// 获取菜单信息
|
||||
await this.getMenu()
|
||||
}else if(res.data.state == 3) { // 已过期
|
||||
that.clearTimer()
|
||||
that.isWechatLoginResult = true
|
||||
that.loading = false
|
||||
}else {
|
||||
that.isWechatLoginResult = false
|
||||
that.loading = true
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
clearTimer() {
|
||||
clearInterval(this.t1)
|
||||
this.t1 = null
|
||||
},
|
||||
async getCode() {
|
||||
const res = await this.$API.auth.qrcode();
|
||||
this.wechatLoginCode = res.data.qrcode
|
||||
this.wechatLoginMsg = res.msg
|
||||
},
|
||||
async getInfo() {
|
||||
const [res, err] = await this.$TOOL.go(this.$API.auth.getAccountInfo())
|
||||
if (err) {
|
||||
return false
|
||||
}
|
||||
this.$TOOL.data.set("USER_INFO", res.data)
|
||||
},
|
||||
async getMenu() {
|
||||
const [res, err] = await this.$TOOL.go(this.$API.auth.getMenuInfo())
|
||||
if (err) {
|
||||
return false
|
||||
}
|
||||
if(res.data.menus.length===0){
|
||||
this.islogin = false
|
||||
this.$alert("当前用户无任何菜单权限,请联系系统管理员", "无权限访问", {
|
||||
type: 'error',
|
||||
center: true
|
||||
})
|
||||
return false
|
||||
}
|
||||
this.$TOOLS.data.set("MENU", this.makeMenu(res.data.menus, 0))
|
||||
this.$TOOL.data.set("PERMISSIONS", res.data.buttons)
|
||||
this.$TOOL.data.set("ROLE", res.data.roles)
|
||||
// 登录成功跳转首页
|
||||
this.$router.replace({
|
||||
path: '/'
|
||||
})
|
||||
this.$message.success("Login Success 登录成功")
|
||||
},
|
||||
makeMenu(menus, parent_id = 0) {
|
||||
const arr = [];
|
||||
for (let item of menus) {
|
||||
if(item.parent_id === parent_id){
|
||||
// 数据格式处理
|
||||
const tmp = {
|
||||
name: item['name'],
|
||||
path: '/' + item['path'],
|
||||
component: item['path'],
|
||||
meta: {
|
||||
'title': item['title'],
|
||||
'icon': item['icon'],
|
||||
'hidden': item['hidden'],
|
||||
'type': 'menu'
|
||||
}
|
||||
};
|
||||
const children = this.makeMenu(menus, item.menu_id);
|
||||
if (children.length > 0) {
|
||||
tmp['children'] = children
|
||||
}
|
||||
arr.push(tmp)
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.qrCodeLogin {text-align: center;position: relative;padding: 20px 0;}
|
||||
.qrCodeLogin img.qrCode {background: #fff;padding:20px;border-radius:10px;}
|
||||
.qrCodeLogin p.msg {margin-top: 15px;}
|
||||
.qrCodeLogin .qrCodeLogin-result {position: absolute;top:0;left:0;right: 0;bottom: 0;text-align: center;background: var(--el-bg-color);}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
<template>
|
||||
<div class="login_bg">
|
||||
<div class="login_adv" style="background-image: url('./images/bg.jpg');">
|
||||
</div>
|
||||
<div class="login_main">
|
||||
<div class="login_config">
|
||||
<el-button :icon="config.dark?'el-icon-sunny':'el-icon-moon'" circle type="info" @click="configDark"></el-button>
|
||||
<el-dropdown trigger="click" placement="bottom-end" @command="configLang">
|
||||
<el-button circle>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"><path d="M478.33 433.6l-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362L368 281.65L401.17 362z" fill="currentColor"></path><path d="M267.84 342.92a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73c39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36c-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93c.92 1.19 1.83 2.35 2.74 3.51c-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59c22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z" fill="currentColor"></path></svg>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item v-for="item in lang" :key="item.value" :command="item" :class="{'selected':config.lang==item.value}">{{item.name}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="login-form">
|
||||
<div class="login-header">
|
||||
<div class="logo">
|
||||
<img :alt="$CONFIG.APP_NAME" src="./images/logo.png">
|
||||
<label>{{$CONFIG.APP_NAME}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<password-form></password-form>
|
||||
<template v-if="$CONFIG.MY_SHOW_LOGIN_OAUTH">
|
||||
<el-divider>{{ $t('login.signInOther') }}</el-divider>
|
||||
<div class="login-oauth">
|
||||
<el-button type="success" icon="sc-icon-wechat" circle @click="wechatLogin"></el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<wechat-dialog v-if="showWechatLogin" ref="wechatDialog" @closed="showWechatLogin=false"/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import passwordForm from './components/passwordForm'
|
||||
import wechatDialog from './components/wechatLogin'
|
||||
|
||||
export default {
|
||||
name: "login",
|
||||
components: {
|
||||
passwordForm,
|
||||
wechatDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
lang: this.$TOOLS.data.get('APP_LANG') || this.$CONFIG.LANG,
|
||||
dark: this.$TOOLS.data.get('APP_DARK') || false
|
||||
},
|
||||
lang: [
|
||||
{
|
||||
name: '简体中文',
|
||||
value: 'zh-cn',
|
||||
},
|
||||
{
|
||||
name: 'English',
|
||||
value: 'en',
|
||||
}
|
||||
],
|
||||
showWechatLogin: false
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'config.dark'(val){
|
||||
if(val){
|
||||
document.documentElement.classList.add("dark")
|
||||
this.$TOOLS.data.set("APP_DARK", val)
|
||||
}else{
|
||||
document.documentElement.classList.remove("dark")
|
||||
this.$TOOLS.data.remove("APP_DARK")
|
||||
}
|
||||
},
|
||||
'config.lang'(val){
|
||||
this.$i18n.locale = val
|
||||
this.$TOOLS.data.set("APP_LANG", val)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
configDark(){
|
||||
this.config.dark = this.config.dark ? false : true
|
||||
},
|
||||
configLang(command){
|
||||
this.config.lang = command.value
|
||||
},
|
||||
wechatLogin(){
|
||||
this.showWechatLogin = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.wechatDialog.open()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login_bg {width: 100%;height: 100%;background: #fff;display: flex;}
|
||||
.login_adv {width: 33.3333%;background-color: #555;background-size: cover;background-repeat: no-repeat;position: relative;}
|
||||
.login_adv__title {color: #fff;padding: 40px;position: absolute;top:0px;left:0px;right: 0px;z-index: 2;}
|
||||
.login_adv__title h2 {font-size: 40px;}
|
||||
.login_adv__title h4 {font-size: 18px;margin-top: 10px;font-weight: normal;}
|
||||
.login_adv__title p {font-size: 14px;margin-top:10px;line-height: 1.8;color: rgba(255,255,255,0.6);}
|
||||
.login_adv__title div {margin-top: 10px;display: flex;align-items: center;}
|
||||
.login_adv__title div span {margin-right: 15px;}
|
||||
.login_adv__title div i {font-size: 40px;}
|
||||
.login_adv__title div i.add {font-size: 20px;color: rgba(255,255,255,0.6);}
|
||||
.login_adv__bottom {position: absolute;left:0px;right: 0px;bottom: 0px;color: #fff;padding: 40px;z-index: 3;}
|
||||
.login_adv__mask {position: absolute;top:0px;left:0px;right: 0px;bottom: 0px;z-index: 1;}
|
||||
|
||||
.login_main {flex: 1;overflow: auto;display:flex;}
|
||||
.login-form {width: 400px;margin: auto;padding:20px 0;}
|
||||
.login-header {margin-bottom: 40px;}
|
||||
.login-header .logo {display: flex;align-items: center;}
|
||||
.login-header .logo img {width: 40px;height: 40px;vertical-align: bottom;margin-right: 10px;}
|
||||
.login-header .logo label {font-size: 26px;font-weight: bold;}
|
||||
.login-oauth {display: flex;justify-content:space-around;}
|
||||
.login-form .el-divider {margin-top:40px;}
|
||||
|
||||
.login-form {}
|
||||
.login-form:deep(.el-tabs) .el-tabs__header {margin-bottom: 25px;}
|
||||
.login-form:deep(.el-tabs) .el-tabs__header .el-tabs__item {font-size: 14px;}
|
||||
|
||||
.login-form:deep(.login-forgot) {text-align: right;}
|
||||
.login-form:deep(.login-forgot) a {color: var(--el-color-primary);}
|
||||
.login-form:deep(.login-forgot) a:hover {color: var(--el-color-primary-light-3);}
|
||||
|
||||
.login_config {position: absolute;top:20px;right: 20px;}
|
||||
|
||||
.login-form:deep(.login-msg-yzm) {display: flex;width: 100%;}
|
||||
.login-form:deep(.login-msg-yzm) .el-button {margin-left: 10px;--el-button-size:42px;}
|
||||
|
||||
@media (max-width: 1200px){
|
||||
.login-form {width: 340px;}
|
||||
}
|
||||
@media (max-width: 1000px){
|
||||
.login_main {display: block;}
|
||||
.login_main .login_config {position: static;padding:20px 20px 0 20px;text-align: right;}
|
||||
.login-form {width:100%;padding:20px 40px;}
|
||||
.login_adv {display: none;}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,10 +2,14 @@
|
|||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"types": ["node"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true
|
||||
|
|
|
|||
|
|
@ -1,5 +1,28 @@
|
|||
declare module "*.vue" {
|
||||
import { DefineComponent } from "vue";
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
// 如果使用 Vite 4+ 推荐官方类型
|
||||
interface ImportMeta {
|
||||
readonly glob: (
|
||||
pattern: string,
|
||||
options?: { eager?: boolean; import?: string, query?: string }
|
||||
) => Record<string, any>
|
||||
}
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_API_BASE: string
|
||||
readonly VITE_APP_TITLE: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
||||
declare module '@/*' {
|
||||
import { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import {defineConfig, loadEnv} from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import * as path from 'path'
|
||||
import path from 'path'
|
||||
|
||||
export default defineConfig(({mode, command}) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
|
|
@ -25,7 +25,7 @@ export default defineConfig(({mode, command}) => {
|
|||
// open: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://dev.api.eswhyf.cn',
|
||||
target: 'https://mock.apipost.net/mock/2a749651c864000/',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/api/, '')
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ export default defineConfig(({mode, command}) => {
|
|||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `@use "@/styles/variables.scss" as *;`
|
||||
// additionalData: `@use "@/styles/variables.scss" as *;`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue