v2.6.5版本更新 (#1757)

* feature:增加资源加载loading

* feature:修正sql无法落盘的问题

* fixed: 修复切换角色出现404的问题。

* 删除selectImage.vue中chooseImg下多余的console.log(url)

---------

Co-authored-by: krank <emosick@qq.com>
Co-authored-by: Qing Liang <106448173+xue-ding-e@users.noreply.github.com>
This commit is contained in:
PiexlMax(奇淼
2024-05-26 21:49:34 +08:00
committed by GitHub
parent a6a65ed9f4
commit 02fc5036d7
25 changed files with 307 additions and 315 deletions

View File

@@ -8,16 +8,93 @@
<meta content="Gin,Vue,Admin.Gin-Vue-Admin,GVA,gin-vue-admin,后台管理框架,vue后台管理框架,gin-vue-admin文档,gin-vue-admin首页,gin-vue-admin" name="keywords" />
<link rel="icon" href="favicon.ico">
<title></title>
<style>
<style>
.transition-colors{
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
</style>
body{
margin: 0;
--64f90c3645474bd5: #409eff;
}
#gva-loading-box{
position: relative;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
}
#loading-text {
position: absolute;
bottom: calc(50% - 100px);
left: 0;
width: 100%;
text-align: center;
color: #666;
font-size: 14px;
}
#loading {
position: absolute;
top: calc(50% - 20px);
left: calc(50% - 20px);
}
@keyframes loader {
0% { left: -100px }
100% { left: 110%; }
}
#box {
width: 50px;
height: 50px;
background: var(--64f90c3645474bd5);
animation: animate .5s linear infinite;
position: absolute;
top: 0;
left: 0;
border-radius: 3px;
}
@keyframes animate {
17% { border-bottom-right-radius: 3px; }
25% { transform: translateY(9px) rotate(22.5deg); }
50% {
transform: translateY(18px) scale(1,.9) rotate(45deg) ;
border-bottom-right-radius: 40px;
}
75% { transform: translateY(9px) rotate(67.5deg); }
100% { transform: translateY(0) rotate(90deg); }
}
#shadow {
width: 50px;
height: 5px;
background: #000;
opacity: 0.1;
position: absolute;
top: 59px;
left: 0;
border-radius: 50%;
animation: shadow .5s linear infinite;
}
.dark #shadow{
background: #fff;
}
@keyframes shadow {
50% {
transform: scale(1.2,1);
}
}
</style>
</head>
<body>
<div id="gva-loading-box">
<div id="loading">
<div id="shadow"></div>
<div id="box"></div>
</div>
<div id="loading-text">系统正在加载中请稍候...</div>
</div>
<div id="app"></div>
<script type="module" src="./src/main.js"></script>
</body>

View File

