开发助手

This commit is contained in:
huangyp 2025-02-14 10:03:04 +08:00
parent 9e8fa86a10
commit 90e2fc1a2c
26 changed files with 163 additions and 142 deletions

View File

@ -1,5 +1,5 @@
server:
port: 80
port: 8080
spring:
application:
name: dev-assistant-service

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="./logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>开发助手</title>
<script type="module" crossorigin src="./assets/index-km1bwIfZ.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-F-bWWWv-.css">
<script type="module" crossorigin src="./assets/index-CC8MRe_6.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BfmNLccx.css">
</head>
<body>
<div id="app"></div>

View File

@ -1,5 +1,4 @@
import http from '~/axios/index.js';
export const getFileListApi = data => http.post("/file/getFileList", data)
export const delFileApi = data => http.post("/file/delFile", data)
export const downloadFileApi = data => http.post("/note/downloadFile", data)
export const delFileApi = data => http.post("/file/delFile", data)

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4826982 */
src: url('iconfont.woff2?t=1739426535222') format('woff2'),
url('iconfont.woff?t=1739426535222') format('woff'),
url('iconfont.ttf?t=1739426535222') format('truetype');
src: url('iconfont.woff2?t=1739497390636') format('woff2'),
url('iconfont.woff?t=1739497390636') format('woff'),
url('iconfont.ttf?t=1739497390636') format('truetype');
}
.iconfont {
@ -13,87 +13,91 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-weizhiwenjian:before {
content: "\e83b";
}
.icon-exe:before {
content: "\e666";
}
.icon-image:before {
content: "\e667";
}
.icon-zip:before {
content: "\e66e";
.icon-svg:before {
content: "\e670";
}
.icon-xml:before {
content: "\e66f";
content: "\e6a0";
}
.icon-html:before {
content: "\e7c4";
}
.icon-mp4:before {
content: "\e883";
}
.icon-wav:before {
content: "\e87f";
}
.icon-mp3:before {
content: "\e63a";
}
.icon-json:before {
content: "\e8b8";
}
.icon-java:before {
content: "\e7eb";
}
.icon-txt:before {
content: "\e7b5";
}
.icon-log:before {
content: "\e803";
content: "\e633";
}
.icon-HTML:before {
content: "\e612";
.icon-png:before {
content: "\e730";
}
.icon-CSS:before {
content: "\e613";
.icon-jpg:before {
content: "\e731";
}
.icon-MP:before {
content: "\e614";
.icon-pdf:before {
content: "\e733";
}
.icon-CSV:before {
content: "\e615";
.icon-zip:before {
content: "\e736";
}
.icon-JSON:before {
content: "\e616";
.icon-csv:before {
content: "\e605";
}
.icon-JS:before {
content: "\e617";
.icon-exe:before {
content: "\e606";
}
.icon-JAR:before {
content: "\e618";
.icon-pptx:before {
content: "\e608";
}
.icon-PDF:before {
content: "\e619";
.icon-docx:before {
content: "\e607";
}
.icon-TXT:before {
content: "\e61a";
.icon-xlsx:before {
content: "\e60a";
}
.icon-XLS:before {
content: "\e61b";
.icon-unknown:before {
content: "\e73d";
}
.icon-DOC:before {
content: "\e61d";
.icon-sql:before {
content: "\e60b";
}
.icon-PPT:before {
content: "\e61f";
}
.icon-GIF:before {
content: "\e620";
}
.icon-HTML1:before {
content: "\e621";
}
.icon-SQL:before {
content: "\e622";
.icon-jar:before {
content: "\e639";
}

File diff suppressed because one or more lines are too long

View File

@ -26,12 +26,6 @@ http.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (error.response.status === 401) {
ElNotification({
title: '请重新登陆',
message: '请重新登陆',
position: 'top-right',
type: 'error',
})
router.push({path: '/login'})
} else if (error.response.status === 403) {
let content = error.response.data.message

View File

@ -92,70 +92,78 @@ const getFileList = () => {
const icons = [
{
type: ['.html', '.htm'],
icon: 'icon-HTML'
icon: 'icon-html'
},
{
type: ['.css'],
icon: 'icon-CSS'
type: ['.mp4'],
icon: 'icon-mp4'
},
{
type: ['.mp3'],
icon: 'icon-MP'
icon: 'icon-mp3'
},
{
type: ['.wav'],
icon: 'icon-wav'
},
{
type: ['.csv'],
icon: 'icon-CSV'
icon: 'icon-csv'
},
{
type: ['.json'],
icon: 'icon-JSON'
},
{
type: ['.js'],
icon: 'icon-JS'
icon: 'icon-json'
},
{
type: ['.jar'],
icon: 'icon-JAR'
icon: 'icon-jar'
},
{
type: ['.pdf'],
icon: 'icon-PDF'
icon: 'icon-pdf'
},
{
type: ['.txt'],
icon: 'icon-TXT'
icon: 'icon-txt'
},
{
type: ['.xls', '.xlsx'],
icon: 'icon-XLS'
icon: 'icon-xlsx'
},
{
type: ['.doc', '.docx'],
icon: 'icon-DOC'
icon: 'icon-docx'
},
{
type: ['.ppt', '.pptx'],
icon: 'icon-PPT'
},
{
type: ['.gif'],
icon: 'icon-GIF'
icon: 'icon-pptx'
},
{
type: ['.sql'],
icon: 'icon-SQL'
icon: 'icon-sql'
},
{
type: ['.exe'],
icon: 'icon-exe'
},
{
type: ['.png', '.jpg', '.jpeg'],
icon: 'icon-image'
type: ['.jpg', '.jpeg'],
icon: 'icon-jpg'
},
{
type: ['.zip', '.rar', '.7z'],
type: ['.svg'],
icon: 'icon-svg'
},
{
type: ['.xml'],
icon: 'icon-xml'
},
{
type: ['.png'],
icon: 'icon-png'
},
{
type: ['.zip', '.rar', '.7z', '.tar', '.gz'],
icon: 'icon-zip'
},
{
@ -165,6 +173,10 @@ const icons = [
{
type: ['.log'],
icon: 'icon-log'
},
{
type: ['.java'],
icon: 'icon-java'
}
]
@ -184,7 +196,7 @@ const getIcon = (file) => {
return icons[i].icon
}
}
return 'icon-weizhiwenjian'
return 'icon-unknown'
}
const fileUploadSuccess = () => {
@ -254,10 +266,10 @@ onMounted(() => {
<el-icon>
<Timer/>
</el-icon>
{{ note.updateTime }}
{{ note.updateTime.substring(5) }}
</el-text>
</div>
<div>
<div style="min-width: 110px;">
<el-button size="small" type="primary" @click="updateNote(note)" plain>修改</el-button>
<el-popconfirm title="确认删除吗?" @confirm="delNote(note)">
<template #reference>
@ -296,7 +308,7 @@ onMounted(() => {
<el-divider style="margin-bottom: 8px;margin-top: 10px"></el-divider>
<el-scrollbar height="calc(100vh - 280px)" style="width: 100%">
<el-row>
<el-col class="note-col" v-for="file in files" :span="12">
<el-col class="file-col" v-for="file in files" :span="12" :lg="{span:12}" :md="{span:24}" :sm="{span:24}" :xs="{span:24}">
<el-card>
<div style="display: flex;justify-content: start">
<div>
@ -310,7 +322,7 @@ onMounted(() => {
{{ file.fileName }}
</el-text>
</div>
<div style="margin-top: 5px">
<div style="margin-top: 4px">
<el-text type="info">
<el-icon>
<Coin/>
@ -318,7 +330,7 @@ onMounted(() => {
{{ formatFileSize(file.fileSize) }}
</el-text>
</div>
<div style="margin-top: 5px">
<div style="margin-top: 4px">
<el-text type="info">
<el-icon>
<User/>
@ -332,13 +344,10 @@ onMounted(() => {
<div style="display: flex;justify-content: space-between">
<div>
<el-text type="info">
<el-icon>
<Timer/>
</el-icon>
{{ file.uploadTime }}
{{ file.uploadTime.substring(5) }}
</el-text>
</div>
<div>
<div style="min-width: 110px;">
<el-button size="small" type="primary" @click="downFile(file)" plain>下载</el-button>
<el-popconfirm title="确认删除吗?" @confirm="delFile(file)">
<template #reference>
@ -367,7 +376,11 @@ onMounted(() => {
<style scoped>
.note-col {
padding: 10px;
padding: 10px 5px;
width: 100%;
}
.file-col {
padding: 10px 5px;
width: 100%;
}
@ -375,6 +388,10 @@ onMounted(() => {
padding: 12px 16px;
}
:deep(.el-card__body) {
padding: 15px;
}
:deep(.el-upload-dragger) {
padding: 16px 20px;
background-color: rgba(0, 0, 0, 0);

View File

@ -52,7 +52,7 @@ const login = async (loginFormRef) => {
<el-form ref="loginFormRef" :model="loginForm" :rules="loginFormRules" class="login-form">
<el-form-item prop="password">
<el-input v-model="loginForm.password" autocomplete="new-password" clearable type="password" size="large"
placeholder="请输入口令"></el-input>
placeholder="请输入口令" @keyup.enter="login(loginFormRef)"></el-input>
</el-form-item>
<el-button type="primary" size="large" @click="login(loginFormRef)" style="width: 100%">
登录

View File

@ -16,10 +16,17 @@ export default defineConfig({
}, server: {
host: '127.0.0.1', port: 80,
proxy: {
'/api': {
'/file': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
},
'/authentication': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
},
'/note': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},