整理代码 可部署

This commit is contained in:
p71924506 2022-07-21 17:47:40 +08:00
parent d86dbc6f30
commit f1314cf5c5
6 changed files with 115 additions and 91 deletions

View File

@ -10,7 +10,7 @@ export const fetchData = query => {
export const nicadCheckDo = (data) => {
return request({
url: '/api/nicad/check',
url: '/api2/nicad/check',
method: 'post',
data:data
});

View File

@ -45,81 +45,81 @@ export default {
index: "/nicad",
title: "Nicad代码重复度检测工具",
},
{
icon: "el-icon-lx-home",
index: "/dashboard",
title: "系统首页",
},
{
icon: "el-icon-lx-cascades",
index: "/table",
title: "基础表格",
},
{
icon: "el-icon-lx-copy",
index: "/tabs",
title: "tab选项卡",
},
{
icon: "el-icon-lx-calendar",
index: "3",
title: "表单相关",
subs: [
{
index: "/form",
title: "基本表单",
},
{
index: "/upload",
title: "文件上传",
},
{
index: "4",
title: "三级菜单",
subs: [
{
index: "/editor",
title: "富文本编辑器",
},
],
},
],
},
{
icon: "el-icon-lx-emoji",
index: "/icon",
title: "自定义图标",
},
{
icon: "el-icon-pie-chart",
index: "/charts",
title: "schart图表",
},
{
icon: "el-icon-lx-global",
index: "/i18n",
title: "国际化功能",
},
{
icon: "el-icon-lx-warn",
index: "7",
title: "错误处理",
subs: [
{
index: "/permission",
title: "权限测试",
},
{
index: "/404",
title: "404页面",
},
],
},
{
icon: "el-icon-lx-redpacket_fill",
index: "/donate",
title: "支持作者",
},
// {
// icon: "el-icon-lx-home",
// index: "/dashboard",
// title: "",
// },
// {
// icon: "el-icon-lx-cascades",
// index: "/table",
// title: "",
// },
// {
// icon: "el-icon-lx-copy",
// index: "/tabs",
// title: "tab",
// },
// {
// icon: "el-icon-lx-calendar",
// index: "3",
// title: "",
// subs: [
// {
// index: "/form",
// title: "",
// },
// {
// index: "/upload",
// title: "",
// },
// {
// index: "4",
// title: "",
// subs: [
// {
// index: "/editor",
// title: "",
// },
// ],
// },
// ],
// },
// {
// icon: "el-icon-lx-emoji",
// index: "/icon",
// title: "",
// },
// {
// icon: "el-icon-pie-chart",
// index: "/charts",
// title: "schart",
// },
// {
// icon: "el-icon-lx-global",
// index: "/i18n",
// title: "",
// },
// {
// icon: "el-icon-lx-warn",
// index: "7",
// title: "",
// subs: [
// {
// index: "/permission",
// title: "",
// },
// {
// index: "/404",
// title: "404",
// },
// ],
// },
// {
// icon: "el-icon-lx-redpacket_fill",
// index: "/donate",
// title: "",
// },
];
const route = useRoute();

View File

@ -37,16 +37,21 @@
</el-select>
<el-upload class="upload-demo"
drag
action="/api/upload/renameFiles"
action="/api2/upload/renameFiles"
multiple
accept=".zip"
:data="fileData"
:on-success="uploadSuccess"
>
:limit="1"
:on-exceed="handleExceed"
:before-upload="onBeforeUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
<div slot="tip" class="import-apply-tip">请上传zip压缩包</div>
</el-upload>
@ -93,6 +98,7 @@ export default {
{
value: 'JavaScript',
label: 'JavaScript',
disabled:true
},
]
@ -156,6 +162,29 @@ export default {
dialogVisible.value = true
}
//
function handleExceed(){
this.$message.warning("限制上传一个文件");
}
//
function onBeforeUpload(file){
const isIMAGE = file.type === "zip";
const isLt20M = file.size / 1024 / 1024 < 120;
if (!isIMAGE) {
this.$message.error("上传文件只能zip压缩包格式!");
}
if (!isLt20M) {
this.$message.error("上传文件大小不能超过 120MB!");
}
// false
return isIMAGE && isLt20M;
}
return {
//
@ -173,7 +202,9 @@ export default {
checkStatus,
reportHtml,
dialogVisible,
openDialog
openDialog,
handleExceed,
onBeforeUpload
};
},
};

View File

@ -4,20 +4,13 @@ import Home from "../views/Home.vue";
const routes = [
{
path: '/',
redirect: '/dashboard'
redirect: '/nicad'
}, {
path: "/",
name: "Home",
component: Home,
children: [
{
path: "/nicadResult",
name: "nicadResult",
meta: {
title: 'Nicad检测结果'
},
component: () => import ( /* webpackChunkName: "dashboard" */ "../page/nicadResult.vue")
},
{
path: "/nicad",
name: "nicad",

View File

@ -4,7 +4,7 @@ const service = axios.create({
// process.env.NODE_ENV === 'development' 来判断是否开发环境
// easy-mock服务挂了暂时不使用了
// baseURL: 'https://www.easy-mock.com/mock/592501a391470c0ac1fab128',
timeout: 5000
timeout: 300000
});
service.interceptors.request.use(

View File

@ -11,9 +11,9 @@ export default {
'/api': {
target: 'http://114.116.228.69:8011',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
rewrite: (path) => path.replace(/^\/api2/, ''),
// rewrite: (path) => path.replace(/^/api, '')
timeout: 300000
},
}
}