@@ -1,6 +1,6 @@
{
"name": "gin-vue-admin",
"version": "2.6.4",
"version": "2.6.5",
"private": true,
"scripts": {
"serve": "node openDocument.js && vite --host --mode development",

View File

@@ -187,7 +187,6 @@ const editFileNameFunc = async(row) => {
inputValue: row.name
}).then(async({ value }) => {
row.name = value
// console.log(row)
const res = await editFileName(row)
if (res.code === 0) {
ElMessage({
@@ -216,7 +215,6 @@ const listObj = {
}
const chooseImg = (url) => {
console.log(url)
if (props.fileType) {
const typeSuccess = listObj[props.fileType].some(item => {
if (url.includes(item)) {

View File

@@ -20,7 +20,7 @@ export const viteLogo = (env) => {
)
console.log(
chalk.green(
`> 当前版本:v2.6.4`
`> 当前版本:v2.6.5`
)
)
console.log(

View File

@@ -10,7 +10,7 @@ export default {
register(app)
console.log(`
欢迎使用 Gin-Vue-Admin
当前版本:v2.6.4
当前版本:v2.6.5
加群方式:微信shouzi_1994 QQ群622360840
项目地址https://github.com/flipped-aurora/gin-vue-admin
插件市场:https://plugin.gin-vue-admin.com

View File

@@ -18,27 +18,14 @@ import App from './App.vue'
import { initDom } from './utils/positionToCode'
initDom()
/**
* @description 导入加载进度条,防止首屏加载时间过长,用户等待
*
* */
import Nprogress from 'nprogress'
import 'nprogress/nprogress.css'
Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 })
Nprogress.start()
/**
* 无需在这块结束,会在路由中间件中结束此块内容
* */
const app = createApp(App)
app.config.productionTip = false
app
.use(run)
.use(store)
.use(auth)
.use(router)
.mount('#app')
.use(run)
.use(store)
.use(auth)
.use(router)
.mount('#app')
export default app

View File

@@ -3,6 +3,8 @@ import { useRouterStore } from '@/pinia/modules/router'
import getPageTitle from '@/utils/page'
import router from '@/router'
import Nprogress from 'nprogress'
import 'nprogress/nprogress.css'
Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 })
const whiteList = ['Login', 'Init']
@@ -75,6 +77,11 @@ router.beforeEach(async(to, from) => {
} else {
// 不在白名单中并且已经登录的时候
if (token) {
console.log(sessionStorage.getItem("needCloseAll"))
if(sessionStorage.getItem("needToHome") === 'true') {
sessionStorage.removeItem("needToHome")
return { path: '/'}
}
// 添加flag防止多次获取动态路由和栈溢出
if (!routerStore.asyncRouterFlag && whiteList.indexOf(from.name) < 0) {
await getRouter(userStore)
@@ -110,13 +117,23 @@ router.beforeEach(async(to, from) => {
}
})
const removeLoading = () => {
const element = document.getElementById('gva-loading-box');
if (element) {
element.remove();
}
}
router.afterEach(() => {
// 路由加载完成后关闭进度条
document.getElementsByClassName('main-cont main-right')[0]?.scrollTo(0, 0)
removeLoading()
Nprogress.done()
})
router.onError(() => {
// 路由发生错误后销毁进度条
removeLoading()
Nprogress.remove()
})

View File

@@ -5,8 +5,8 @@
<template>
<div>
<el-table :data="tableData" stripe style="width: 100%" @row-click="toPath">
<el-table-column prop="ranking" label="排名" width="80" align="center"/>
<el-table :data="tableData" stripe style="width: 100%">
<el-table-column prop="ranking" label="排名" width="80" align="center" />
<el-table-column prop="title" label="插件标题" show-overflow-tooltip>
<template #default="{ row }">
<a class="text-active" :href="row.link" target="_blank">{{ row.title }}</a>

View File

@@ -123,6 +123,7 @@ const changeUserAuth = async (id) => {
});
if (res.code === 0) {
window.sessionStorage.setItem("needCloseAll", "true");
window.sessionStorage.setItem("needToHome", "true");
window.location.reload();
}
};

View File

@@ -293,18 +293,7 @@
</template>
<el-checkbox v-model="form.autoCreateMenuToSql" />
</el-form-item>
<el-form-item>
<template #label>
<el-tooltip
content="注自动迁移生成的文件到yaml配置的对应位置"
placement="bottom"
effect="light"
>
<div> 自动移动文件 <el-icon><QuestionFilled /></el-icon></div>
</el-tooltip>
</template>
<el-checkbox v-model="form.autoMoveFile" />
</el-form-item>
</div>
</el-form>
</div>
@@ -758,7 +747,6 @@ const form = ref({
businessDB: '',
autoCreateApiToSql: true,
autoCreateMenuToSql: true,
autoMoveFile: true,
gvaModel: true,
autoCreateResource: false,
fields: []
@@ -935,38 +923,12 @@ const enterForm = async(isPreview) => {
if (data.headers?.success === 'false') {
return
}
if (form.value.autoMoveFile) {
ElMessage({
type: 'success',
message: '自动化代码创建成功,自动移动成功'
})
return
}
ElMessage({
type: 'success',
message: '自动化代码创建成功,正在下载'
})
const blob = new Blob([data])
const fileName = 'ginvueadmin.zip'
if ('download' in document.createElement('a')) {
// 不是IE浏览器
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
} else {
// IE 10+
window.navigator.msSaveBlob(blob, fileName)
}
clearCatch()
}
} else {
return false
}
})
}
@@ -1007,7 +969,6 @@ const getColumnFunc = async() => {
form.value.abbreviation = tbHump
form.value.description = tbHump + '表'
form.value.autoCreateApiToSql = true
form.value.autoMoveFile = true
form.value.fields = []
res.data.columns &&
res.data.columns.forEach(item => {
@@ -1120,7 +1081,6 @@ const clearCatch = async () => {
businessDB: '',
autoCreateApiToSql: true,
autoCreateMenuToSql: true,
autoMoveFile: true,
gvaModel: true,
autoCreateResource: false,
fields: []