Compare commits

..

No commits in common. "e1e795b5dc8c2ce13c6e46050a259ae6c9fd40cb" and "3f2a50f86d54dffb29d74c5844041f857249df44" have entirely different histories.

8 changed files with 37 additions and 107 deletions

View File

@ -5,9 +5,6 @@ let route = useRoute()
// const handleSelect = (key: string, keyPath: string[]) => {
// console.log(key, keyPath)
// }
const HotArray = await $fetch("https://data.zziyu.cn/hot/webs")
// console.log(HotArray)
</script>
<template>
@ -24,9 +21,8 @@ const HotArray = await $fetch("https://data.zziyu.cn/hot/webs")
<el-sub-menu index="/data/all">
<template #title>数据收集</template>
<el-menu-item index="/data/all">总览</el-menu-item>
<el-menu-item v-for="(item,index) in HotArray" :key="index" :index="'/data/'+item">{{item}}</el-menu-item>
<!-- <el-menu-item index="/data/bilibili">bilibili</el-menu-item>-->
<!-- <el-menu-item index="/data/baidu">baidu</el-menu-item>-->
<el-menu-item index="/data/bilibili">bilibili</el-menu-item>
<el-menu-item index="/data/baidu">baidu</el-menu-item>
</el-sub-menu>
<el-sub-menu index="/tools">
<template #title>工具</template>

View File

@ -6,7 +6,6 @@ let {api} = await $fetch('/api/data/all')
</script>
<template>
<Title>热搜 {{route.params.WebName}} </Title>
这是 {{route.params.WebName}} 数据展示
</template>

21
pages/map.vue Normal file
View File

@ -0,0 +1,21 @@
<script setup lang="ts">
</script>
<template>
<Title>网站地图</Title>
<div style="display: flex;justify-content: center;flex-direction: column;align-items: center">
<NuxtLink to="/">主页</NuxtLink>
<NuxtLink to="/data/all">数据收集</NuxtLink>
<NuxtLink to="/data/bilibili">数据收集Bilibili</NuxtLink>
<NuxtLink to="/data/baidu">数据收集百度</NuxtLink>
<NuxtLink to="/">主页</NuxtLink>
<NuxtLink to="/tools/qqazk/">笔顺码字典首页</NuxtLink>
<NuxtLink to="/tools/qqazk/about">笔顺码字典关于</NuxtLink>
<NuxtLink to="/tools/qqazk/search?words=&method=bsmf">所有笔顺码</NuxtLink>
</div>
</template>
<style scoped>
</style>

View File

@ -1,22 +0,0 @@
<script setup lang="ts">
const HotArray = await $fetch("https://data.zziyu.cn/hot/webs")
</script>
<template>
<Title>网站地图</Title>
<div style="display: flex;justify-content: center;flex-direction: column;align-items: center">
<NuxtLink to="/">主页</NuxtLink>
<NuxtLink to="/data/all">数据收集所有</NuxtLink>
<!-- <NuxtLink to="/data/bilibili">数据收集Bilibili</NuxtLink>-->
<!-- <NuxtLink to="/data/baidu">数据收集百度</NuxtLink>-->
<NuxtLink v-for="(item,index) in HotArray" :to="'/data/'+item" :key="index">数据收集 {{item}}</NuxtLink>
<NuxtLink to="/">主页</NuxtLink>
<NuxtLink to="/tools/qqazk/">笔顺码字典首页</NuxtLink>
<NuxtLink to="/tools/qqazk/about">笔顺码字典关于</NuxtLink>
<NuxtLink to="/map/qqazk">所有笔顺码</NuxtLink>
</div>
</template>
<style scoped>
</style>

View File

@ -1,30 +0,0 @@
<script setup lang="ts">
import {Action} from "element-plus";
const dataRaw = await $fetch(`/api/tools/qqazk/search?words=&method=hz`)
if (dataRaw.haveMess){
ElMessageBox.alert(dataRaw.message,"获取资源错误",{
confirmButtonText: '确认',
callback:(action:Action)=>{
}
})
}
let arr = dataRaw.data
// console.log(arr)
</script>
<template>
<Title>网站地图-所有笔顺码</Title>
<NuxtLink v-for="value in arr" :to="'/tools/qqazk/details/'+value.id">
{{value.hz}}
</NuxtLink>
</template>
<style scoped>
a {
margin: 10px;
}
</style>

View File

@ -1,4 +1,4 @@
import {readFile, readFileSync} from "fs";
import {readFile} from "fs";
interface Word{
bsm:string
@ -11,18 +11,12 @@ interface Ret{
message:string
haveMess:boolean
}
let words:Word[] = []
const loadWords = ()=>{
const wordRaw = readFileSync('./word.json','utf-8')
words = JSON.parse(wordRaw)
for (let i = 0; i< words.length ; i++){
words[i].id =i;
}
}
let words:Word[]
readFile("./word.json",'utf-8',(err, data)=>{
if (err)console.error(err)
words=JSON.parse(data)
})
export default defineEventHandler((event):Ret=>{
if (words.length===0){
loadWords()
}
const query = getQuery(event)
if (query.id=="错误"){
return {
@ -31,7 +25,6 @@ export default defineEventHandler((event):Ret=>{
haveMess:true
}
}
// @ts-ignore
if (query.id>=words.length){
return {
data:words[0],
@ -39,9 +32,7 @@ export default defineEventHandler((event):Ret=>{
haveMess:true
}
}
return {
// @ts-ignore
data:words[query.id],
message:"",
haveMess:false

View File

@ -1,4 +1,4 @@
import {readFile, readFileSync} from "fs";
import {readFile} from "fs";
import path from "path";
interface Word{
bsm:string
@ -11,23 +11,17 @@ interface Ret{
message:string
haveMess:boolean
}
let words:Word[] = []
const loadWords = ()=>{
const wordRaw = readFileSync('./word.json','utf-8')
words = JSON.parse(wordRaw)
for (let i = 0; i< words.length ; i++){
words[i].id =i;
let words:Word[]
readFile("./word.json",'utf-8',(err, data)=>{
if (err)console.error(err)
words = JSON.parse(data)
for (let i =0 ;i<words.length;i++){
words[i].id=i
}
}
})
export default defineEventHandler((event):Ret=>{
if (words.length===0){
loadWords()
}
const retWords:Word[] = []
const query = getQuery(event)
// @ts-ignore
if (query.words=="错误"||query.method=="错误"||!(query.method=="bsmf"||query.method=="bsmc"||query.method=="hz")||query.words.length>20){
return {
data:[],

View File

@ -1,19 +0,0 @@
#!/bin/bash
# 1. 执行 git pull
git pull
# 2. 执行 npm i
npm i
# 3. 执行 npm run build
npm run build
cp ./word.json ./.output/
# 4. 切换到 ./.output 目录
cd ./.output
# 5. 执行 node ./server/index.mjs
node ./server/index.mjs