diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..dae1ee16 Binary files /dev/null and b/.DS_Store differ diff --git a/management/src/views/news/NewsView.vue b/management/src/views/news/NewsView.vue index abe90ae8..324c1a97 100644 --- a/management/src/views/news/NewsView.vue +++ b/management/src/views/news/NewsView.vue @@ -105,7 +105,6 @@ import { ref, onMounted, watch, nextTick } from 'vue'; import { ElMessage, ElMessageBox, ElDialog, ElConfigProvider, ElDrawer, ElInput, ElUpload } from 'element-plus'; import { Edit, Delete, Plus } from '@element-plus/icons-vue'; -import zhCn from 'element-plus/dist/locale/zh-cn.mjs'; import Quill from 'quill'; import 'quill/dist/quill.snow.css'; import type { UploadProps } from 'element-plus'; diff --git a/server/opt/ttk/ttk-darwin-amd64.dmg b/server/opt/ttk/ttk-darwin-amd64.dmg new file mode 100755 index 00000000..47dc7212 Binary files /dev/null and b/server/opt/ttk/ttk-darwin-amd64.dmg differ diff --git a/server/opt/ttk/ttk-linux-amd64 b/server/opt/ttk/ttk-linux-amd64 new file mode 100755 index 00000000..0ad2ec2a Binary files /dev/null and b/server/opt/ttk/ttk-linux-amd64 differ diff --git a/server/package.sh b/server/package.sh new file mode 100755 index 00000000..214223dd --- /dev/null +++ b/server/package.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# 设置目标文件夹和项目名称 +target_dir="./opt/ttk" +project_name="ttk" + +# 创建目标文件夹(若不存在) +mkdir -p "$target_dir" + +# 定义目标平台列表(格式:GOOS/GOARCH) +platforms=( + "linux/amd64" # Linux 64位 + "darwin/amd64" # Mac(Intel芯片)64位 + # 如需支持Mac Apple Silicon,可添加:darwin/arm64 +) + +# 遍历每个平台进行打包 +for platform in "${platforms[@]}"; do + # 解析平台信息 + IFS='/' read -r goos goarch <<< "$platform" + + # 设置平台相关的环境变量 + export CGO_ENABLED=0 # 禁用CGO,确保纯静态编译(跨平台兼容) + export GOOS="$goos" + export GOARCH="$goarch" + + # 生成输出文件名(Mac需加.dmg后缀,Linux用可执行文件) + if [ "$goos" = "darwin" ]; then + output_file="${project_name}-${goos}-${goarch}.dmg" + else + output_file="${project_name}-${goos}-${goarch}" + fi + + # 执行打包命令 + echo "正在打包 $platform 平台..." + env GOOS="$goos" GOARCH="$goarch" CGO_ENABLED=0 go build -o "$target_dir/$output_file" . + + # 检查打包结果 + if [ $? -eq 0 ]; then + echo "✅ $platform 平台打包成功,文件路径:$target_dir/$output_file" + else + echo "❌ $platform 平台打包失败" + fi +done \ No newline at end of file diff --git a/web/src/views/HomeView.vue b/web/src/views/HomeView.vue index 93d7229a..5940fcb9 100644 --- a/web/src/views/HomeView.vue +++ b/web/src/views/HomeView.vue @@ -211,7 +211,7 @@ function stripHtml(htmlStr: string): string { */ const fetchArticlesByTopic = async (topic: string): Promise => { try { - const response = await fetch('http://localhost:8080/api/articles/getarticle', { + const response = await fetch('http://8.155.160.224:8080/api/articles/getarticle', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/web/src/views/JiDiView.vue b/web/src/views/JiDiView.vue new file mode 100644 index 00000000..e69de29b