"重构项目基础架构与功能模块"
7
.env.development
Normal file
@ -0,0 +1,7 @@
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# VITE_APP_BASE_URL = 'http://127.0.0.1:7777'
|
||||
VITE_APP_BASE_URL = 'https://www.hxyouzi.com'
|
||||
|
5
.env.production
Normal file
@ -0,0 +1,5 @@
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
VITE_APP_ENV = 'production'
|
||||
|
||||
VITE_APP_BASE_URL = 'https://www.hxyouzi.com'
|
2
.gitignore
vendored
@ -26,5 +26,3 @@ coverage
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
|
35
README.md
@ -1,29 +1,18 @@
|
||||
# youzi
|
||||
# 个人练手
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
## 主要功能 -- 全部重构
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||
### × 1.登录注册功能
|
||||
### × 2.首页展示导航快捷入口
|
||||
### × 3.画廊页面展示共享图片
|
||||
### × 4.文章详情页展示文章内容
|
||||
### × 5.导航功能整改,前后端
|
||||
### × 6.友链--重新开发,力求精简
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vite.dev/config/).
|
||||
### × 7.控制台功能 --目前已完成:画廊上传共享
|
||||
### × 8.文章编辑功能
|
||||
### × 9.菜谱功能 × --目前考虑菜谱搜索功能和评论功能
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
yarn
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
yarn dev
|
||||
```
|
||||
|
||||
### Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
yarn build
|
||||
```
|
||||
### 其余功能正在考虑中
|
||||
|
@ -10,4 +10,5 @@
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
<script type="text/javascript" src="/src/util/heart.js"></script>
|
||||
</html>
|
||||
|
13
package.json
@ -9,13 +9,22 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.8.4",
|
||||
"less": "^4.3.0",
|
||||
"pinia": "^3.0.1",
|
||||
"tdesign-vue-next": "^1.11.5",
|
||||
"unplugin-auto-import": "^19.1.2",
|
||||
"unplugin-vue-components": "^28.4.1",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0"
|
||||
"vue-router": "^4.5.0",
|
||||
"vue3-cookies": "^1.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.1.3",
|
||||
"@vitejs/plugin-vue": "^5.2.3",
|
||||
"nprogress": "^0.2.0",
|
||||
"qs": "^6.14.0",
|
||||
"vite": "^6.2.4",
|
||||
"vite-plugin-vue-devtools": "^7.7.2"
|
||||
"vite-svg-loader": "^5.1.0"
|
||||
}
|
||||
}
|
||||
|
79
src/App.vue
@ -1,85 +1,12 @@
|
||||
<script setup>
|
||||
import { RouterLink, RouterView } from 'vue-router'
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
import home from './home.vue';
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header>
|
||||
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
|
||||
|
||||
<div class="wrapper">
|
||||
<HelloWorld msg="You did it!" />
|
||||
|
||||
<nav>
|
||||
<RouterLink to="/">Home</RouterLink>
|
||||
<RouterLink to="/about">About</RouterLink>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<RouterView />
|
||||
<home></home>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
header {
|
||||
line-height: 1.5;
|
||||
max-height: 100vh;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
margin: 0 auto 2rem;
|
||||
}
|
||||
|
||||
nav {
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
nav a.router-link-exact-active {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
nav a.router-link-exact-active:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
nav a {
|
||||
display: inline-block;
|
||||
padding: 0 1rem;
|
||||
border-left: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
nav a:first-of-type {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
header {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
padding-right: calc(var(--section-gap) / 2);
|
||||
}
|
||||
|
||||
.logo {
|
||||
margin: 0 2rem 0 0;
|
||||
}
|
||||
|
||||
header .wrapper {
|
||||
display: flex;
|
||||
place-items: flex-start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
nav {
|
||||
text-align: left;
|
||||
margin-left: -1rem;
|
||||
font-size: 1rem;
|
||||
|
||||
padding: 1rem 0;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
26
src/api/addr/index.js
Normal file
@ -0,0 +1,26 @@
|
||||
import request from "@/util/request";
|
||||
|
||||
//getAddressByIP
|
||||
export function getAddressByIP(params) {
|
||||
return request({
|
||||
url: "/addr/ip",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
//SendMail
|
||||
export function sendMail(data) {
|
||||
return request({
|
||||
url: "/addr/mail",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//SendMailinpass
|
||||
export function sendMailinpass(data) {
|
||||
return request({
|
||||
url: "/addr/mailinpass",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
49
src/api/art/index.js
Normal file
@ -0,0 +1,49 @@
|
||||
import request from "@/util/request";
|
||||
|
||||
//queryArt
|
||||
export function queryArt() {
|
||||
return request({
|
||||
url: "/art/q",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
//addArt
|
||||
export function addArt(data) {
|
||||
return request({
|
||||
url: "/art/add",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
// queryArtInfo
|
||||
export function queryArtInfo(id) {
|
||||
return request({
|
||||
url: "/art/getInfoById?id=" + id,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
// myArti
|
||||
export function myArti() {
|
||||
return request({
|
||||
url: "/art/myArticle",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// deleteArti
|
||||
export function deleteArti(id) {
|
||||
return request({
|
||||
url: "/art/article?id=" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// updArt
|
||||
export function updArt(data) {
|
||||
return request({
|
||||
url: "/art/article",
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
}
|
37
src/api/cookbook/index.js
Normal file
@ -0,0 +1,37 @@
|
||||
import request from '@/util/request';
|
||||
|
||||
//poetry
|
||||
export function category(params) {
|
||||
return request({
|
||||
url: '/cookbook/category',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// detail
|
||||
export function detail(params) {
|
||||
return request({
|
||||
url: '/cookbook/detail',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// list
|
||||
export function list(params) {
|
||||
return request({
|
||||
url: '/cookbook/list',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// search
|
||||
export function search(params) {
|
||||
return request({
|
||||
url: '/cookbook/search',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
56
src/api/file/index.js
Normal file
@ -0,0 +1,56 @@
|
||||
import request from "@/util/request";
|
||||
|
||||
//MyFile
|
||||
export function MyFile() {
|
||||
return request({
|
||||
url: "/file/myfile",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
//ShareFile
|
||||
export function ShareFile(params) {
|
||||
return request({
|
||||
url: "/f/sharefile",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
export function updateFile(id) {
|
||||
return request({
|
||||
url: "/file/" + id,
|
||||
method: "put",
|
||||
});
|
||||
}
|
||||
export function unUpdateFile(id) {
|
||||
return request({
|
||||
url: "/file/un/" + id,
|
||||
method: "put",
|
||||
});
|
||||
}
|
||||
export function delFile(id) {
|
||||
return request({
|
||||
url: "/file/" + id,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
export function updateName(data) {
|
||||
return request({
|
||||
url: "/file/updatename",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
export function listMusic() {
|
||||
return request({
|
||||
url: "/f/music",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadImg(data) {
|
||||
return request({
|
||||
url: "/file/upload",
|
||||
method: "post",
|
||||
data
|
||||
})
|
||||
}
|
59
src/api/mix/index.js
Normal file
@ -0,0 +1,59 @@
|
||||
import request from '@/util/request';
|
||||
|
||||
//poetry
|
||||
export function poetry() {
|
||||
return request({
|
||||
url: '/mix/poetry',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
//ipStat
|
||||
export function ipStat() {
|
||||
return request({
|
||||
url: '/mix/ip',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// menuIcon
|
||||
export function menuIcon(params) {
|
||||
return request({
|
||||
url: '/mix/icon',
|
||||
method: 'get',
|
||||
params:{url:params}
|
||||
});
|
||||
}
|
||||
|
||||
// qq2phone
|
||||
export function qq2phone(params) {
|
||||
return request({
|
||||
url: '/mix/qq',
|
||||
method: 'get',
|
||||
params:{qq:params}
|
||||
});
|
||||
}
|
||||
|
||||
// phone2qq
|
||||
export function phone2qq(params) {
|
||||
return request({
|
||||
url: '/mix/tel',
|
||||
method: 'get',
|
||||
params:{tel:params}
|
||||
});
|
||||
}
|
||||
|
||||
// hydict
|
||||
export function hydict(params) {
|
||||
return request({
|
||||
url: '/mix/dict',
|
||||
method: 'get',
|
||||
params:{word:params}
|
||||
});
|
||||
}
|
||||
// goldPrice
|
||||
export function goldPrice() {
|
||||
return request({
|
||||
url: '/why/gold',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
45
src/api/nav/index.js
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/util/request';
|
||||
|
||||
// listNav
|
||||
export function listNav(params = {}) {
|
||||
return request({
|
||||
url: '/nav/menu',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function addMenu(data) {
|
||||
return request({
|
||||
url: '/nav/menu',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// deleteMenu
|
||||
export function deleteMenu(id) {
|
||||
return request({
|
||||
url: '/nav/menu/'+id,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export function listClass(){
|
||||
return request({
|
||||
url: '/nav/class',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function addClass(data) {
|
||||
return request({
|
||||
url: '/nav/class',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
9
src/api/news/index.js
Normal file
@ -0,0 +1,9 @@
|
||||
import request from '@/util/request';
|
||||
|
||||
//listBaiduNews
|
||||
export function listBaiduNews() {
|
||||
return request({
|
||||
url: '/news/baidu',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
25
src/api/plink/index.js
Normal file
@ -0,0 +1,25 @@
|
||||
import request from '@/util/request';
|
||||
|
||||
//listPlink
|
||||
export function listPlink() {
|
||||
return request({
|
||||
url: '/plink/all',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// tagList
|
||||
export function tagList() {
|
||||
return request({
|
||||
url: '/plink/tag',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function addPlink(data){
|
||||
return request({
|
||||
url: '/plink/add',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
50
src/api/user/index.js
Normal file
@ -0,0 +1,50 @@
|
||||
import request from "@/util/request";
|
||||
|
||||
//login
|
||||
export function login(data) {
|
||||
return request({
|
||||
url: "/user/login",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//register
|
||||
export function regis(data) {
|
||||
return request({
|
||||
url: "/user/register",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//autologin
|
||||
export function alogin() {
|
||||
return request({
|
||||
url: "/info/autologin",
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
//rexpass
|
||||
export function rexpass(data) {
|
||||
return request({
|
||||
url: "/user/respass",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//updatepass
|
||||
export function updatepass(data) {
|
||||
return request({
|
||||
url: "/user/updatepass",
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//updatetel
|
||||
export function updatetel(data) {
|
||||
return request({
|
||||
url: "/info/update/tel",
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
}
|
40
src/api/wea/index.js
Normal file
@ -0,0 +1,40 @@
|
||||
import request from '@/util/request';
|
||||
|
||||
//getWeather
|
||||
export function getWeather(params) {
|
||||
return request({
|
||||
url: '/wea/now',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
//getJq
|
||||
export function getJq() {
|
||||
return request({
|
||||
url: '/wea/getJq',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
//getNextHoliday
|
||||
export function getNextHoliday() {
|
||||
return request({
|
||||
url: '/wea/getNextHoliday',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
//getTodayHoliday
|
||||
export function getTodayHoliday() {
|
||||
return request({
|
||||
url: '/wea/todayHoliday',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
//iswork
|
||||
export function iswork() {
|
||||
return request({
|
||||
url: '/wea/iswork',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
/* color palette from <https://github.com/vuejs/theme> */
|
||||
:root {
|
||||
--vt-c-white: #ffffff;
|
||||
--vt-c-white-soft: #f8f8f8;
|
||||
--vt-c-white-mute: #f2f2f2;
|
||||
|
||||
--vt-c-black: #181818;
|
||||
--vt-c-black-soft: #222222;
|
||||
--vt-c-black-mute: #282828;
|
||||
|
||||
--vt-c-indigo: #2c3e50;
|
||||
|
||||
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
|
||||
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
|
||||
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
|
||||
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
|
||||
|
||||
--vt-c-text-light-1: var(--vt-c-indigo);
|
||||
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
|
||||
--vt-c-text-dark-1: var(--vt-c-white);
|
||||
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
|
||||
}
|
||||
|
||||
/* semantic color variables for this project */
|
||||
:root {
|
||||
--color-background: var(--vt-c-white);
|
||||
--color-background-soft: var(--vt-c-white-soft);
|
||||
--color-background-mute: var(--vt-c-white-mute);
|
||||
|
||||
--color-border: var(--vt-c-divider-light-2);
|
||||
--color-border-hover: var(--vt-c-divider-light-1);
|
||||
|
||||
--color-heading: var(--vt-c-text-light-1);
|
||||
--color-text: var(--vt-c-text-light-1);
|
||||
|
||||
--section-gap: 160px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--color-background: var(--vt-c-black);
|
||||
--color-background-soft: var(--vt-c-black-soft);
|
||||
--color-background-mute: var(--vt-c-black-mute);
|
||||
|
||||
--color-border: var(--vt-c-divider-dark-2);
|
||||
--color-border-hover: var(--vt-c-divider-dark-1);
|
||||
|
||||
--color-heading: var(--vt-c-text-dark-1);
|
||||
--color-text: var(--vt-c-text-dark-2);
|
||||
}
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
color: var(--color-text);
|
||||
background: var(--color-background);
|
||||
transition:
|
||||
color 0.5s,
|
||||
background-color 0.5s;
|
||||
line-height: 1.6;
|
||||
font-family:
|
||||
Inter,
|
||||
-apple-system,
|
||||
BlinkMacSystemFont,
|
||||
'Segoe UI',
|
||||
Roboto,
|
||||
Oxygen,
|
||||
Ubuntu,
|
||||
Cantarell,
|
||||
'Fira Sans',
|
||||
'Droid Sans',
|
||||
'Helvetica Neue',
|
||||
sans-serif;
|
||||
font-size: 15px;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
4
src/assets/base.less
Normal file
@ -0,0 +1,4 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
|
||||
@primary: #0070f3;
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
Before Width: | Height: | Size: 276 B |
@ -1,35 +0,0 @@
|
||||
@import './base.css';
|
||||
|
||||
#app {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a,
|
||||
.green {
|
||||
text-decoration: none;
|
||||
color: hsla(160, 100%, 37%, 1);
|
||||
transition: 0.4s;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
a:hover {
|
||||
background-color: hsla(160, 100%, 37%, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
body {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
padding: 0 2rem;
|
||||
}
|
||||
}
|
1
src/assets/main.less
Normal file
@ -0,0 +1 @@
|
||||
@import './base.less';
|
@ -1,44 +0,0 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
msg: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="greetings">
|
||||
<h1 class="green">{{ msg }}</h1>
|
||||
<h3>
|
||||
You’ve successfully created a project with
|
||||
<a href="https://vite.dev/" target="_blank" rel="noopener">Vite</a> +
|
||||
<a href="https://vuejs.org/" target="_blank" rel="noopener">Vue 3</a>.
|
||||
</h3>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
h1 {
|
||||
font-weight: 500;
|
||||
font-size: 2.6rem;
|
||||
position: relative;
|
||||
top: -10px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.greetings h1,
|
||||
.greetings h3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.greetings h1,
|
||||
.greetings h3 {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,94 +0,0 @@
|
||||
<script setup>
|
||||
import WelcomeItem from './WelcomeItem.vue'
|
||||
import DocumentationIcon from './icons/IconDocumentation.vue'
|
||||
import ToolingIcon from './icons/IconTooling.vue'
|
||||
import EcosystemIcon from './icons/IconEcosystem.vue'
|
||||
import CommunityIcon from './icons/IconCommunity.vue'
|
||||
import SupportIcon from './icons/IconSupport.vue'
|
||||
|
||||
const openReadmeInEditor = () => fetch('/__open-in-editor?file=README.md')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<DocumentationIcon />
|
||||
</template>
|
||||
<template #heading>Documentation</template>
|
||||
|
||||
Vue’s
|
||||
<a href="https://vuejs.org/" target="_blank" rel="noopener">official documentation</a>
|
||||
provides you with all information you need to get started.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<ToolingIcon />
|
||||
</template>
|
||||
<template #heading>Tooling</template>
|
||||
|
||||
This project is served and bundled with
|
||||
<a href="https://vite.dev/guide/features.html" target="_blank" rel="noopener">Vite</a>. The
|
||||
recommended IDE setup is
|
||||
<a href="https://code.visualstudio.com/" target="_blank" rel="noopener">VSCode</a>
|
||||
+
|
||||
<a href="https://github.com/vuejs/language-tools" target="_blank" rel="noopener">Vue - Official</a>. If
|
||||
you need to test your components and web pages, check out
|
||||
<a href="https://vitest.dev/" target="_blank" rel="noopener">Vitest</a>
|
||||
and
|
||||
<a href="https://www.cypress.io/" target="_blank" rel="noopener">Cypress</a>
|
||||
/
|
||||
<a href="https://playwright.dev/" target="_blank" rel="noopener">Playwright</a>.
|
||||
|
||||
<br />
|
||||
|
||||
More instructions are available in
|
||||
<a href="javascript:void(0)" @click="openReadmeInEditor"><code>README.md</code></a
|
||||
>.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<EcosystemIcon />
|
||||
</template>
|
||||
<template #heading>Ecosystem</template>
|
||||
|
||||
Get official tools and libraries for your project:
|
||||
<a href="https://pinia.vuejs.org/" target="_blank" rel="noopener">Pinia</a>,
|
||||
<a href="https://router.vuejs.org/" target="_blank" rel="noopener">Vue Router</a>,
|
||||
<a href="https://test-utils.vuejs.org/" target="_blank" rel="noopener">Vue Test Utils</a>, and
|
||||
<a href="https://github.com/vuejs/devtools" target="_blank" rel="noopener">Vue Dev Tools</a>. If
|
||||
you need more resources, we suggest paying
|
||||
<a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">Awesome Vue</a>
|
||||
a visit.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<CommunityIcon />
|
||||
</template>
|
||||
<template #heading>Community</template>
|
||||
|
||||
Got stuck? Ask your question on
|
||||
<a href="https://chat.vuejs.org" target="_blank" rel="noopener">Vue Land</a>
|
||||
(our official Discord server), or
|
||||
<a href="https://stackoverflow.com/questions/tagged/vue.js" target="_blank" rel="noopener"
|
||||
>StackOverflow</a
|
||||
>. You should also follow the official
|
||||
<a href="https://bsky.app/profile/vuejs.org" target="_blank" rel="noopener">@vuejs.org</a>
|
||||
Bluesky account or the
|
||||
<a href="https://x.com/vuejs" target="_blank" rel="noopener">@vuejs</a>
|
||||
X account for latest news in the Vue world.
|
||||
</WelcomeItem>
|
||||
|
||||
<WelcomeItem>
|
||||
<template #icon>
|
||||
<SupportIcon />
|
||||
</template>
|
||||
<template #heading>Support Vue</template>
|
||||
|
||||
As an independent project, Vue relies on community backing for its sustainability. You can help
|
||||
us by
|
||||
<a href="https://vuejs.org/sponsor/" target="_blank" rel="noopener">becoming a sponsor</a>.
|
||||
</WelcomeItem>
|
||||
</template>
|
@ -1,86 +0,0 @@
|
||||
<template>
|
||||
<div class="item">
|
||||
<i>
|
||||
<slot name="icon"></slot>
|
||||
</i>
|
||||
<div class="details">
|
||||
<h3>
|
||||
<slot name="heading"></slot>
|
||||
</h3>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.item {
|
||||
margin-top: 2rem;
|
||||
display: flex;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.details {
|
||||
flex: 1;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
i {
|
||||
display: flex;
|
||||
place-items: center;
|
||||
place-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 500;
|
||||
margin-bottom: 0.4rem;
|
||||
color: var(--color-heading);
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.item {
|
||||
margin-top: 0;
|
||||
padding: 0.4rem 0 1rem calc(var(--section-gap) / 2);
|
||||
}
|
||||
|
||||
i {
|
||||
top: calc(50% - 25px);
|
||||
left: -26px;
|
||||
position: absolute;
|
||||
border: 1px solid var(--color-border);
|
||||
background: var(--color-background);
|
||||
border-radius: 8px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
.item:before {
|
||||
content: ' ';
|
||||
border-left: 1px solid var(--color-border);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: calc(50% + 25px);
|
||||
height: calc(50% - 25px);
|
||||
}
|
||||
|
||||
.item:after {
|
||||
content: ' ';
|
||||
border-left: 1px solid var(--color-border);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: calc(50% + 25px);
|
||||
height: calc(50% - 25px);
|
||||
}
|
||||
|
||||
.item:first-of-type:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.item:last-of-type:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,7 +0,0 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
|
||||
<path
|
||||
d="M15 4a1 1 0 1 0 0 2V4zm0 11v-1a1 1 0 0 0-1 1h1zm0 4l-.707.707A1 1 0 0 0 16 19h-1zm-4-4l.707-.707A1 1 0 0 0 11 14v1zm-4.707-1.293a1 1 0 0 0-1.414 1.414l1.414-1.414zm-.707.707l-.707-.707.707.707zM9 11v-1a1 1 0 0 0-.707.293L9 11zm-4 0h1a1 1 0 0 0-1-1v1zm0 4H4a1 1 0 0 0 1.707.707L5 15zm10-9h2V4h-2v2zm2 0a1 1 0 0 1 1 1h2a3 3 0 0 0-3-3v2zm1 1v6h2V7h-2zm0 6a1 1 0 0 1-1 1v2a3 3 0 0 0 3-3h-2zm-1 1h-2v2h2v-2zm-3 1v4h2v-4h-2zm1.707 3.293l-4-4-1.414 1.414 4 4 1.414-1.414zM11 14H7v2h4v-2zm-4 0c-.276 0-.525-.111-.707-.293l-1.414 1.414C5.42 15.663 6.172 16 7 16v-2zm-.707 1.121l3.414-3.414-1.414-1.414-3.414 3.414 1.414 1.414zM9 12h4v-2H9v2zm4 0a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2zm3-3V3h-2v6h2zm0-6a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2zm-3-3H3v2h10V0zM3 0a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1V0zM0 3v6h2V3H0zm0 6a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1H0zm3 3h2v-2H3v2zm1-1v4h2v-4H4zm1.707 4.707l.586-.586-1.414-1.414-.586.586 1.414 1.414z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
@ -1,7 +0,0 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" fill="currentColor">
|
||||
<path
|
||||
d="M11 2.253a1 1 0 1 0-2 0h2zm-2 13a1 1 0 1 0 2 0H9zm.447-12.167a1 1 0 1 0 1.107-1.666L9.447 3.086zM1 2.253L.447 1.42A1 1 0 0 0 0 2.253h1zm0 13H0a1 1 0 0 0 1.553.833L1 15.253zm8.447.833a1 1 0 1 0 1.107-1.666l-1.107 1.666zm0-14.666a1 1 0 1 0 1.107 1.666L9.447 1.42zM19 2.253h1a1 1 0 0 0-.447-.833L19 2.253zm0 13l-.553.833A1 1 0 0 0 20 15.253h-1zm-9.553-.833a1 1 0 1 0 1.107 1.666L9.447 14.42zM9 2.253v13h2v-13H9zm1.553-.833C9.203.523 7.42 0 5.5 0v2c1.572 0 2.961.431 3.947 1.086l1.107-1.666zM5.5 0C3.58 0 1.797.523.447 1.42l1.107 1.666C2.539 2.431 3.928 2 5.5 2V0zM0 2.253v13h2v-13H0zm1.553 13.833C2.539 15.431 3.928 15 5.5 15v-2c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM5.5 15c1.572 0 2.961.431 3.947 1.086l1.107-1.666C9.203 13.523 7.42 13 5.5 13v2zm5.053-11.914C11.539 2.431 12.928 2 14.5 2V0c-1.92 0-3.703.523-5.053 1.42l1.107 1.666zM14.5 2c1.573 0 2.961.431 3.947 1.086l1.107-1.666C18.203.523 16.421 0 14.5 0v2zm3.5.253v13h2v-13h-2zm1.553 12.167C18.203 13.523 16.421 13 14.5 13v2c1.573 0 2.961.431 3.947 1.086l1.107-1.666zM14.5 13c-1.92 0-3.703.523-5.053 1.42l1.107 1.666C11.539 15.431 12.928 15 14.5 15v-2z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
@ -1,7 +0,0 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" fill="currentColor">
|
||||
<path
|
||||
d="M11.447 8.894a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm0 1.789a1 1 0 1 0 .894-1.789l-.894 1.789zM7.447 7.106a1 1 0 1 0-.894 1.789l.894-1.789zM10 9a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0H8zm9.447-5.606a1 1 0 1 0-.894-1.789l.894 1.789zm-2.894-.789a1 1 0 1 0 .894 1.789l-.894-1.789zm2 .789a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zM18 5a1 1 0 1 0-2 0h2zm-2 2.5a1 1 0 1 0 2 0h-2zm-5.447-4.606a1 1 0 1 0 .894-1.789l-.894 1.789zM9 1l.447-.894a1 1 0 0 0-.894 0L9 1zm-2.447.106a1 1 0 1 0 .894 1.789l-.894-1.789zm-6 3a1 1 0 1 0 .894 1.789L.553 4.106zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zm-2-.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 2.789a1 1 0 1 0 .894-1.789l-.894 1.789zM2 5a1 1 0 1 0-2 0h2zM0 7.5a1 1 0 1 0 2 0H0zm8.553 12.394a1 1 0 1 0 .894-1.789l-.894 1.789zm-1.106-2.789a1 1 0 1 0-.894 1.789l.894-1.789zm1.106 1a1 1 0 1 0 .894 1.789l-.894-1.789zm2.894.789a1 1 0 1 0-.894-1.789l.894 1.789zM8 19a1 1 0 1 0 2 0H8zm2-2.5a1 1 0 1 0-2 0h2zm-7.447.394a1 1 0 1 0 .894-1.789l-.894 1.789zM1 15H0a1 1 0 0 0 .553.894L1 15zm1-2.5a1 1 0 1 0-2 0h2zm12.553 2.606a1 1 0 1 0 .894 1.789l-.894-1.789zM17 15l.447.894A1 1 0 0 0 18 15h-1zm1-2.5a1 1 0 1 0-2 0h2zm-7.447-5.394l-2 1 .894 1.789 2-1-.894-1.789zm-1.106 1l-2-1-.894 1.789 2 1 .894-1.789zM8 9v2.5h2V9H8zm8.553-4.894l-2 1 .894 1.789 2-1-.894-1.789zm.894 0l-2-1-.894 1.789 2 1 .894-1.789zM16 5v2.5h2V5h-2zm-4.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zm-2.894-1l-2 1 .894 1.789 2-1L8.553.106zM1.447 5.894l2-1-.894-1.789-2 1 .894 1.789zm-.894 0l2 1 .894-1.789-2-1-.894 1.789zM0 5v2.5h2V5H0zm9.447 13.106l-2-1-.894 1.789 2 1 .894-1.789zm0 1.789l2-1-.894-1.789-2 1 .894 1.789zM10 19v-2.5H8V19h2zm-6.553-3.894l-2-1-.894 1.789 2 1 .894-1.789zM2 15v-2.5H0V15h2zm13.447 1.894l2-1-.894-1.789-2 1 .894 1.789zM18 15v-2.5h-2V15h2z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
@ -1,7 +0,0 @@
|
||||
<template>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor">
|
||||
<path
|
||||
d="M10 3.22l-.61-.6a5.5 5.5 0 0 0-7.666.105 5.5 5.5 0 0 0-.114 7.665L10 18.78l8.39-8.4a5.5 5.5 0 0 0-.114-7.665 5.5 5.5 0 0 0-7.666-.105l-.61.61z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
@ -1,19 +0,0 @@
|
||||
<!-- This icon is from <https://github.com/Templarian/MaterialDesign>, distributed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0) license-->
|
||||
<template>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
aria-hidden="true"
|
||||
role="img"
|
||||
class="iconify iconify--mdi"
|
||||
width="24"
|
||||
height="24"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
d="M20 18v-4h-3v1h-2v-1H9v1H7v-1H4v4h16M6.33 8l-1.74 4H7v-1h2v1h6v-1h2v1h2.41l-1.74-4H6.33M9 5v1h6V5H9m12.84 7.61c.1.22.16.48.16.8V18c0 .53-.21 1-.6 1.41c-.4.4-.85.59-1.4.59H4c-.55 0-1-.19-1.4-.59C2.21 19 2 18.53 2 18v-4.59c0-.32.06-.58.16-.8L4.5 7.22C4.84 6.41 5.45 6 6.33 6H7V5c0-.55.18-1 .57-1.41C7.96 3.2 8.44 3 9 3h6c.56 0 1.04.2 1.43.59c.39.41.57.86.57 1.41v1h.67c.88 0 1.49.41 1.83 1.22l2.34 5.39z"
|
||||
fill="currentColor"
|
||||
></path>
|
||||
</svg>
|
||||
</template>
|
4
src/config/cookies.js
Normal file
@ -0,0 +1,4 @@
|
||||
import { useCookies } from "vue3-cookies";
|
||||
const { cookies } = useCookies();
|
||||
|
||||
export default cookies;
|
14
src/config/http.js
Normal file
@ -0,0 +1,14 @@
|
||||
const files = import.meta.glob('@/api/*/index.js', {
|
||||
eager: true,
|
||||
})
|
||||
|
||||
const http = {}
|
||||
console.log(files);
|
||||
for (const i in files) {
|
||||
const t = i.split("/")
|
||||
const name = t[t.length - 2]
|
||||
http[name] = files[i]
|
||||
}
|
||||
export default http
|
||||
|
||||
|
9
src/config/index.js
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
export function useConfig() {
|
||||
const files = import.meta.glob("./*.js", { eager: true });
|
||||
Object.keys(files).forEach((key) => {
|
||||
const name = key.replace(/(\.\/|\.js)/g, "");
|
||||
window['$' + name] = files[key].default;
|
||||
});
|
||||
}
|
||||
|
12
src/config/store.js
Normal file
@ -0,0 +1,12 @@
|
||||
const files = import.meta.glob('@/stores/*.js', {
|
||||
eager: true,
|
||||
})
|
||||
|
||||
const store = {}
|
||||
// console.log("stores封装",files);
|
||||
for (const i in files) {
|
||||
const t = i.split("/")
|
||||
const name = t[t.length - 1].split(".")[0]
|
||||
store[name] = files[i]
|
||||
}
|
||||
export default store
|
19
src/home.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
//mark import
|
||||
|
||||
//mark data
|
||||
|
||||
//mark method
|
||||
|
||||
//mark 周期、内置函数等
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
1
src/icon/article.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32"><path d="M26 30H11a2.002 2.002 0 0 1-2-2v-6h2v6h15V6h-9V4h9a2.002 2.002 0 0 1 2 2v22a2.002 2.002 0 0 1-2 2z" fill="currentColor"></path><path d="M17 10h7v2h-7z" fill="currentColor"></path><path d="M16 15h8v2h-8z" fill="currentColor"></path><path d="M15 20h9v2h-9z" fill="currentColor"></path><path d="M9 19a5.005 5.005 0 0 1-5-5V3h2v11a3 3 0 0 0 6 0V5a1 1 0 0 0-2 0v10H8V5a3 3 0 0 1 6 0v9a5.005 5.005 0 0 1-5 5z" fill="currentColor"></path></svg>
|
After Width: | Height: | Size: 549 B |
1
src/icon/back.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694156756216" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4088" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M379.616 515.648L705.44 841.472c20 20 20 52.416 0 72.416s-52.416 20-72.416 0L270.976 551.84c-20-20-20-52.416 0-72.416l362.048-362.048c20-20 52.416-20 72.416 0s20 52.416 0 72.416L379.616 515.616z" p-id="4089"></path></svg>
|
After Width: | Height: | Size: 552 B |
1
src/icon/collapse.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg t="1731026889534" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15633" id="mx_n_1731026889534" width="32" height="32"><path d="M512 1024A512 512 0 1 0 512 0a512 512 0 0 0 0 1024zM512 214.235429a54.564571 54.564571 0 1 1 0 109.202285 54.564571 54.564571 0 0 1 0-109.202285zM512 397.165714a54.564571 54.564571 0 1 1 0 109.202286 54.564571 54.564571 0 0 1 0-109.202286zM210.505143 483.474286a41.106286 41.106286 0 0 1 58.368-0.438857L512 722.870857l243.053714-239.689143a41.252571 41.252571 0 1 1 58.075429 58.806857l-272.091429 268.361143a41.252571 41.252571 0 0 1-58.002285 0l-272.091429-268.434285a41.325714 41.325714 0 0 1-0.438857-58.368z" fill="#B1C3E7" p-id="15634"></path></svg>
|
After Width: | Height: | Size: 734 B |
1
src/icon/group.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#7B1DD3" d="M822.327949 1008.51541h-620.624867a186.404679 186.404679 0 0 1-186.18746-186.187461v-620.624867a186.404679 186.404679 0 0 1 186.18746-186.18746h620.624867a186.404679 186.404679 0 0 1 186.187461 186.18746v620.624867a186.404679 186.404679 0 0 1-186.187461 186.187461zM510.960453 298.520561a84.063638 84.063638 0 0 0-57.842237 22.590745 98.679354 98.679354 0 0 0-27.090276 35.996243 158.259341 158.259341 0 0 0-10.891966 37.237492 107.399133 107.399133 0 0 0-1.365375 17.129246 123.380224 123.380224 0 0 0 13.002091 55.452832 100.944635 100.944635 0 0 0 39.719992 45.119428l-131.386285 60.883299a24.173339 24.173339 0 0 0-13.684778 23.273433v104.016728a27.400588 27.400588 0 0 0 6.206249 17.811933 18.835965 18.835965 0 0 0 15.050153 7.540593h335.94424a19.487621 19.487621 0 0 0 15.732841-7.540593 27.400588 27.400588 0 0 0 6.206248-17.811933v-104.016728a23.831995 23.831995 0 0 0-13.684778-23.273433l-91.014637-43.754053-38.975241-18.618746a100.199885 100.199885 0 0 0 39.657929-46.546865 131.479378 131.479378 0 0 0 10.954028-52.753114 158.259341 158.259341 0 0 0-3.413436-30.814024 116.615413 116.615413 0 0 0-34.134368-58.959363 84.932513 84.932513 0 0 0-58.959362-22.994151z m158.104185 41.085366a62.062487 62.062487 0 0 0-21.22537 3.72375 86.887481 86.887481 0 0 0-19.177309 9.961029 153.449498 153.449498 0 0 1 8.22328 27.928119 161.021122 161.021122 0 0 1 2.730749 30.069275 157.049123 157.049123 0 0 1-6.516561 45.491802 149.167187 149.167187 0 0 1-18.122246 39.347617 72.706203 72.706203 0 0 0 18.618746 15.763872l67.710173 32.179399a53.001364 53.001364 0 0 1 22.901058 20.852996 58.680081 58.680081 0 0 1 8.595654 31.031243v88.252856h72.520016a15.298403 15.298403 0 0 0 12.412497-5.802842 22.46662 22.46662 0 0 0 4.778812-14.739841v-83.474045a19.735871 19.735871 0 0 0-10.954029-19.177308l-104.699415-49.929271a89.152762 89.152762 0 0 0 29.44865-33.172399 99.299979 99.299979 0 0 0 11.636716-47.570896 101.81351 101.81351 0 0 0-6.206249-35.220461 93.404043 93.404043 0 0 0-16.818934-29.076275 79.408952 79.408952 0 0 0-24.824994-19.549684 68.920392 68.920392 0 0 0-31.000212-6.919967z m-314.780932 0a66.468923 66.468923 0 0 0-30.503713 7.168218 80.898451 80.898451 0 0 0-24.576744 19.549683 94.428074 94.428074 0 0 0-16.756872 29.076275 105.164884 105.164884 0 0 0 5.430468 83.474045 85.335919 85.335919 0 0 0 30.814024 33.172399l-106.002727 49.246583a17.998121 17.998121 0 0 0-10.954029 19.177308v83.474045a22.435589 22.435589 0 0 0 4.716749 14.739841 15.515622 15.515622 0 0 0 12.412497 5.802842h70.534017v-88.252856a58.959362 58.959362 0 0 1 8.533592-31.031243 52.753114 52.753114 0 0 1 23.583745-20.852996l70.471953-33.544774a68.610079 68.610079 0 0 0 15.763872-13.002091 143.240219 143.240219 0 0 1-19.115246-40.030304 154.970029 154.970029 0 0 1-6.919967-46.17449 157.576654 157.576654 0 0 1 11.698778-59.517925 101.223916 101.223916 0 0 0-18.618746-8.905967 60.572987 60.572987 0 0 0-20.48062-3.599624z" /></svg>
|
After Width: | Height: | Size: 3.1 KiB |
1
src/icon/hot.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711591952359" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3959" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M414.72 981.333s-416.427-91.52-230.4-545.92c0 0 42.667 50.56 36.48 74.88 0 0 33.067-114.773 104.533-183.253 61.44-59.093 123.734-224.64 66.347-284.373 0 0 284.8 59.733 316.587 359.04 0 0 36.48-95.36 111.146-104.747a204.587 204.587 0 0 0 0 130.987s235.947 403.84-170.666 540.373c0 0 121.813-138.453-136.534-375.893 0 0-61.013 128-97.28 171.946-0.213 0-101.973 114.134-0.213 216.96z" p-id="3960" fill="#d81e06"></path></svg>
|
After Width: | Height: | Size: 755 B |
12
src/icon/index.js
Normal file
@ -0,0 +1,12 @@
|
||||
const icons = import.meta.glob('./*.svg', {
|
||||
eager: true,
|
||||
})
|
||||
|
||||
const icon = {}
|
||||
// console.log(icons);
|
||||
for (const i in icons) {
|
||||
const t = i.split("/")
|
||||
const name = t[1].split('.')[0]
|
||||
icon[name] = icons[i]
|
||||
}
|
||||
export default icon
|
1
src/icon/lr.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><g fill="none"><path d="M14.768 15.712l1.513-1.461l-1.513-1.461a.75.75 0 1 1 1.042-1.08l1.886 1.821a1 1 0 0 1 0 1.44l-1.886 1.82a.75.75 0 0 1-1.042-1.079zm-9.534 0L3.72 14.251l1.513-1.461a.75.75 0 0 0-1.042-1.08l-1.886 1.821a1 1 0 0 0 0 1.44l1.886 1.82a.75.75 0 0 0 1.042-1.079zM8 14.252a.75.75 0 0 1-.75.75h-.5a.75.75 0 1 1 0-1.5h.5a.75.75 0 0 1 .75.75zm1.75.75a.75.75 0 1 1 0-1.5h.5a.75.75 0 0 1 0 1.5h-.5zm2.25-.75c0 .415.336.75.75.75h.5a.75.75 0 1 0 0-1.5h-.5a.75.75 0 0 0-.75.75zm5-9.252a2 2 0 0 0-2-2h-10a2 2 0 0 0-2 2v4.25a.75.75 0 0 0 1.5 0V5a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 .5.5v4.25a.75.75 0 1 0 1.5 0V5z" fill="currentColor"></path></g></svg>
|
After Width: | Height: | Size: 755 B |
1
src/icon/mail.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#7B1DD3" d="M873.472 0H150.528C67.584 0 0 67.584 0 150.528v722.944C0 956.416 67.584 1024 150.528 1024h722.944c82.944 0 150.528-67.584 150.528-150.528V150.528C1024 67.584 956.416 0 873.472 0z m-61.952 656.896c0 41.472-33.792 74.752-74.752 74.752H287.232c-41.472 0-74.752-33.28-74.752-74.752V367.104c0-41.472 33.28-74.752 74.752-74.752h449.024c41.472 0 74.752 33.28 74.752 74.752v289.792z" /><path fill="#7B1DD3" d="M712.192 427.008L512 556.032 311.808 427.008c-9.216-6.144-21.504-3.072-27.648 6.144-6.144 9.216-3.072 21.504 6.144 27.648l210.944 135.68c3.072 2.048 7.168 3.072 10.752 3.072 3.584 0 7.68-1.024 10.752-3.072L733.696 460.8a20.48 20.48 0 0 0 6.144-27.648 20.48 20.48 0 0 0-27.648-6.144z" /></svg>
|
After Width: | Height: | Size: 976 B |
1
src/icon/more.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711588832708" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6877" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M713.8 523.5c-8.9-8.9-23.2-8.6-32.1 0.3L512.1 693.6 342.7 523.7c-8.9-8.9-23.2-9.1-32.1-0.3v0.5c-8.9 8.9-8.9 23 0 31.9l185.3 185.5c0.5 0.5 1.1 1 1.7 1.5l0.1 0.1c0.5 0.4 1.1 0.8 1.7 1.2 0.1 0.1 0.2 0.1 0.2 0.2 0.5 0.4 1.1 0.7 1.7 1 0.1 0 0.2 0.1 0.3 0.1 0.6 0.3 1.2 0.6 1.8 0.8 0.1 0 0.1 0.1 0.2 0.1 0.6 0.2 1.2 0.5 1.9 0.7h0.2c0.6 0.2 1.3 0.4 2 0.5h0.1c0.7 0.1 1.4 0.2 2 0.3h0.1c0.7 0.1 1.4 0.1 2.1 0.1 0.7 0 1.4 0 2.1-0.1h0.1c0.7-0.1 1.4-0.2 2-0.3h0.1c0.7-0.1 1.3-0.3 2-0.5h0.2c0.6-0.2 1.3-0.4 1.9-0.7 0.1 0 0.1-0.1 0.2-0.1 0.6-0.2 1.2-0.5 1.8-0.8 0.1 0 0.2-0.1 0.3-0.1 0.6-0.3 1.1-0.6 1.7-1 0.1-0.1 0.2-0.1 0.2-0.2 0.6-0.4 1.1-0.8 1.7-1.2l0.1-0.1c0.6-0.5 1.1-1 1.7-1.5l185.8-185.5c8.8-8.8 8.8-23.4-0.1-32.3z m-218.3-23.1c0.5 0.5 1.1 1 1.7 1.5l0.1 0.1c0.5 0.4 1.1 0.8 1.7 1.2 0.1 0.1 0.2 0.1 0.2 0.2 0.5 0.4 1.1 0.7 1.7 1 0.1 0 0.2 0.1 0.3 0.1 0.6 0.3 1.2 0.6 1.8 0.8 0.1 0 0.1 0.1 0.2 0.1 0.6 0.2 1.2 0.5 1.9 0.7h0.2c0.6 0.2 1.3 0.4 2 0.5h0.1c0.7 0.1 1.4 0.2 2 0.3h0.1c0.7 0.1 1.4 0.1 2.1 0.1 0.7 0 1.4 0 2.1-0.1h0.1c0.7-0.1 1.4-0.2 2-0.3h0.1c0.7-0.1 1.3-0.3 2-0.5h0.2c0.6-0.2 1.3-0.4 1.9-0.7 0.1 0 0.1-0.1 0.2-0.1 0.6-0.2 1.2-0.5 1.8-0.8 0.1 0 0.2-0.1 0.3-0.1 0.6-0.3 1.1-0.6 1.7-1 0.1-0.1 0.2-0.1 0.2-0.2 0.6-0.4 1.1-0.8 1.7-1.2l0.1-0.1c0.6-0.5 1.1-1 1.7-1.5l185.8-185.5c8.9-8.9 8.9-23.5 0-32.4-8.9-8.9-23.2-8.6-32.1 0.3L511.7 452.6 342.3 282.7c-8.9-8.9-23.2-9.1-32.1-0.3v0.5c-8.9 8.9-8.9 23 0 31.9l185.3 185.6z" p-id="6878" fill="#8a2be2"></path></svg>
|
After Width: | Height: | Size: 1.7 KiB |
1
src/icon/navi.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg t="1718348760379" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1497" width="200" height="200"><path d="M409.6 661.333333l-256-119.466666 721.066667-345.6-345.6 721.066666-119.466667-256z m34.133333-34.133333l85.333334 187.733333 260.266666-537.6L256 541.866667l187.733333 85.333333z" fill="#ffffff" p-id="1498"></path></svg>
|
After Width: | Height: | Size: 376 B |
17
src/icon/orange.svg
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
<svg
|
||||
t="1652688633372"
|
||||
class="icon"
|
||||
viewBox="0 0 1024 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1737"
|
||||
width="200"
|
||||
height="200"
|
||||
>
|
||||
<path
|
||||
d="M544.768 904.192c40.96-3.412992 80.212992-12.971008 117.76-28.672s72.020992-36.864 103.424-63.488L578.56 624.64c-10.24 6.144-21.504 10.923008-33.792 14.336v265.216z m267.264-138.24c26.624-31.403008 47.787008-65.876992 63.488-103.424 15.700992-37.547008 25.259008-76.8 28.672-117.76H638.976c-3.412992 12.288-8.192 23.552-14.336 33.792l187.392 187.392z m92.16-286.72c-3.412992-40.96-12.971008-80.212992-28.672-117.76s-36.864-72.020992-63.488-103.424L624.64 445.44c6.144 10.24 10.923008 21.504 14.336 33.792h265.216zM765.952 211.968c-31.403008-26.624-65.876992-47.787008-103.424-63.488-37.547008-15.700992-76.8-25.259008-117.76-28.672v265.216c12.288 3.412992 23.552 8.192 33.792 14.336l187.392-187.392z m-286.72-92.16c-40.96 3.412992-80.212992 12.971008-117.76 28.672s-72.020992 36.864-103.424 63.488l187.392 187.392c10.24-6.144 21.504-10.923008 33.792-14.336V119.808zM211.968 258.048c-26.624 31.403008-47.787008 65.876992-63.488 103.424-15.700992 37.547008-25.259008 76.8-28.672 117.76h265.216c3.412992-12.288 8.192-23.552 14.336-33.792L211.968 258.048z m-92.16 286.72c3.412992 40.96 12.971008 80.212992 28.672 117.76s36.864 72.020992 63.488 103.424l187.392-187.392c-6.144-10.923008-10.923008-22.187008-14.336-33.792H119.808z m138.24 267.264c31.403008 26.624 65.876992 47.787008 103.424 63.488 37.547008 15.700992 76.8 25.259008 117.76 28.672V638.976c-11.604992-3.412992-22.868992-8.192-33.792-14.336L258.048 812.032z m253.952 158.72c-129.707008-3.412992-237.739008-48.299008-324.096-134.656S56.660992 641.707008 53.248 512c3.412992-129.707008 48.299008-237.739008 134.656-324.096S382.292992 56.660992 512 53.248c129.707008 3.412992 237.739008 48.299008 324.096 134.656S967.339008 382.292992 970.752 512c-3.412992 129.707008-48.299008 237.739008-134.656 324.096S641.707008 967.339008 512 970.752z m0-393.216c18.432-0.683008 33.792-7.168 46.08-19.456s18.432-27.648 18.432-46.08-6.144-33.792-18.432-46.08-27.648-18.432-46.08-18.432-33.792 6.144-46.08 18.432-18.432 27.648-18.432 46.08 6.144 33.792 18.432 46.08 27.648 18.772992 46.08 19.456z"
|
||||
p-id="1738"
|
||||
></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
1
src/icon/pic.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1024 1024"><path d="M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3l150.1 178L658.1 489L888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176a88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28s-28-12.5-28-28s12.5-28 28-28z" fill="currentColor"></path></svg>
|
After Width: | Height: | Size: 554 B |
1
src/icon/profile.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="7" r="4"></circle><path d="M3 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2"></path><path d="M16 3.13a4 4 0 0 1 0 7.75"></path><path d="M21 21v-2a4 4 0 0 0-3-3.85"></path></g></svg>
|
After Width: | Height: | Size: 396 B |
1
src/icon/qq.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#7B1DD3" d="M824.8 613.2c-16-51.4-34.4-94.6-62.7-165.3C766.5 262.2 689.3 112 511.5 112 331.7 112 256.2 265.2 261 447.9c-28.4 70.8-46.7 113.7-62.7 165.3-34 109.5-23 154.8-14.6 155.8 18 2.2 70.1-82.4 70.1-82.4 0 49 25.2 112.9 79.8 159-26.4 8.1-85.7 29.9-71.6 53.8 11.4 19.3 196.2 12.3 249.5 6.3 53.3 6 238.1 13 249.5-6.3 14.1-23.8-45.3-45.7-71.6-53.8 54.6-46.2 79.8-110.1 79.8-159 0 0 52.1 84.6 70.1 82.4 8.5-1.1 19.5-46.4-14.5-155.8z" /></svg>
|
After Width: | Height: | Size: 710 B |
1
src/icon/right.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694158711559" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5049" xmlns:xlink="http://www.w3.org/1999/xlink" width="48" height="48"><path d="M724 511.4L361 947.6c-12.2 14.6-33.9 16.6-48.5 4.4-14.6-12.2-16.6-33.9-4.4-48.5l326.2-392-326.3-391c-12.2-14.6-10.2-36.3 4.4-48.5 14.6-12.2 36.3-10.2 48.5 4.4l363.1 435z" p-id="5050"></path></svg>
|
After Width: | Height: | Size: 527 B |
1
src/icon/sciss.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="7" r="3"></circle><circle cx="6" cy="17" r="3"></circle><path d="M8.6 8.6L19 19"></path><path d="M8.6 15.4L19 5"></path></g></svg>
|
After Width: | Height: | Size: 353 B |
1
src/icon/user.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="48px" height="48.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#7B1DD3" d="M490.7 100.8c115.8 0 209.6 92.3 209.6 206.2 0 113.9-93.9 206.2-209.6 206.2S281.1 420.9 281.1 307c0-113.9 93.9-206.2 209.6-206.2z m0 0c115.8 0 209.6 92.3 209.6 206.2 0 113.9-93.9 206.2-209.6 206.2S281.1 420.9 281.1 307c0-113.9 93.9-206.2 209.6-206.2zM412.1 582h174.7c149.6 0 270.8 119.2 270.8 266.3v17.2c0 58-121.2 60.2-270.8 60.2H412.1c-149.6 0-270.8-0.1-270.8-60.2v-17.2c0-147.1 121.2-266.3 270.8-266.3z m0 0" /></svg>
|
After Width: | Height: | Size: 699 B |
22
src/main.js
@ -1,14 +1,26 @@
|
||||
import './assets/main.css'
|
||||
import './assets/main.less';
|
||||
|
||||
import { useConfig } from '@/config';
|
||||
import { createPinia } from 'pinia';
|
||||
import TDesign from 'tdesign-vue-next';
|
||||
import 'tdesign-vue-next/es/style/index.css';
|
||||
import { createApp } from 'vue';
|
||||
import App from './App.vue';
|
||||
import icon from './icon/index.js';
|
||||
import router from "./router/guard.js";
|
||||
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(TDesign)
|
||||
|
||||
useConfig()
|
||||
for (const key in icon) {
|
||||
// console.log(key, icon[key]);
|
||||
app.component('icon-'+key, icon[key]);
|
||||
}
|
||||
|
||||
app.mount('#app')
|
||||
|
37
src/router/guard.js
Normal file
@ -0,0 +1,37 @@
|
||||
import NProgress from "nprogress";
|
||||
import router from "./index";
|
||||
// import 'nprogress/nprogress.css'; // nprogress样式文件
|
||||
import "@/router/nprogress.less";
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const token = window.$cookies.get("token");
|
||||
const userinfo = window.$cookies.get("userinfo");
|
||||
// 路由发生变化修改页面title
|
||||
if (to.meta.title) {
|
||||
document.title = to.meta.title;
|
||||
}
|
||||
// 开启进度条
|
||||
NProgress.start();
|
||||
if (to.meta?.auth) {
|
||||
if (!!token && !!userinfo) {
|
||||
next();
|
||||
} else {
|
||||
next({
|
||||
path: "/login",
|
||||
query: {
|
||||
redirect: to.fullPath,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
//当路由跳转结束后
|
||||
router.afterEach(() => {
|
||||
// 关闭进度条
|
||||
NProgress.done();
|
||||
});
|
||||
|
||||
export default router;
|
@ -1,23 +1,9 @@
|
||||
import routers from '@/util/router.js'
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import HomeView from '../views/HomeView.vue'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: HomeView,
|
||||
},
|
||||
{
|
||||
path: '/about',
|
||||
name: 'about',
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (About.[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import('../views/AboutView.vue'),
|
||||
},
|
||||
],
|
||||
routes: [routers],
|
||||
})
|
||||
|
||||
export default router
|
||||
|
82
src/router/nprogress.less
Normal file
@ -0,0 +1,82 @@
|
||||
/* Make clicks pass-through */
|
||||
#nprogress {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#nprogress .bar {
|
||||
background: @primary;
|
||||
|
||||
position: fixed;
|
||||
z-index: 1031;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
/* Fancy blur effect */
|
||||
#nprogress .peg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width: 100px;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 10px #29d, 0 0 5px #29d;
|
||||
opacity: 1;
|
||||
|
||||
-webkit-transform: rotate(3deg) translate(0px, -4px);
|
||||
-ms-transform: rotate(3deg) translate(0px, -4px);
|
||||
transform: rotate(3deg) translate(0px, -4px);
|
||||
}
|
||||
|
||||
/* Remove these to get rid of the spinner */
|
||||
#nprogress .spinner {
|
||||
/* display: block; */
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1031;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
#nprogress .spinner-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
box-sizing: border-box;
|
||||
|
||||
border: solid 2px transparent;
|
||||
border-top-color: #29d;
|
||||
border-left-color: #29d;
|
||||
border-radius: 50%;
|
||||
|
||||
-webkit-animation: nprogress-spinner 400ms linear infinite;
|
||||
animation: nprogress-spinner 400ms linear infinite;
|
||||
}
|
||||
|
||||
.nprogress-custom-parent {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nprogress-custom-parent #nprogress .spinner,
|
||||
.nprogress-custom-parent #nprogress .bar {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@-webkit-keyframes nprogress-spinner {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes nprogress-spinner {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useCounterStore = defineStore('counter', () => {
|
||||
const count = ref(0)
|
||||
const doubleCount = computed(() => count.value * 2)
|
||||
function increment() {
|
||||
count.value++
|
||||
}
|
||||
|
||||
return { count, doubleCount, increment }
|
||||
})
|
51
src/util/heart.js
Normal file
@ -0,0 +1,51 @@
|
||||
! function (e, t, a) {
|
||||
function r() {
|
||||
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[
|
||||
e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x +
|
||||
"px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e]
|
||||
.scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
|
||||
requestAnimationFrame(r)
|
||||
}
|
||||
|
||||
function n() {
|
||||
var t = "function" == typeof e.onclick && e.onclick;
|
||||
e.onclick = function (e) {
|
||||
t && t(), o(e)
|
||||
}
|
||||
}
|
||||
|
||||
function o(e) {
|
||||
var a = t.createElement("div");
|
||||
a.className = "heart", s.push({
|
||||
el: a,
|
||||
x: e.clientX - 5,
|
||||
y: e.clientY - 5,
|
||||
scale: 1,
|
||||
alpha: 1,
|
||||
color: c()
|
||||
}), t.body.appendChild(a)
|
||||
}
|
||||
|
||||
function i(e) {
|
||||
var a = t.createElement("style");
|
||||
a.type = "text/css";
|
||||
try {
|
||||
a.appendChild(t.createTextNode(e))
|
||||
} catch (t) {
|
||||
a.styleSheet.cssText = e
|
||||
}
|
||||
t.getElementsByTagName("head")[0].appendChild(a)
|
||||
}
|
||||
|
||||
function c() {
|
||||
return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math
|
||||
.random()) + ")"
|
||||
}
|
||||
var s = [];
|
||||
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e
|
||||
.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
|
||||
setTimeout(e, 1e3 / 60)
|
||||
}, i(
|
||||
".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"
|
||||
), n(), r()
|
||||
}(window, document);
|
167
src/util/index.js
Normal file
@ -0,0 +1,167 @@
|
||||
// 将res的key对应的值复制给dzdata的同名key
|
||||
/**
|
||||
* 将源对象res的属性复制到目标对象dzdata中。
|
||||
* @param {Object} res - 源对象,其属性将被复制。
|
||||
* @param {Object} dzdata - 目标对象,将接收源对象的属性。
|
||||
* @example
|
||||
* ObjectCopy({a: 1, b: 2}, {c: 3}); // dzdata 变为 {a: 1, b: 2, c: 3}
|
||||
*/
|
||||
export function ObjectCopy(res, dzdata) {
|
||||
Object.keys(dzdata).map(key => {
|
||||
dzdata[key] = res[key];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 时间格式化
|
||||
* @param {*} time 传入时间参数,支持字符串和时间戳
|
||||
* @param {*} f 对应格式 "YYYY-MM-DD hh:mm:ss" "YYYY年MM月DD日hh时mm分ss秒"
|
||||
* 格式可以自定义,对应的字符串对应的时间会更新,输入单个字符表示可以不补零
|
||||
* @return {*} 返回格式化的日期
|
||||
*/
|
||||
export function formatTime(time, f) {
|
||||
const date = new Date(time);
|
||||
if (!(date instanceof Date && !isNaN(date.getTime()))) {
|
||||
console.error("不合法的日期!");
|
||||
return;
|
||||
}
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth();
|
||||
const day = date.getDate();
|
||||
const hour = date.getHours();
|
||||
const minute = date.getMinutes();
|
||||
const second = date.getSeconds();
|
||||
const monthAdd0 = timeAdd0(month + 1);
|
||||
const dayAdd0 = timeAdd0(day);
|
||||
const hourAdd0 = timeAdd0(hour);
|
||||
const minuteAdd0 = timeAdd0(minute);
|
||||
const secondAdd0 = timeAdd0(second);
|
||||
let str = f.toString();
|
||||
str = str.replace("YYYY", year);
|
||||
if (f.includes("M")) {
|
||||
if (f.includes("MM")) str = str.replace("MM", monthAdd0);
|
||||
else str = str.replace("M", month + 1);
|
||||
}
|
||||
if (f.includes("D")) {
|
||||
if (f.includes("DD")) str = str.replace("DD", dayAdd0);
|
||||
else str = str.replace("D", day);
|
||||
}
|
||||
if (f.includes("h")) {
|
||||
if (f.includes("h")) str = str.replace("hh", hourAdd0);
|
||||
else str = str.replace("h", hour);
|
||||
}
|
||||
if (f.includes("m")) {
|
||||
if (f.includes("mm")) str = str.replace("mm", minuteAdd0);
|
||||
else str = str.replace("m", minute);
|
||||
}
|
||||
if (f.includes("s")) {
|
||||
if (f.includes("ss")) str = str.replace("ss", secondAdd0);
|
||||
else str = str.replace("s", second);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 补零函数 为时间服务 不足两位的自动在数字前面加上0
|
||||
* @param {*} n 待补零数字
|
||||
* @return {*} 补零后数字
|
||||
*/
|
||||
function timeAdd0(n) {
|
||||
const s = n.toString();
|
||||
return s.padStart(2, "0");
|
||||
}
|
||||
|
||||
|
||||
export function deepclone(obj) {
|
||||
let str, newobj = obj.constructor === Array ? [] : {};
|
||||
if (typeof obj !== "object") {
|
||||
return;
|
||||
}
|
||||
if (window.JSON) {
|
||||
str = JSON.stringify(obj), //系列化对象
|
||||
newobj = JSON.parse(str); //还原
|
||||
}
|
||||
else {
|
||||
for (var i in obj) {
|
||||
newobj[i] = typeof obj[i] === "object" ? deepclone(obj[i]) : obj[i];
|
||||
}
|
||||
}
|
||||
return newobj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据日期格式化时间。
|
||||
* @param {Date} date - 需要格式化的日期对象。
|
||||
* @param {string} format - 时间格式字符串。
|
||||
* @returns {string} 格式化后的时间字符串。
|
||||
* @example
|
||||
* formatTimeBydate(new Date(), 'yyyy-MM-dd HH:mm:ss');
|
||||
*/
|
||||
export function formatTimeBydate(f) {
|
||||
return formatTime(this, f)
|
||||
}
|
||||
|
||||
export function debounce(fn, delay) {
|
||||
let timer = null;
|
||||
return function () {
|
||||
let _this = this;
|
||||
let args = arguments;
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
timer = setTimeout(function () {
|
||||
fn.apply(_this, args);
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
export function throttle(fn, delay) {
|
||||
let timer = null;
|
||||
return function () {
|
||||
let _this = this;
|
||||
let args = arguments;
|
||||
if (!timer) {
|
||||
timer = setTimeout(function () {
|
||||
fn.apply(_this, args);
|
||||
timer = null;
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 字典查询 通个一个字段返回另一个字段的值
|
||||
/**
|
||||
* @description 字典查询
|
||||
* @param {*} dict 字典数组
|
||||
* @param {*} ckey 查询字段
|
||||
* @param {*} cvalue 查询值
|
||||
* @param {*} rkey 返回字段
|
||||
* @return {*} 返回值
|
||||
*/
|
||||
|
||||
export function getDictValue(dict, ckey, cvalue,rkey) {
|
||||
let result = "";
|
||||
dict.map(item => {
|
||||
if (item[ckey] == cvalue) {
|
||||
result = item[rkey];
|
||||
}
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
// 分割数组
|
||||
export function chunkArrayInGroups(arr, size) {
|
||||
return Array.from(
|
||||
{ length: Math.ceil(arr.length / size) },
|
||||
(_, i) => arr.slice(i * size, i * size + size)
|
||||
);
|
||||
}
|
||||
// 重置对象
|
||||
export function resetObject(obj) {
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
obj[key] = null;
|
||||
}
|
||||
}
|
||||
}
|
59
src/util/request.js
Normal file
@ -0,0 +1,59 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'qs';
|
||||
import { useCookies } from "vue3-cookies";
|
||||
import router from '../router/index.js';
|
||||
const { cookies } = useCookies();
|
||||
let baseURL = import.meta.env.VITE_APP_BASE_URL + '/api';
|
||||
// let baseURL = 'http://127.0.0.1:7777/api';
|
||||
|
||||
let headers = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
};
|
||||
|
||||
const request = axios.create({
|
||||
baseURL,
|
||||
headers
|
||||
});
|
||||
|
||||
// 添加请求拦截器
|
||||
request.interceptors.request.use(
|
||||
function (config) {
|
||||
// 在发送请求之前做些什么
|
||||
if (config.method == 'post' || config.method == 'POST') {
|
||||
config.data = qs.stringify(config.data);
|
||||
}
|
||||
if (cookies.get('token') && cookies.get('token') != '') {
|
||||
config.headers['Authorization'] = cookies.get('token');
|
||||
}
|
||||
return config;
|
||||
},
|
||||
async function (error) {
|
||||
// 对请求错误做些什么
|
||||
return error.message;
|
||||
}
|
||||
);
|
||||
|
||||
// 添加响应拦截器
|
||||
request.interceptors.response.use(
|
||||
function (response) {
|
||||
// const msg = useMessage()
|
||||
// 2xx 范围内的状态码都会触发该函数。
|
||||
// 对响应数据做点什么
|
||||
if (response.data.code == 9) {
|
||||
window.$msg.error('登录过期,请重新登录');
|
||||
router.push('/login');
|
||||
return false;
|
||||
}
|
||||
if (response.data.code == 8) {
|
||||
window.$msg.error(response.data.msg);
|
||||
return false;
|
||||
}
|
||||
return response.data;
|
||||
},
|
||||
async function (error) {
|
||||
// 超出 2xx 范围的状态码都会触发该函数。
|
||||
// 对响应错误做点什么
|
||||
return error.message;
|
||||
}
|
||||
);
|
||||
export default request;
|
16
src/util/router.js
Normal file
@ -0,0 +1,16 @@
|
||||
import home from '@/views/home/index.vue'
|
||||
|
||||
export default {
|
||||
path: '/',
|
||||
redirect:'/login',
|
||||
children:[
|
||||
{
|
||||
path:'home',
|
||||
component: home,
|
||||
},
|
||||
{
|
||||
path:"login",
|
||||
component:()=>import('@/views/login/index.vue')
|
||||
}
|
||||
]
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
@media (min-width: 1024px) {
|
||||
.about {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,9 +0,0 @@
|
||||
<script setup>
|
||||
import TheWelcome from '../components/TheWelcome.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<TheWelcome />
|
||||
</main>
|
||||
</template>
|
21
src/views/home/index.vue
Normal file
@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
这里是主页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
//mark import
|
||||
|
||||
//mark data
|
||||
|
||||
//mark method
|
||||
|
||||
//mark 周期、内置函数等
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
21
src/views/login/index.vue
Normal file
@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
这是登录页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
//mark import
|
||||
|
||||
//mark data
|
||||
|
||||
//mark method
|
||||
|
||||
//mark 周期、内置函数等
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -1,18 +1,46 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { resolve } from "path";
|
||||
import AutoImport from 'unplugin-auto-import/vite';
|
||||
import { TDesignResolver } from 'unplugin-vue-components/resolvers';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
import svgLoader from "vite-svg-loader";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
vueDevTools(),
|
||||
tailwindcss(),
|
||||
svgLoader(),
|
||||
Components({
|
||||
resolvers: [TDesignResolver({library: 'vue-next'})],
|
||||
}),
|
||||
AutoImport({
|
||||
resolvers: [TDesignResolver({library: 'vue-next'})],
|
||||
}),
|
||||
],
|
||||
base: "/blog/",
|
||||
server:{
|
||||
host:'0.0.0.0',
|
||||
port: 8080,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
// additionalData: '@import "colorofchina/color.less";',
|
||||
modifyVars: {
|
||||
hack: `true; @import (reference) "${resolve("src/assets/base.less")}";`,
|
||||
},
|
||||
javascriptEnabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|