This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# 小石榴图文社区 Docker 环境配置
|
||||
# 卜卜世界 Docker 环境配置
|
||||
# 复制此文件为 .env 并根据实际情况修改配置
|
||||
|
||||
# 数据库配置
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<img alt="logo" src="./doc/imgs/小石榴.png" width="100" />
|
||||
<img alt="logo" src="./doc/imgs/卜卜.png" width="100" />
|
||||
</p>
|
||||
<h1 align="center" style="margin: 20px 30px 0px 30px; font-weight: bold;">XiaoShiLiu</h1>
|
||||
|
||||
@@ -217,7 +217,7 @@ VITE_API_BASE_URL=http://localhost:3001/api
|
||||
|
||||
# 应用配置
|
||||
VITE_USE_REAL_API=true
|
||||
VITE_APP_TITLE=小石榴图文社区
|
||||
VITE_APP_TITLE=卜卜世界
|
||||
```
|
||||
|
||||
> 💡 **配置说明**:
|
||||
|
@@ -18,7 +18,7 @@ function Write-ColorOutput {
|
||||
}
|
||||
|
||||
function Show-Help {
|
||||
Write-ColorOutput "小石榴图文社区 Docker 部署脚本" "Cyan"
|
||||
Write-ColorOutput "卜卜世界 Docker 部署脚本" "Cyan"
|
||||
Write-ColorOutput "用法: .\deploy.ps1 [选项]" "Yellow"
|
||||
Write-ColorOutput ""
|
||||
Write-ColorOutput "选项:" "Green"
|
||||
@@ -81,7 +81,7 @@ function Seed-Data {
|
||||
}
|
||||
|
||||
function Start-Services {
|
||||
Write-ColorOutput "启动小石榴图文社区服务..." "Green"
|
||||
Write-ColorOutput "启动卜卜世界服务..." "Green"
|
||||
|
||||
if ($Build) {
|
||||
Write-ColorOutput "重新构建镜像..." "Yellow"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# 小石榴图文社区 Docker 一键部署脚本
|
||||
# 卜卜世界 Docker 一键部署脚本
|
||||
# Bash 版本
|
||||
|
||||
set -e
|
||||
@@ -14,7 +14,7 @@ NC='\033[0m' # No Color
|
||||
|
||||
# 显示帮助信息
|
||||
show_help() {
|
||||
echo -e "${CYAN}小石榴图文社区 Docker 部署脚本${NC}"
|
||||
echo -e "${CYAN}卜卜世界 Docker 部署脚本${NC}"
|
||||
echo -e "${YELLOW}用法: ./deploy.sh [选项]${NC}"
|
||||
echo ""
|
||||
echo -e "${GREEN}选项:${NC}"
|
||||
@@ -62,7 +62,7 @@ check_env_file() {
|
||||
|
||||
# 启动服务
|
||||
start_services() {
|
||||
echo -e "${GREEN}启动小石榴图文社区服务...${NC}"
|
||||
echo -e "${GREEN}启动卜卜世界服务...${NC}"
|
||||
|
||||
if [ "$1" = "--build" ]; then
|
||||
echo -e "${YELLOW}重新构建镜像...${NC}"
|
||||
@@ -91,7 +91,7 @@ start_services() {
|
||||
|
||||
# 停止服务
|
||||
stop_services() {
|
||||
echo -e "${YELLOW}停止小石榴图文社区服务...${NC}"
|
||||
echo -e "${YELLOW}停止卜卜世界服务...${NC}"
|
||||
docker-compose down
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# 小石榴图文社区 API 接口文档
|
||||
# 卜卜世界 API 接口文档
|
||||
|
||||
## 项目信息
|
||||
- **项目名称**: 小石榴图文社区
|
||||
- **项目名称**: 卜卜世界
|
||||
- **版本**: v1.2.0
|
||||
- **基础URL**: `http://localhost:3001`
|
||||
- **数据库**: xiaoshiliu (MySQL)
|
||||
@@ -71,7 +71,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "这是个人简介",
|
||||
"location": "北京",
|
||||
@@ -92,7 +92,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
**请求参数**:
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| user_id | string | 是 | 小石榴号 |
|
||||
| user_id | string | 是 | 卜卜号 |
|
||||
| password | string | 是 | 密码 |
|
||||
|
||||
**响应示例**:
|
||||
@@ -104,7 +104,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "xiaoshiliu123",
|
||||
"nickname": "小石榴用户",
|
||||
"nickname": "卜卜用户",
|
||||
"avatar": "http://example.com/avatar.jpg",
|
||||
"bio": "这是我的个人简介",
|
||||
"location": "北京",
|
||||
@@ -167,7 +167,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"data": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "这是个人简介",
|
||||
"location": "北京",
|
||||
@@ -204,7 +204,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
{
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "这是个人简介",
|
||||
"location": "北京",
|
||||
@@ -241,7 +241,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"data": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "这是个人简介",
|
||||
"location": "北京",
|
||||
@@ -394,7 +394,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
**请求参数**:
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| keyword | string | 是 | 搜索关键词(支持昵称和小石榴号搜索) |
|
||||
| keyword | string | 是 | 搜索关键词(支持昵称和卜卜号搜索) |
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
|
||||
@@ -408,7 +408,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
{
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "这是个人简介",
|
||||
"location": "北京",
|
||||
@@ -501,7 +501,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"verified": 0
|
||||
}
|
||||
@@ -1020,7 +1020,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"comment_count": 5,
|
||||
"collect_count": 3,
|
||||
"created_at": "2025-08-30T00:00:00.000Z",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"user_avatar": "https://example.com/avatar.jpg",
|
||||
"verified": 0,
|
||||
"images": [
|
||||
@@ -1175,7 +1175,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"verified": 0
|
||||
}
|
||||
@@ -2156,7 +2156,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
**请求参数**:
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| keyword | string | 否 | 搜索关键词(支持搜索小石榴号、昵称、标题、正文内容、标签名称) |
|
||||
| keyword | string | 否 | 搜索关键词(支持搜索卜卜号、昵称、标题、正文内容、标签名称) |
|
||||
| tag | string | 否 | 标签搜索(精确匹配标签名称) |
|
||||
| type | string | 否 | 搜索类型:all(默认,所有类型)、posts(图文笔记)、videos(视频笔记)、users(用户) |
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
@@ -2555,7 +2555,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| user_display_id | string | 否 | 小石榴号搜索 |
|
||||
| user_display_id | string | 否 | 卜卜号搜索 |
|
||||
| nickname | string | 否 | 昵称搜索 |
|
||||
| status | int | 否 | 状态筛选(1=活跃,0=禁用) |
|
||||
| sortField | string | 否 | 排序字段(id, fans_count, like_count, created_at) |
|
||||
@@ -2604,7 +2604,7 @@ async function example() {
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| title | string | 否 | 标题搜索 |
|
||||
| user_display_id | string | 否 | 作者小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 作者卜卜号筛选 |
|
||||
| category_id | int | 否 | 分类ID筛选 |
|
||||
| sortField | string | 否 | 排序字段(id, view_count, like_count, collect_count, comment_count, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2637,7 +2637,7 @@ async function example() {
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| content | string | 否 | 内容搜索 |
|
||||
| user_display_id | string | 否 | 评论者小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 评论者卜卜号筛选 |
|
||||
| post_id | int | 否 | 笔记ID筛选 |
|
||||
| sortField | string | 否 | 排序字段(id, like_count, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2745,7 +2745,7 @@ async function example() {
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| type | int | 否 | 认证类型筛选(1-个人认证,2-企业认证) |
|
||||
| status | int | 否 | 审核状态筛选(0-待审核,1-已通过,2-已拒绝) |
|
||||
| user_display_id | string | 否 | 用户小石榴号搜索 |
|
||||
| user_display_id | string | 否 | 用户卜卜号搜索 |
|
||||
| real_name | string | 否 | 真实姓名搜索 |
|
||||
| sortField | string | 否 | 排序字段(id, created_at, audit_time) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2888,7 +2888,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| user_display_id | string | 否 | 用户小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 用户卜卜号筛选 |
|
||||
| target_type | int | 否 | 目标类型(1=笔记,2=评论) |
|
||||
| sortField | string | 否 | 排序字段(id, user_id, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2941,7 +2941,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| user_display_id | string | 否 | 用户小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 用户卜卜号筛选 |
|
||||
| sortBy | string | 否 | 排序字段(id, user_id, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
|
||||
@@ -2968,7 +2968,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| user_display_id | string | 否 | 用户小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 用户卜卜号筛选 |
|
||||
| sortField | string | 否 | 排序字段(id, follower_id, following_id, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
|
||||
@@ -2995,7 +2995,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| user_display_id | string | 否 | 用户小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 用户卜卜号筛选 |
|
||||
| type | string | 否 | 通知类型筛选 |
|
||||
| is_read | int | 否 | 已读状态(0=未读,1=已读) |
|
||||
| sortField | string | 否 | 排序字段(id, created_at) |
|
||||
@@ -3028,7 +3028,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 页码,默认1 |
|
||||
| limit | int | 否 | 每页数量,默认20 |
|
||||
| user_display_id | string | 否 | 用户小石榴号筛选 |
|
||||
| user_display_id | string | 否 | 用户卜卜号筛选 |
|
||||
| is_active | int | 否 | 活跃状态(0=非活跃,1=活跃) |
|
||||
| sortField | string | 否 | 排序字段(id, is_active, expires_at, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
## 概述
|
||||
|
||||
基于小石榴风格的图文社区项目,简化版数据库结构设计,包含用户管理、内容发布、社交互动等核心功能。
|
||||
基于卜卜风格的图文社区项目,简化版数据库结构设计,包含用户管理、内容发布、社交互动等核心功能。
|
||||
|
||||
### 字符集和排序规则
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|--------|------|------|------|
|
||||
| id | BIGINT | 用户ID | 主键,自增 |
|
||||
| password | VARCHAR(255) | 密码 | 可为空 |
|
||||
| user_id | VARCHAR(50) | 小石榴号 | 唯一标识 |
|
||||
| user_id | VARCHAR(50) | 卜卜号 | 唯一标识 |
|
||||
| nickname | VARCHAR(100) | 昵称 | 显示名称 |
|
||||
| avatar | VARCHAR(500) | 头像URL | 用户头像 |
|
||||
| bio | TEXT | 个人简介 | 用户介绍 |
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# 小石榴图文社区部署指南
|
||||
# 卜卜世界部署指南
|
||||
|
||||
## 项目简介
|
||||
|
||||
小石榴图文社区是一个基于 Express + Vue3 的现代化图文社区平台,支持用户注册、发布图文内容、互动交流等功能。
|
||||
卜卜世界是一个基于 Express + Vue3 的现代化图文社区平台,支持用户注册、发布图文内容、互动交流等功能。
|
||||
|
||||
## 系统要求
|
||||
|
||||
@@ -232,7 +232,7 @@ VITE_API_BASE_URL=http://localhost:3001/api
|
||||
VITE_USE_REAL_API=true
|
||||
|
||||
# 应用标题
|
||||
VITE_APP_TITLE=小石榴图文社区
|
||||
VITE_APP_TITLE=卜卜世界
|
||||
```
|
||||
|
||||
安装依赖:
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# 项目结构
|
||||
|
||||
本文档详细介绍了小石榴图文社区项目的目录结构和文件组织。
|
||||
本文档详细介绍了卜卜世界项目的目录结构和文件组织。
|
||||
|
||||
## 总体结构
|
||||
|
||||
```
|
||||
小石榴图文社区/
|
||||
卜卜世界/
|
||||
├── vue3-project/ # 前端项目
|
||||
├── express-project/ # 后端项目
|
||||
├── README.md # 项目主文档
|
||||
|
@@ -406,7 +406,7 @@ General parameters for interfaces that support pagination:
|
||||
"message": "成功",
|
||||
"data": {
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"total_posts": 10,
|
||||
"total_likes": 50,
|
||||
"total_comments": 30,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# 小石榴圖文社區 API 接口文檔
|
||||
# 卜卜圖文社區 API 接口文檔
|
||||
|
||||
## 專案資訊
|
||||
- **專案名稱**: 小石榴圖文社區
|
||||
- **專案名稱**: 卜卜圖文社區
|
||||
- **版本**: v1.2.0
|
||||
- **基礎URL**: `http://localhost:3001`
|
||||
- **數據庫**: xiaoshiliu (MySQL)
|
||||
@@ -71,7 +71,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "这是個人簡介",
|
||||
"location": "北京",
|
||||
@@ -92,7 +92,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
**請求參數**:
|
||||
| 參數 | 型別 | 必填 | 說明 |
|
||||
|------|------|------|------|
|
||||
| user_id | string | 是 | 小石榴號 |
|
||||
| user_id | string | 是 | 卜卜號 |
|
||||
| password | string | 是 | 密碼 |
|
||||
|
||||
**響應範例**:
|
||||
@@ -104,7 +104,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "xiaoshiliu123",
|
||||
"nickname": "小石榴用户",
|
||||
"nickname": "卜卜用户",
|
||||
"avatar": "http://example.com/avatar.jpg",
|
||||
"bio": "這是我的個人簡介",
|
||||
"location": "北京",
|
||||
@@ -167,7 +167,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"data": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "這是個人簡介",
|
||||
"location": "北京",
|
||||
@@ -204,7 +204,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
{
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "這是個人簡介",
|
||||
"location": "北京",
|
||||
@@ -241,7 +241,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"data": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"bio": "這是個人簡介",
|
||||
"location": "北京",
|
||||
@@ -394,7 +394,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
**請求參數**:
|
||||
| 參數 | 類型 | 必填 | 說明 |
|
||||
|------|------|------|------|
|
||||
| keyword | string | 是 | 搜尋關鍵詞(支持昵稱和小石榴號搜尋) |
|
||||
| keyword | string | 是 | 搜尋關鍵詞(支持昵稱和卜卜號搜尋) |
|
||||
| page | int | 否 | 頁碼,默認1 |
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
|
||||
@@ -412,7 +412,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"verified": 0
|
||||
},
|
||||
@@ -915,7 +915,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"comment_count": 5,
|
||||
"collect_count": 3,
|
||||
"created_at": "2025-08-30T00:00:00.000Z",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"user_avatar": "https://example.com/avatar.jpg",
|
||||
"verified": 0,
|
||||
"images": [
|
||||
@@ -1045,7 +1045,7 @@ Authorization: Bearer <your_jwt_token>
|
||||
"user": {
|
||||
"id": 1,
|
||||
"user_id": "user_001",
|
||||
"nickname": "小石榴",
|
||||
"nickname": "卜卜",
|
||||
"avatar": "https://example.com/avatar.jpg",
|
||||
"verified": 0
|
||||
}
|
||||
@@ -2395,7 +2395,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 頁碼,默認1 |
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
| user_display_id | string | 否 | 小石榴號搜索 |
|
||||
| user_display_id | string | 否 | 卜卜號搜索 |
|
||||
| nickname | string | 否 | 昵稱搜索 |
|
||||
| status | int | 否 | 狀態過濾(1=活躍,0=禁用) |
|
||||
| sortField | string | 否 | 排序字段(id, fans_count, like_count, created_at) |
|
||||
@@ -2444,7 +2444,7 @@ async function example() {
|
||||
| page | int | 否 | 頁碼,默認1 |
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
| title | string | 否 | 标題搜索 |
|
||||
| user_display_id | string | 否 | 作者小石榴號過濾 |
|
||||
| user_display_id | string | 否 | 作者卜卜號過濾 |
|
||||
| category_id | int | 否 | 分類ID過濾 |
|
||||
| sortField | string | 否 | 排序字段(id, view_count, like_count, collect_count, comment_count, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2477,7 +2477,7 @@ async function example() {
|
||||
| page | int | 否 | 頁碼,默認1 |
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
| content | string | 否 | 內容搜索 |
|
||||
| user_display_id | string | 否 | 評論者小石榴號過濾 |
|
||||
| user_display_id | string | 否 | 評論者卜卜號過濾 |
|
||||
| post_id | int | 否 | 記錄ID過濾 |
|
||||
| sortField | string | 否 | 排序字段(id, like_count, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2587,7 +2587,7 @@ async function example() {
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
| type | int | 否 | 證書類型篩選(1-個人證書,2-企業證書) |
|
||||
| status | int | 否 | 审核狀態篩選(0-待審核,1-已通過,2-已拒絕) |
|
||||
| user_display_id | string | 否 | 用戶小石榴號搜索 |
|
||||
| user_display_id | string | 否 | 用戶卜卜號搜索 |
|
||||
| real_name | string | 否 | 真實姓名搜索 |
|
||||
| 排序欄位 | 字串 | 否 | 排序欄位(id, created_at, audit_time) |
|
||||
| 排序順序 | 字串 | 否 | 排序順序(ASC, DESC) |
|
||||
@@ -2730,7 +2730,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 頁碼,預設1 |
|
||||
| limit | int | 否 | 每頁數量,預設20 |
|
||||
| user_display_id | string | 否 | 使用者小石榴號過濾 |
|
||||
| user_display_id | string | 否 | 使用者卜卜號過濾 |
|
||||
| target_type | int | 否 | 目標類型(1=筆記,2=評論) |
|
||||
| sortField | string | 否 | 排序字段(id, user_id, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
@@ -2783,7 +2783,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 頁碼,預設1 |
|
||||
| limit | int | 否 | 每頁數量,預設20 |
|
||||
| user_display_id | string | 否 | 使用者小石榴號過濾 |
|
||||
| user_display_id | string | 否 | 使用者卜卜號過濾 |
|
||||
| sortBy | string | 否 | 排序字段(id, user_id, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
|
||||
@@ -2810,7 +2810,7 @@ async function example() {
|
||||
|------|------|------|------|
|
||||
| page | int | 否 | 頁碼,預設1 |
|
||||
| limit | int | 否 | 每頁數量,預設20 |
|
||||
| user_display_id | string | 否 | 使用者小石榴號過濾 |
|
||||
| user_display_id | string | 否 | 使用者卜卜號過濾 |
|
||||
| sortField | string | 否 | 排序字段(id, follower_id, following_id, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
|
||||
@@ -2839,7 +2839,7 @@ async function example() {
|
||||
|------|----------|------|------|
|
||||
| page | int | 否 | 頁碼,默認1 |
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
| user_display_id | string | 否 | 使用者小石榴號篩選 |
|
||||
| user_display_id | string | 否 | 使用者卜卜號篩選 |
|
||||
| type | string | 否 | 通知類型篩選 |
|
||||
| is_read | int | 否 | 已讀狀態(0=未讀,1=已讀) |
|
||||
| sortField | string | 否 | 排序字段(id, created_at) |
|
||||
@@ -2872,7 +2872,7 @@ async function example() {
|
||||
|------|----------|------|------|
|
||||
| page | int | 否 | 頁碼,默認1 |
|
||||
| limit | int | 否 | 每頁數量,默認20 |
|
||||
| user_display_id | string | 否 | 使用者小石榴號篩選 |
|
||||
| user_display_id | string | 否 | 使用者卜卜號篩選 |
|
||||
| is_active | int | 否 | 活躍狀態(0=非活躍,1=活躍) |
|
||||
| sortField | string | 否 | 排序字段(id, is_active, expires_at, created_at) |
|
||||
| sortOrder | string | 否 | 排序方向(ASC, DESC) |
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
## 概述
|
||||
|
||||
基於小石榴風格的圖文社區項目,簡化版資料庫結構設計,包含使用者管理、內容發佈、社交互動等核心功能。
|
||||
基於卜卜風格的圖文社區項目,簡化版資料庫結構設計,包含使用者管理、內容發佈、社交互動等核心功能。
|
||||
|
||||
### 字元集和排序規則
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|--------|------|------|------|
|
||||
| id | BIGINT | 使用者ID | 主鍵,自增 |
|
||||
| password | VARCHAR(255) | 密碼 | 可為空 |
|
||||
| user_id | VARCHAR(50) | 小石榴號 | 唯一標識 |
|
||||
| user_id | VARCHAR(50) | 卜卜號 | 唯一標識 |
|
||||
| nickname | VARCHAR(100) | 暱稱 | 顯示名稱 |
|
||||
| avatar | VARCHAR(500) | 頭像URL | 使用者頭像 |
|
||||
| bio | TEXT | 個人簡介 | 使用者介紹 |
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# 項目結構
|
||||
|
||||
本文檔詳細介紹了小石榴圖文社區項目的目錄結構和文件組織。
|
||||
本文檔詳細介紹了卜卜圖文社區項目的目錄結構和文件組織。
|
||||
|
||||
## 總體結構
|
||||
|
||||
```
|
||||
小石榴圖文社區/
|
||||
卜卜圖文社區/
|
||||
├── vue3-project/ # 前端項目
|
||||
├── express-project/ # 後端項目
|
||||
├── README.md # 項目主文檔
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<img alt="logo" src="../imgs/小石榴.png" width="100" />
|
||||
<img alt="logo" src="../imgs/卜卜.png" width="100" />
|
||||
</p>
|
||||
<h1 align="center" style="margin: 20px 30px 0px 30px; font-weight: bold;">XiaoShiLiu</h1>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<img alt="logo" src="../imgs/小石榴.png" width="100" />
|
||||
<img alt="logo" src="../imgs/卜卜.png" width="100" />
|
||||
</p>
|
||||
<h1 align="center" style="margin: 20px 30px 0px 30px; font-weight: bold;">XiaoShiLiu</h1>
|
||||
|
||||
@@ -218,7 +218,7 @@ VITE_API_BASE_URL=http://localhost:3001/api
|
||||
|
||||
# 應用配置
|
||||
VITE_USE_REAL_API=true
|
||||
VITE_APP_TITLE=小石榴圖文社區
|
||||
VITE_APP_TITLE=卜卜圖文社區
|
||||
```
|
||||
|
||||
> 💡 **配置說明**:
|
||||
|
Before Width: | Height: | Size: 595 KiB After Width: | Height: | Size: 595 KiB |
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* 小石榴校园图文社区 - Express后端服务
|
||||
* 卜卜校园图文社区 - Express后端服务
|
||||
*
|
||||
* @author ZTMYO
|
||||
* @github https://github.com/ZTMYO
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* 小石榴校园图文社区 - 应用配置文件
|
||||
* 卜卜校园图文社区 - 应用配置文件
|
||||
* 集中管理所有配置项
|
||||
*
|
||||
* @author ZTMYO
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "express-project",
|
||||
"version": "1.0.0",
|
||||
"description": "小石榴校园图文社区Express后端项目",
|
||||
"description": "卜卜校园图文社区Express后端项目",
|
||||
"author": "@ZTMYO",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
|
@@ -1161,7 +1161,7 @@ const followsCrudConfig = {
|
||||
const params = []
|
||||
|
||||
if (req.query.follower_display_id) {
|
||||
// 根据关注者小石榴号查找用户ID
|
||||
// 根据关注者卜卜号查找用户ID
|
||||
const userQuery = 'SELECT id FROM users WHERE COALESCE(user_id, CONCAT(\'user\', LPAD(id, 3, \'0\'))) = ?'
|
||||
const [userResult] = await pool.execute(userQuery, [req.query.follower_display_id])
|
||||
if (userResult.length > 0) {
|
||||
@@ -1182,7 +1182,7 @@ const followsCrudConfig = {
|
||||
}
|
||||
|
||||
if (req.query.following_display_id) {
|
||||
// 根据被关注者小石榴号查找用户ID
|
||||
// 根据被关注者卜卜号查找用户ID
|
||||
const userQuery = 'SELECT id FROM users WHERE COALESCE(user_id, CONCAT(\'user\', LPAD(id, 3, \'0\'))) = ?'
|
||||
const [userResult] = await pool.execute(userQuery, [req.query.following_display_id])
|
||||
if (userResult.length > 0) {
|
||||
|
@@ -73,9 +73,9 @@ router.get('/captcha', (req, res) => {
|
||||
// 检查用户ID是否已存在
|
||||
router.get('/check-user-id', async (req, res) => {
|
||||
try {
|
||||
const { user_id } = req.query; // 前端传过来的小石榴号
|
||||
const { user_id } = req.query; // 前端传过来的卜卜号
|
||||
if (!user_id) {
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '请输入小石榴号' });
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '请输入卜卜号' });
|
||||
}
|
||||
// 查数据库是否已有该ID
|
||||
const [existingUser] = await pool.execute(
|
||||
@@ -86,7 +86,7 @@ router.get('/check-user-id', async (req, res) => {
|
||||
res.json({
|
||||
code: RESPONSE_CODES.SUCCESS,
|
||||
data: { isUnique: existingUser.length === 0 },
|
||||
message: existingUser.length > 0 ? '小石榴号已存在' : '小石榴号可用'
|
||||
message: existingUser.length > 0 ? '卜卜号已存在' : '卜卜号可用'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('检查用户ID失败:', error);
|
||||
@@ -130,11 +130,11 @@ router.post('/register', async (req, res) => {
|
||||
captchaStore.delete(captchaId);
|
||||
|
||||
if (user_id.length < 3 || user_id.length > 15) {
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '小石榴号长度必须在3-15位之间' });
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '卜卜号长度必须在3-15位之间' });
|
||||
}
|
||||
|
||||
if (!/^[a-zA-Z0-9_]+$/.test(user_id)) {
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '小石榴号只能包含字母、数字和下划线' });
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '卜卜号只能包含字母、数字和下划线' });
|
||||
}
|
||||
|
||||
if (nickname.length > 10) {
|
||||
@@ -184,7 +184,7 @@ router.post('/register', async (req, res) => {
|
||||
[userId.toString()]
|
||||
);
|
||||
|
||||
console.log(`用户注册成功 - 用户ID: ${userId}, 小石榴号: ${userRows[0].user_id}`);
|
||||
console.log(`用户注册成功 - 用户ID: ${userId}, 卜卜号: ${userRows[0].user_id}`);
|
||||
|
||||
res.json({
|
||||
code: RESPONSE_CODES.SUCCESS,
|
||||
@@ -277,7 +277,7 @@ router.post('/login', async (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`用户登录成功 - 用户ID: ${user.id}, 小石榴号: ${user.user_id}`);
|
||||
console.log(`用户登录成功 - 用户ID: ${user.id}, 卜卜号: ${user.user_id}`);
|
||||
|
||||
res.json({
|
||||
code: RESPONSE_CODES.SUCCESS,
|
||||
|
@@ -167,7 +167,7 @@ router.post('/', authenticateToken, async (req, res) => {
|
||||
|
||||
for (const mentionedUser of mentionedUsers) {
|
||||
try {
|
||||
// 根据小石榴号查找用户的自增ID
|
||||
// 根据卜卜号查找用户的自增ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [mentionedUser.userId]);
|
||||
|
||||
if (userRows.length > 0) {
|
||||
|
@@ -508,7 +508,7 @@ router.post('/', authenticateToken, async (req, res) => {
|
||||
|
||||
for (const mentionedUser of mentionedUsers) {
|
||||
try {
|
||||
// 根据小石榴号查找用户的自增ID
|
||||
// 根据卜卜号查找用户的自增ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [mentionedUser.userId]);
|
||||
|
||||
if (userRows.length > 0) {
|
||||
@@ -941,7 +941,7 @@ router.put('/:id', authenticateToken, async (req, res) => {
|
||||
// 删除不再需要的@通知
|
||||
for (const mentionedUserId of usersToRemoveNotification) {
|
||||
try {
|
||||
// 根据小石榴号查找用户的自增ID
|
||||
// 根据卜卜号查找用户的自增ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [mentionedUserId]);
|
||||
|
||||
if (userRows.length > 0) {
|
||||
@@ -963,7 +963,7 @@ router.put('/:id', authenticateToken, async (req, res) => {
|
||||
// 添加新的@通知
|
||||
for (const mentionedUserId of usersToAddNotification) {
|
||||
try {
|
||||
// 根据小石榴号查找用户的自增ID
|
||||
// 根据卜卜号查找用户的自增ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [mentionedUserId]);
|
||||
|
||||
if (userRows.length > 0) {
|
||||
|
@@ -44,7 +44,7 @@ router.get('/', optionalAuth, async (req, res) => {
|
||||
let whereConditions = [];
|
||||
let queryParams = [];
|
||||
|
||||
// 关键词搜索条件 - 匹配小石榴号、昵称、标题、正文内容、标签名称中的任意一种
|
||||
// 关键词搜索条件 - 匹配卜卜号、昵称、标题、正文内容、标签名称中的任意一种
|
||||
if (keyword.trim()) {
|
||||
whereConditions.push('(p.title LIKE ? OR p.content LIKE ? OR u.nickname LIKE ? OR u.user_id LIKE ? OR EXISTS (SELECT 1 FROM post_tags pt JOIN tags t ON pt.tag_id = t.id WHERE pt.post_id = p.id AND t.name LIKE ?))');
|
||||
queryParams.push(`%${keyword}%`, `%${keyword}%`, `%${keyword}%`, `%${keyword}%`, `%${keyword}%`);
|
||||
@@ -151,7 +151,7 @@ router.get('/', optionalAuth, async (req, res) => {
|
||||
// 统计标签频率 - 始终基于keyword搜索结果,不受当前tag筛选影响
|
||||
let tagStats = [];
|
||||
if (keyword.trim()) {
|
||||
// 构建仅基于keyword的搜索条件(包括标题、内容、用户名、小石榴号、标签名称),并确保只统计已激活的笔记
|
||||
// 构建仅基于keyword的搜索条件(包括标题、内容、用户名、卜卜号、标签名称),并确保只统计已激活的笔记
|
||||
const keywordWhereClause = 'WHERE p.is_draft = 0 AND (p.title LIKE ? OR p.content LIKE ? OR u.nickname LIKE ? OR u.user_id LIKE ? OR EXISTS (SELECT 1 FROM post_tags pt2 JOIN tags t2 ON pt2.tag_id = t2.id WHERE pt2.post_id = p.id AND t2.name LIKE ?))';
|
||||
const keywordParams = [`%${keyword}%`, `%${keyword}%`, `%${keyword}%`, `%${keyword}%`, `%${keyword}%`];
|
||||
|
||||
|
@@ -18,7 +18,7 @@ router.get('/search', optionalAuth, async (req, res) => {
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '请输入搜索关键词' });
|
||||
}
|
||||
|
||||
// 搜索用户:支持昵称和小石榴号搜索
|
||||
// 搜索用户:支持昵称和卜卜号搜索
|
||||
const [rows] = await pool.execute(
|
||||
`SELECT u.id, u.user_id, u.nickname, u.avatar, u.bio, u.location, u.follow_count, u.fans_count, u.like_count, u.created_at, u.verified,
|
||||
(SELECT COUNT(*) FROM posts WHERE user_id = u.id AND is_draft = 0) as post_count
|
||||
@@ -101,7 +101,7 @@ router.get('/search', optionalAuth, async (req, res) => {
|
||||
router.get('/:id/personality-tags', async (req, res) => {
|
||||
try {
|
||||
const userIdParam = req.params.id;
|
||||
// 始终通过小石榴号查找用户信息
|
||||
// 始终通过卜卜号查找用户信息
|
||||
const query = 'SELECT gender, zodiac_sign, mbti, education, major, interests FROM users WHERE user_id = ?';
|
||||
const params = [userIdParam];
|
||||
|
||||
@@ -143,7 +143,7 @@ router.get('/:id/personality-tags', async (req, res) => {
|
||||
router.get('/:id', async (req, res) => {
|
||||
try {
|
||||
const userIdParam = req.params.id;
|
||||
// 只通过小石榴号(user_id)进行查找
|
||||
// 只通过卜卜号(user_id)进行查找
|
||||
const [rows] = await pool.execute(
|
||||
'SELECT * FROM users WHERE user_id = ?',
|
||||
[userIdParam]
|
||||
@@ -228,7 +228,7 @@ router.get('/:id/posts', optionalAuth, async (req, res) => {
|
||||
const keyword = req.query.keyword;
|
||||
const sort = req.query.sort || 'created_at';
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -347,7 +347,7 @@ router.get('/:id/collections', optionalAuth, async (req, res) => {
|
||||
const offset = (page - 1) * limit;
|
||||
const currentUserId = req.user ? req.user.id : null;
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -443,7 +443,7 @@ router.get('/:id/likes', optionalAuth, async (req, res) => {
|
||||
const offset = (page - 1) * limit;
|
||||
const currentUserId = req.user ? req.user.id : null;
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -538,7 +538,7 @@ router.post('/:id/follow', authenticateToken, async (req, res) => {
|
||||
const followerId = req.user.id;
|
||||
|
||||
// 获取被关注用户的数字ID
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -594,7 +594,7 @@ router.delete('/:id/follow', authenticateToken, async (req, res) => {
|
||||
const userIdParam = req.params.id;
|
||||
const followerId = req.user.id;
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -640,7 +640,7 @@ router.get('/:id/follow-status', optionalAuth, async (req, res) => {
|
||||
const followerId = req.user ? req.user.id : null;
|
||||
|
||||
// 获取用户的数字ID
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -705,7 +705,7 @@ router.get('/:id/following', optionalAuth, async (req, res) => {
|
||||
const offset = (page - 1) * limit;
|
||||
const currentUserId = req.user ? req.user.id : null;
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -801,7 +801,7 @@ router.get('/:id/followers', optionalAuth, async (req, res) => {
|
||||
|
||||
console.log(`获取粉丝列表 - 用户ID: ${userIdParam}, 当前用户ID: ${currentUserId}`);
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -891,7 +891,7 @@ router.get('/:id/mutual-follows', optionalAuth, async (req, res) => {
|
||||
|
||||
console.log(`获取互关列表 - 用户ID: ${userIdParam}, 当前用户ID: ${currentUserId}`);
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -998,7 +998,7 @@ router.get('/:id/stats', async (req, res) => {
|
||||
const userIdParam = req.params.id;
|
||||
console.log(`获取用户统计信息 - 用户ID: ${userIdParam}`);
|
||||
|
||||
// 通过小石榴号查找对应的数字ID
|
||||
// 通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -1060,7 +1060,7 @@ router.put('/:id', authenticateToken, async (req, res) => {
|
||||
|
||||
console.log(`用户更新资料 - 目标用户ID: ${userIdParam}, 当前用户ID: ${currentUserId}`);
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -1175,7 +1175,7 @@ router.put('/:id/password', authenticateToken, async (req, res) => {
|
||||
return res.status(HTTP_STATUS.BAD_REQUEST).json({ code: RESPONSE_CODES.VALIDATION_ERROR, message: '新密码长度不能少于6位' });
|
||||
}
|
||||
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await pool.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
@@ -1220,7 +1220,7 @@ router.delete('/:id', authenticateToken, async (req, res) => {
|
||||
try {
|
||||
const userIdParam = req.params.id;
|
||||
const currentUserId = req.user.id;
|
||||
// 始终通过小石榴号查找对应的数字ID
|
||||
// 始终通过卜卜号查找对应的数字ID
|
||||
const [userRows] = await connection.execute('SELECT id FROM users WHERE user_id = ?', [userIdParam]);
|
||||
if (userRows.length === 0) {
|
||||
return res.status(HTTP_STATUS.NOT_FOUND).json({ code: RESPONSE_CODES.NOT_FOUND, message: '用户不存在' });
|
||||
|
@@ -486,7 +486,7 @@ class DataGenerator {
|
||||
}
|
||||
|
||||
const user = {
|
||||
user_id: `user${String(i + 1).padStart(3, '0')}`, // 小石榴号,字符串格式
|
||||
user_id: `user${String(i + 1).padStart(3, '0')}`, // 卜卜号,字符串格式
|
||||
password: '123456', // 使用明文密码
|
||||
nickname: this.usernames[i], // 按顺序使用usernames数组,不重复
|
||||
avatar: this.generateRandomAvatarUrl(),
|
||||
|
@@ -96,7 +96,7 @@ class DatabaseInitializer {
|
||||
CREATE TABLE IF NOT EXISTS \`users\` (
|
||||
\`id\` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||
\`password\` varchar(255) DEFAULT NULL COMMENT '密码',
|
||||
\`user_id\` varchar(50) NOT NULL COMMENT '小石榴号',
|
||||
\`user_id\` varchar(50) NOT NULL COMMENT '卜卜号',
|
||||
\`nickname\` varchar(100) NOT NULL COMMENT '昵称',
|
||||
\`avatar\` varchar(500) DEFAULT NULL COMMENT '头像URL',
|
||||
\`bio\` text DEFAULT NULL COMMENT '个人简介',
|
||||
@@ -413,7 +413,7 @@ class DatabaseInitializer {
|
||||
|
||||
async run() {
|
||||
try {
|
||||
console.log('=== 小石榴图文社区数据库初始化 ===\n');
|
||||
console.log('=== 卜卜世界数据库初始化 ===\n');
|
||||
|
||||
// 创建数据库
|
||||
await this.createDatabase();
|
||||
|
@@ -1,4 +1,4 @@
|
||||
-- 小石榴图文社区数据库初始化脚本
|
||||
-- 卜卜世界数据库初始化脚本
|
||||
-- 创建数据库(如果不存在)
|
||||
CREATE DATABASE IF NOT EXISTS `xiaoshiliu` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
USE `xiaoshiliu`;
|
||||
@@ -7,7 +7,7 @@ USE `xiaoshiliu`;
|
||||
CREATE TABLE IF NOT EXISTS `users` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
|
||||
`password` varchar(255) DEFAULT NULL COMMENT '密码',
|
||||
`user_id` varchar(50) NOT NULL COMMENT '小石榴号',
|
||||
`user_id` varchar(50) NOT NULL COMMENT '卜卜号',
|
||||
`nickname` varchar(100) NOT NULL COMMENT '昵称',
|
||||
`avatar` varchar(500) DEFAULT NULL COMMENT '头像URL',
|
||||
`bio` text DEFAULT NULL COMMENT '个人简介',
|
||||
|
@@ -7,4 +7,4 @@ VITE_API_BASE_URL=http://localhost:3001/api
|
||||
VITE_USE_REAL_API=true
|
||||
|
||||
# 应用标题
|
||||
VITE_APP_TITLE=小石榴图文社区
|
||||
VITE_APP_TITLE=卜卜世界
|
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<title>小石榴 - 你的校园图文部落</title>
|
||||
<title>卜卜 - 你的校园图文部落</title>
|
||||
|
||||
<!-- 基础favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="/logo.ico">
|
||||
|
@@ -8,6 +8,7 @@ server {
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
client_max_body_size 0;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "vue3-project",
|
||||
"version": "1.0.0",
|
||||
"description": "小石榴校园图文社区Vue3前端项目",
|
||||
"description": "卜卜校园图文社区Vue3前端项目",
|
||||
"author": "@ZTMYO",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "小石榴 - 你的校园图文部落",
|
||||
"short_name": "小石榴",
|
||||
"name": "卜卜 - 你的校园图文部落",
|
||||
"short_name": "卜卜",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-icon-192x192.png",
|
||||
@@ -32,5 +32,5 @@
|
||||
"display": "standalone",
|
||||
"theme_color": "#ff6b6b",
|
||||
"background_color": "#ffffff",
|
||||
"description": "小石榴图文社区 - 你的校园图文部落"
|
||||
"description": "卜卜世界 - 你的校园图文部落"
|
||||
}
|
@@ -668,7 +668,7 @@ const animationStyle = computed(() => {
|
||||
})
|
||||
|
||||
const authorData = computed(() => {
|
||||
// 使用小石榴号进行用户跳转
|
||||
// 使用卜卜号进行用户跳转
|
||||
const userId = props.item.author_account || props.item.user_id || props.item.originalData?.userId
|
||||
const followState = followStore.getUserFollowState(userId)
|
||||
return {
|
||||
@@ -1209,7 +1209,7 @@ const toggleCollect = async () => {
|
||||
|
||||
const handleShare = async () => {
|
||||
try {
|
||||
const shareUrl = `【${props.item.title}-${props.item.author}| 小石榴 - 你的校园图文部落】${window.location.origin}/post?id=${props.item.id}`
|
||||
const shareUrl = `【${props.item.title}-${props.item.author}| 卜卜 - 你的校园图文部落】${window.location.origin}/post?id=${props.item.id}`
|
||||
|
||||
// 检查是否支持现代剪贴板API
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
|
@@ -125,8 +125,8 @@ const isCurrentUser = computed(() => {
|
||||
return false
|
||||
}
|
||||
|
||||
const currentUserId = userStore.userInfo.user_id // 当前用户的小石榴号
|
||||
const userId = props.userInfo.id // 传入的用户ID(小石榴号)
|
||||
const currentUserId = userStore.userInfo.user_id // 当前用户的卜卜号
|
||||
const userId = props.userInfo.id // 传入的用户ID(卜卜号)
|
||||
|
||||
return currentUserId === userId
|
||||
})
|
||||
@@ -222,7 +222,7 @@ function handleAvatarError(event) {
|
||||
watch(() => props.userInfo, (newUserInfo) => {
|
||||
if (newUserInfo && newUserInfo.id) {
|
||||
// 初始化关注状态到 store
|
||||
// 确保使用正确的用户ID(小石榴号)
|
||||
// 确保使用正确的用户ID(卜卜号)
|
||||
const userId = newUserInfo.user_id || newUserInfo.userId || newUserInfo.id
|
||||
const isFollowing = newUserInfo.isFollowing || false
|
||||
const isMutual = newUserInfo.isMutual || false
|
||||
|
@@ -774,7 +774,7 @@ function closeDetailCard() {
|
||||
function onUserClick(userId, event) {
|
||||
event.stopPropagation() // 阻止事件冒泡,避免触发卡片点击
|
||||
if (userId) {
|
||||
// 使用小石榴号作为用户页面路径参数
|
||||
// 使用卜卜号作为用户页面路径参数
|
||||
const userUrl = `${window.location.origin}/user/${userId}`
|
||||
window.open(userUrl, '_blank')
|
||||
}
|
||||
|
@@ -226,7 +226,7 @@ const loadFriends = async (forceReload = false) => {
|
||||
try {
|
||||
const userResponse = await authApi.getCurrentUser()
|
||||
if (userResponse.success && userResponse.data) {
|
||||
currentUserId.value = userResponse.data.user_id // 使用小石榴号而不是数字ID
|
||||
currentUserId.value = userResponse.data.user_id // 使用卜卜号而不是数字ID
|
||||
} else {
|
||||
// 如果获取失败,使用默认ID
|
||||
currentUserId.value = 1
|
||||
|
@@ -49,7 +49,7 @@ const handleMenuClick = (action) => {
|
||||
<template>
|
||||
|
||||
<DropdownItem @click="handleMenuClick('about')">
|
||||
关于小石榴
|
||||
关于卜卜
|
||||
</DropdownItem>
|
||||
<DropdownItem @click="handleMenuClick('keyboardShortcuts')">
|
||||
键盘快捷键
|
||||
|
@@ -5,9 +5,9 @@
|
||||
<div class="about-header">
|
||||
<div class="header-content">
|
||||
<div class="logo-section">
|
||||
<div class="about-logo"><img :src="logoUrl" alt="小石榴" /></div>
|
||||
<div class="about-logo"><img :src="logoUrl" alt="卜卜" /></div>
|
||||
|
||||
<h2 class="about-title">关于小石榴</h2>
|
||||
<h2 class="about-title">关于卜卜</h2>
|
||||
</div>
|
||||
<p class="version">v1.2.0</p>
|
||||
</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="intro-section">
|
||||
<h3>项目简介</h3>
|
||||
<p>
|
||||
小石榴校园图文社区是一个面向开发者与学习者的开源示例项目,旨在提供从前端到后端的完整实践范本,帮助大家学习现代 Web 应用的架构设计、工程化与业务实现。
|
||||
卜卜校园图文社区是一个面向开发者与学习者的开源示例项目,旨在提供从前端到后端的完整实践范本,帮助大家学习现代 Web 应用的架构设计、工程化与业务实现。
|
||||
</p>
|
||||
</div>
|
||||
<div class="author-section">
|
||||
@@ -104,7 +104,7 @@
|
||||
</div>
|
||||
|
||||
<div class="about-footer">
|
||||
<p>© 2025 小石榴校园图文社区. Made with ❤️ by @ZTMYO</p>
|
||||
<p>© 2025 卜卜校园图文社区. Made with ❤️ by @ZTMYO</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,7 +122,7 @@ const emit = defineEmits(['close'])
|
||||
const { lock, unlock } = useScrollLock()
|
||||
|
||||
// 静态资源URL
|
||||
const logoUrl = new URL('@/assets/imgs/小石榴.png', import.meta.url).href
|
||||
const logoUrl = new URL('@/assets/imgs/卜卜.png', import.meta.url).href
|
||||
const ztmyoUrl = new URL('@/assets/imgs/ztmyo.png', import.meta.url).href
|
||||
const liciUrl = new URL('@/assets/imgs/栗次元.ico', import.meta.url).href
|
||||
const xiaRouUrl = new URL('@/assets/imgs/夏柔.ico', import.meta.url).href
|
||||
|
@@ -8,16 +8,16 @@
|
||||
|
||||
<div class="auth-content">
|
||||
<div class="auth-header">
|
||||
<h2 class="auth-title">{{ isLoginMode ? '登录小石榴' : '注册小石榴' }}</h2>
|
||||
<h2 class="auth-title">{{ isLoginMode ? '登录卜卜' : '注册卜卜' }}</h2>
|
||||
<p class="auth-subtitle">{{ isLoginMode ? '欢迎回来!' : '加入我们,开始分享美好生活' }}</p>
|
||||
</div>
|
||||
|
||||
<form @submit.prevent="handleSubmit" class="auth-form">
|
||||
<div class="form-group">
|
||||
<label for="user_id" class="form-label">小石榴号</label>
|
||||
<label for="user_id" class="form-label">卜卜号</label>
|
||||
<input type="text" id="user_id" v-model="formData.user_id" class="form-input"
|
||||
:class="{ 'error': showErrors && errors.user_id }"
|
||||
:placeholder="isLoginMode ? '请输入小石榴号' : '请输入小石榴号(3-15位字母数字下划线)'" maxlength="15"
|
||||
:placeholder="isLoginMode ? '请输入卜卜号' : '请输入卜卜号(3-15位字母数字下划线)'" maxlength="15"
|
||||
@input="clearError('user_id')" />
|
||||
<span v-if="showErrors && errors.user_id" class="error-message">{{ errors.user_id }}</span>
|
||||
</div>
|
||||
@@ -149,17 +149,17 @@ const validateUserId = async () => {
|
||||
errors.user_id = ''
|
||||
|
||||
if (!formData.user_id.trim()) {
|
||||
errors.user_id = '请输入小石榴号'
|
||||
errors.user_id = '请输入卜卜号'
|
||||
return
|
||||
}
|
||||
|
||||
if (formData.user_id.length < 3 || formData.user_id.length > 15) {
|
||||
errors.user_id = '小石榴号长度必须在3-15位之间'
|
||||
errors.user_id = '卜卜号长度必须在3-15位之间'
|
||||
return
|
||||
}
|
||||
|
||||
if (!/^[a-zA-Z0-9_]+$/.test(formData.user_id)) {
|
||||
errors.user_id = '小石榴号只能包含字母、数字和下划线'
|
||||
errors.user_id = '卜卜号只能包含字母、数字和下划线'
|
||||
return
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ const validateUserId = async () => {
|
||||
|
||||
if (result.code === 200) {
|
||||
if (!result.data.isUnique) {
|
||||
errors.user_id = '小石榴号已存在'
|
||||
errors.user_id = '卜卜号已存在'
|
||||
return
|
||||
}
|
||||
} else {
|
||||
@@ -325,7 +325,7 @@ const handleSubmit = async () => {
|
||||
}
|
||||
|
||||
if (isUserIdEmpty) {
|
||||
unifiedMessage.value = '请输入小石榴号'
|
||||
unifiedMessage.value = '请输入卜卜号'
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* 小石榴校园图文社区 - Vue3前端应用
|
||||
* 卜卜校园图文社区 - Vue3前端应用
|
||||
*
|
||||
* @author ZTMYO
|
||||
* @github https://github.com/ZTMYO
|
||||
|
@@ -3,7 +3,7 @@ import { ref } from 'vue'
|
||||
|
||||
/**
|
||||
* 关于模态框状态管理
|
||||
* 集中管理关于小石榴模态框的显示状态
|
||||
* 集中管理关于卜卜模态框的显示状态
|
||||
*/
|
||||
export const useAboutStore = defineStore('about', () => {
|
||||
// 模态框显示状态
|
||||
|
@@ -56,7 +56,7 @@ export const useCommentStore = defineStore('comment', () => {
|
||||
// 处理顶级评论数据格式
|
||||
const parentComments = response.data.comments.map(comment => ({
|
||||
id: comment.id,
|
||||
user_id: comment.user_display_id || comment.user_id, // 小石榴号(用于导航)
|
||||
user_id: comment.user_display_id || comment.user_id, // 卜卜号(用于导航)
|
||||
user_auto_id: comment.user_auto_id || comment.user_id, // 用户自增ID(用于权限判断)
|
||||
username: comment.nickname || '匿名用户',
|
||||
avatar: comment.user_avatar || new URL('@/assets/imgs/avatar.png', import.meta.url).href,
|
||||
@@ -101,7 +101,7 @@ export const useCommentStore = defineStore('comment', () => {
|
||||
|
||||
return {
|
||||
id: reply.id,
|
||||
user_id: reply.user_display_id || reply.user_id, // 小石榴号(用于导航)
|
||||
user_id: reply.user_display_id || reply.user_id, // 卜卜号(用于导航)
|
||||
user_auto_id: reply.user_auto_id || reply.user_id, // 用户自增ID(用于权限判断)
|
||||
username: reply.nickname || '匿名用户',
|
||||
avatar: reply.user_avatar || new URL('@/assets/imgs/未加载.png', import.meta.url).href,
|
||||
|
@@ -56,7 +56,7 @@ export function parseMentions(text) {
|
||||
const mentionRegex = /\[@([^:]+):([^\]]+)\]/g
|
||||
|
||||
let result = escapedText.replace(mentionRegex, (match, nickname, userId) => {
|
||||
// 生成用户主页链接,使用小石榴号作为路由参数
|
||||
// 生成用户主页链接,使用卜卜号作为路由参数
|
||||
return `<a href="/user/${userId}" class="mention-link" data-user-id="${userId}" contenteditable="false">@${nickname}</a>`
|
||||
})
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<div class="logo-icon">
|
||||
<img :src="logoUrl" alt="logo">
|
||||
</div>
|
||||
<h2 class="logo-text">小石榴管理后台</h2>
|
||||
<h2 class="logo-text">卜卜管理后台</h2>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="sidebar-nav">
|
||||
@@ -146,7 +146,7 @@ const themeStore = useThemeStore()
|
||||
const { confirmState, handleConfirm, handleCancel, confirmLogout } = useConfirm()
|
||||
const { lock, unlock } = useScrollLock()
|
||||
|
||||
const logoUrl = new URL('@/assets/imgs/小石榴.png', import.meta.url).href
|
||||
const logoUrl = new URL('@/assets/imgs/卜卜.png', import.meta.url).href
|
||||
|
||||
const indicatorPosition = computed(() => {
|
||||
const index = themeStore.themeOptions.findIndex(option => option.value === themeStore.currentTheme)
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<div class="login-card">
|
||||
|
||||
<div class="login-header">
|
||||
<h1 class="login-title">小石榴管理后台</h1>
|
||||
<h1 class="login-title">卜卜管理后台</h1>
|
||||
</div>
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="api-docs">
|
||||
<div class="docs-header">
|
||||
<h2>小石榴图文社区 API 接口文档</h2>
|
||||
<h2>卜卜世界 API 接口文档</h2>
|
||||
<div class="docs-info">
|
||||
<span class="version">版本: v1.2.0</span>
|
||||
<span class="base-url">基础URL: http://localhost:3001/</span>
|
||||
@@ -249,7 +249,7 @@ const apiGroups = ref([
|
||||
description: '用户注册接口,支持IP属地自动获取',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_id', type: 'string', required: true, description: '小石榴号(3-15位,字母数字下划线)' },
|
||||
{ name: 'user_id', type: 'string', required: true, description: '卜卜号(3-15位,字母数字下划线)' },
|
||||
{ name: 'nickname', type: 'string', required: true, description: '昵称(2-10位)' },
|
||||
{ name: 'password', type: 'string', required: true, description: '密码(6-20位)' },
|
||||
{ name: 'avatar', type: 'string', required: false, description: '头像URL' },
|
||||
@@ -284,7 +284,7 @@ const apiGroups = ref([
|
||||
description: '用户登录接口,返回JWT令牌',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'password', type: 'string', required: true, description: '密码' }
|
||||
],
|
||||
example: `{
|
||||
@@ -378,7 +378,7 @@ const apiGroups = ref([
|
||||
method: 'GET',
|
||||
path: '/api/users/search',
|
||||
title: '搜索用户',
|
||||
description: '根据关键词搜索用户(昵称或小石榴号)',
|
||||
description: '根据关键词搜索用户(昵称或卜卜号)',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'keyword', type: 'string', required: true, description: '搜索关键词' },
|
||||
@@ -390,10 +390,10 @@ const apiGroups = ref([
|
||||
method: 'GET',
|
||||
path: '/api/users/:id',
|
||||
title: '获取用户详情',
|
||||
description: '根据小石榴号获取用户详细信息',
|
||||
description: '根据卜卜号获取用户详细信息',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' }
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -403,7 +403,7 @@ const apiGroups = ref([
|
||||
description: '获取指定用户发布的笔记列表',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' }
|
||||
]
|
||||
@@ -415,7 +415,7 @@ const apiGroups = ref([
|
||||
description: '获取指定用户收藏的笔记列表',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' }
|
||||
]
|
||||
@@ -427,7 +427,7 @@ const apiGroups = ref([
|
||||
description: '获取指定用户点赞的笔记列表',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' }
|
||||
]
|
||||
@@ -440,7 +440,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '被关注用户的小石榴号' }
|
||||
{ name: 'id', type: 'string', required: true, description: '被关注用户的卜卜号' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -451,7 +451,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '被取消关注用户的小石榴号' }
|
||||
{ name: 'id', type: 'string', required: true, description: '被取消关注用户的卜卜号' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -462,7 +462,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '目标用户的小石榴号' }
|
||||
{ name: 'id', type: 'string', required: true, description: '目标用户的卜卜号' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -472,7 +472,7 @@ const apiGroups = ref([
|
||||
description: '获取指定用户的关注列表',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' }
|
||||
]
|
||||
@@ -484,7 +484,7 @@ const apiGroups = ref([
|
||||
description: '获取指定用户的粉丝列表',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' }
|
||||
]
|
||||
@@ -496,7 +496,7 @@ const apiGroups = ref([
|
||||
description: '获取与指定用户互相关注的用户列表',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' }
|
||||
]
|
||||
@@ -508,7 +508,7 @@ const apiGroups = ref([
|
||||
description: '获取指定用户的统计信息(关注数、粉丝数等)',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'id', type: 'string', required: true, description: '小石榴号' }
|
||||
{ name: 'id', type: 'string', required: true, description: '卜卜号' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -950,7 +950,7 @@ const apiGroups = ref([
|
||||
description: '搜索笔记和用户,支持关键词和标签筛选,支持按类型过滤',
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'keyword', type: 'string', required: false, description: '搜索关键词(支持搜索小石榴号、昵称、标题、正文内容、标签名称)' },
|
||||
{ name: 'keyword', type: 'string', required: false, description: '搜索关键词(支持搜索卜卜号、昵称、标题、正文内容、标签名称)' },
|
||||
{ name: 'tag', type: 'string', required: false, description: '标签搜索(精确匹配标签名称)' },
|
||||
{ name: 'type', type: 'string', required: false, description: '搜索类型:all(默认,所有类型)、posts(图文笔记)、videos(视频笔记)、users(用户)' },
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
@@ -1409,7 +1409,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(用户名或昵称)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, fans_count, like_count, created_at)' },
|
||||
{ name: 'sortOrder', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1422,7 +1422,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_id', type: 'string', required: true, description: '小石榴号' },
|
||||
{ name: 'user_id', type: 'string', required: true, description: '卜卜号' },
|
||||
{ name: 'nickname', type: 'string', required: true, description: '昵称' },
|
||||
{ name: 'password', type: 'string', required: true, description: '密码' },
|
||||
{ name: 'avatar', type: 'string', required: false, description: '头像URL' },
|
||||
@@ -1478,7 +1478,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(标题或内容)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按作者小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按作者卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, like_count, comment_count, created_at)' },
|
||||
{ name: 'sortOrder', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1494,7 +1494,7 @@ const apiGroups = ref([
|
||||
{ name: 'title', type: 'string', required: true, description: '笔记标题' },
|
||||
{ name: 'content', type: 'string', required: true, description: '笔记内容' },
|
||||
{ name: 'category_id', type: 'int', required: false, description: '分类ID' },
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '发布用户小石榴号' }
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '发布用户卜卜号' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1544,7 +1544,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(评论内容)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按评论者小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按评论者卜卜号筛选' },
|
||||
{ name: 'post_id', type: 'int', required: false, description: '按笔记ID筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, like_count, created_at)' },
|
||||
{ name: 'sortOrder', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
@@ -1670,7 +1670,7 @@ const apiGroups = ref([
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'type', type: 'int', required: false, description: '认证类型筛选(1-个人认证,2-企业认证)' },
|
||||
{ name: 'status', type: 'int', required: false, description: '审核状态筛选(0-待审核,1-已通过,2-已拒绝)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '用户小石榴号搜索' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '用户卜卜号搜索' },
|
||||
{ name: 'real_name', type: 'string', required: false, description: '真实姓名搜索' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, created_at, audit_time)' },
|
||||
{ name: 'sortOrder', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
@@ -1721,7 +1721,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(用户名)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, user_id, created_at)' },
|
||||
{ name: 'sortOrder', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1734,7 +1734,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '用户小石榴号' },
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '用户卜卜号' },
|
||||
{ name: 'target_type', type: 'int', required: true, description: '目标类型(1-笔记, 2-评论)' },
|
||||
{ name: 'target_id', type: 'int', required: true, description: '目标ID' }
|
||||
]
|
||||
@@ -1772,7 +1772,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(用户名或笔记标题)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, user_id, created_at)' },
|
||||
{ name: 'sortOrder', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1785,7 +1785,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '用户小石榴号' },
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '用户卜卜号' },
|
||||
{ name: 'post_id', type: 'int', required: true, description: '笔记ID' }
|
||||
]
|
||||
},
|
||||
@@ -1822,7 +1822,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(用户名)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, follower_id, following_id, created_at)' },
|
||||
{ name: 'order', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1884,7 +1884,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(通知内容)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按接收用户小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按接收用户卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(username, created_at)' },
|
||||
{ name: 'order', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1897,7 +1897,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '接收用户小石榴号' },
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '接收用户卜卜号' },
|
||||
{ name: 'type', type: 'string', required: true, description: '通知类型' },
|
||||
{ name: 'content', type: 'string', required: true, description: '通知内容' }
|
||||
]
|
||||
@@ -1948,7 +1948,7 @@ const apiGroups = ref([
|
||||
{ name: 'page', type: 'int', required: false, description: '页码,默认1' },
|
||||
{ name: 'limit', type: 'int', required: false, description: '每页数量,默认20' },
|
||||
{ name: 'search', type: 'string', required: false, description: '搜索关键词(用户名或IP)' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户小石榴号筛选' },
|
||||
{ name: 'user_display_id', type: 'string', required: false, description: '按用户卜卜号筛选' },
|
||||
{ name: 'sortField', type: 'string', required: false, description: '排序字段(id, created_at, last_activity)' },
|
||||
{ name: 'order', type: 'string', required: false, description: '排序方向(asc, desc),默认desc' }
|
||||
]
|
||||
@@ -1961,7 +1961,7 @@ const apiGroups = ref([
|
||||
auth: true,
|
||||
expanded: false,
|
||||
params: [
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '用户小石榴号' },
|
||||
{ name: 'user_display_id', type: 'string', required: true, description: '用户卜卜号' },
|
||||
{ name: 'user_agent', type: 'string', required: false, description: '用户代理' }
|
||||
]
|
||||
},
|
||||
|
@@ -82,7 +82,7 @@ const getAuthHeaders = () => {
|
||||
// 表格列定义
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', sortable: true },
|
||||
{ key: 'user_display_id', label: '用户小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'nickname', label: '用户昵称', sortable: false },
|
||||
{
|
||||
key: 'type',
|
||||
@@ -139,7 +139,7 @@ const formFields = computed(() => [
|
||||
|
||||
// 搜索字段定义
|
||||
const searchFields = [
|
||||
{ key: 'user_display_id', label: '用户小石榴号', placeholder: '搜索用户小石榴号' },
|
||||
{ key: 'user_display_id', label: '用户卜卜号', placeholder: '搜索用户卜卜号' },
|
||||
{
|
||||
key: 'type',
|
||||
label: '认证类型',
|
||||
|
@@ -9,7 +9,7 @@ import CrudTable from '@/views/admin/components/CrudTable.vue'
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', sortable: true },
|
||||
{ key: 'user_id', label: '用户ID', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'post_id', label: '笔记ID',type:'post-link', sortable: false },
|
||||
{ key: 'post_title', label: '笔记标题', type: 'content', sortable: false },
|
||||
{ key: 'created_at', label: '收藏时间', type: 'date', sortable: true }
|
||||
@@ -21,7 +21,7 @@ const formFields = [
|
||||
]
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'user_display_id', label: '小石榴号', placeholder: '搜索用户小石榴号' },
|
||||
{ key: 'user_display_id', label: '卜卜号', placeholder: '搜索用户卜卜号' },
|
||||
{ key: 'post_id', label: '笔记ID', placeholder: '搜索笔记ID' }
|
||||
]
|
||||
</script>
|
@@ -10,7 +10,7 @@ const columns = [
|
||||
{ key: 'id', label: 'ID', type: 'comment-link', sortable: true },
|
||||
{ key: 'content', label: '内容', type: 'content', sortable: false },
|
||||
{ key: 'user_id', label: '评论者ID', sortable: false },
|
||||
{ key: 'user_display_id', label: '评论者小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_display_id', label: '评论者卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'post_id', label: '笔记ID', sortable: false },
|
||||
{ key: 'parent_id', label: '父评论ID', sortable: false },
|
||||
{ key: 'like_count', label: '点赞数', sortable: true },
|
||||
@@ -25,7 +25,7 @@ const formFields = [
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'post_id', label: '笔记ID', placeholder: '搜索笔记ID' },
|
||||
{ key: 'user_display_id', label: '小石榴号', placeholder: '搜索用户小石榴号' },
|
||||
{ key: 'user_display_id', label: '卜卜号', placeholder: '搜索用户卜卜号' },
|
||||
{ key: 'content', label: '内容', placeholder: '搜索评论内容' }
|
||||
]
|
||||
</script>
|
@@ -9,10 +9,10 @@ import CrudTable from '@/views/admin/components/CrudTable.vue'
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', sortable: true },
|
||||
{ key: 'follower_id', label: '关注者ID', sortable: false },
|
||||
{ key: 'follower_display_id', label: '关注者小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'follower_display_id', label: '关注者卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'follower_nickname', label: '关注者昵称', sortable: false },
|
||||
{ key: 'following_id', label: '被关注者ID', sortable: false },
|
||||
{ key: 'following_display_id', label: '被关注者小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'following_display_id', label: '被关注者卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'following_nickname', label: '被关注者昵称', sortable: false },
|
||||
{ key: 'created_at', label: '关注时间', type: 'date', sortable: true }
|
||||
]
|
||||
@@ -23,7 +23,7 @@ const formFields = [
|
||||
]
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'follower_display_id', label: '关注者小石榴号', placeholder: '搜索关注者小石榴号' },
|
||||
{ key: 'following_display_id', label: '被关注者小石榴号', placeholder: '搜索被关注者小石榴号' }
|
||||
{ key: 'follower_display_id', label: '关注者卜卜号', placeholder: '搜索关注者卜卜号' },
|
||||
{ key: 'following_display_id', label: '被关注者卜卜号', placeholder: '搜索被关注者卜卜号' }
|
||||
]
|
||||
</script>
|
@@ -15,7 +15,7 @@ const targetTypeMap = {
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', sortable: true },
|
||||
{ key: 'user_id', label: '用户ID', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'target_type', label: '目标类型', type: 'mapped', map: targetTypeMap, sortable: false },
|
||||
{ key: 'target_id', label: '目标ID', sortable: false },
|
||||
{ key: 'created_at', label: '点赞时间', type: 'date', sortable: true }
|
||||
@@ -37,7 +37,7 @@ const formFields = [
|
||||
]
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'user_display_id', label: '小石榴号', placeholder: '搜索用户小石榴号' },
|
||||
{ key: 'user_display_id', label: '卜卜号', placeholder: '搜索用户卜卜号' },
|
||||
{
|
||||
key: 'target_type',
|
||||
label: '目标类型',
|
||||
|
@@ -33,7 +33,7 @@ const columns = [
|
||||
]
|
||||
|
||||
const formFields = [
|
||||
{ key: 'user_id', label: '接收者小石榴号', type: 'number', required: true, placeholder: '请输入接收者小石榴号' },
|
||||
{ key: 'user_id', label: '接收者卜卜号', type: 'number', required: true, placeholder: '请输入接收者卜卜号' },
|
||||
{ key: 'sender_id', label: '发送者ID', type: 'number', required: true, placeholder: '请输入发送者ID' },
|
||||
{
|
||||
key: 'type',
|
||||
@@ -58,7 +58,7 @@ const formFields = [
|
||||
]
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'user_display_id', label: '接收者小石榴号', placeholder: '搜索接收者小石榴号' },
|
||||
{ key: 'user_display_id', label: '接收者卜卜号', placeholder: '搜索接收者卜卜号' },
|
||||
{
|
||||
key: 'type',
|
||||
label: '通知类型',
|
||||
|
@@ -29,7 +29,7 @@ onMounted(() => {
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', type: 'post-link', sortable: true },
|
||||
{ key: 'title', label: '标题', type: 'content', sortable: false },
|
||||
{ key: 'user_display_id', label: '小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_display_id', label: '卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'category', label: '分类', sortable: false },
|
||||
{ key: 'type', label: '类型', type: 'mapped', map: { 1: '图文', 2: '视频' }, sortable: false },
|
||||
{ key: 'is_draft', label: '草稿', sortable: false, type: 'boolean', trueText: '是', falseText: '否' },
|
||||
@@ -114,6 +114,6 @@ const searchFields = computed(() => [
|
||||
{ value: '1', label: '草稿' }
|
||||
]
|
||||
},
|
||||
{ key: 'user_display_id', label: '作者小石榴号', placeholder: '搜索作者小石榴号' }
|
||||
{ key: 'user_display_id', label: '作者卜卜号', placeholder: '搜索作者卜卜号' }
|
||||
])
|
||||
</script>
|
@@ -9,7 +9,7 @@ import CrudTable from '@/views/admin/components/CrudTable.vue'
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', sortable: true },
|
||||
{ key: 'user_id', label: '用户ID', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户小石榴号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_display_id', label: '用户卜卜号', type: 'user-link', sortable: false },
|
||||
{ key: 'user_agent', label: '用户代理', type: 'content', sortable: false },
|
||||
{ key: 'is_active', label: '活跃状态', type: 'boolean' },
|
||||
{ key: 'expires_at', label: '过期时间', type: 'date', sortable: true },
|
||||
@@ -23,7 +23,7 @@ const formFields = [
|
||||
]
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'user_display_id', label: '小石榴号', placeholder: '搜索用户小石榴号' },
|
||||
{ key: 'user_display_id', label: '卜卜号', placeholder: '搜索用户卜卜号' },
|
||||
{
|
||||
key: 'is_active',
|
||||
label: '活跃状态',
|
||||
|
@@ -7,7 +7,7 @@
|
||||
import CrudTable from '@/views/admin/components/CrudTable.vue'
|
||||
const columns = [
|
||||
{ key: 'id', label: 'ID', sortable: true },
|
||||
{ key: 'user_id', label: '小石榴号', type: 'user-link', sortable: false, maxLength: 15 },
|
||||
{ key: 'user_id', label: '卜卜号', type: 'user-link', sortable: false, maxLength: 15 },
|
||||
{ key: 'nickname', label: '用户昵称', sortable: false },
|
||||
{ key: 'avatar', label: '头像', type: 'image', sortable: false },
|
||||
{ key: 'bio', label: '个人简介', type: 'content', sortable: false },
|
||||
@@ -21,7 +21,7 @@ const columns = [
|
||||
]
|
||||
|
||||
const formFields = [
|
||||
{ key: 'user_id', label: '小石榴号', type: 'text', required: true, placeholder: '请输入小石榴号', maxlength: 15 },
|
||||
{ key: 'user_id', label: '卜卜号', type: 'text', required: true, placeholder: '请输入卜卜号', maxlength: 15 },
|
||||
{ key: 'nickname', label: '昵称', type: 'text', required: true, placeholder: '请输入昵称', maxlength: 10 },
|
||||
{ key: 'avatar', label: '头像', type: 'avatar-upload', placeholder: '上传头像' },
|
||||
{ key: 'avatar', label: '头像URL', type: 'text', placeholder: '请输入头像URL或使用上方上传功能' },
|
||||
@@ -91,7 +91,7 @@ const formFields = [
|
||||
]
|
||||
|
||||
const searchFields = [
|
||||
{ key: 'user_id', label: '小石榴号', placeholder: '搜索小石榴号' },
|
||||
{ key: 'user_id', label: '卜卜号', placeholder: '搜索卜卜号' },
|
||||
{ key: 'nickname', label: '昵称', placeholder: '搜索昵称' },
|
||||
{ key: 'location', label: '属地', placeholder: '搜索属地' },
|
||||
{
|
||||
|
@@ -1134,7 +1134,7 @@ const openUserProfile = async (item, fieldKey) => {
|
||||
try {
|
||||
let userDisplayId = null
|
||||
|
||||
// 根据点击的字段获取对应的小石榴号
|
||||
// 根据点击的字段获取对应的卜卜号
|
||||
if (fieldKey) {
|
||||
userDisplayId = item[fieldKey]
|
||||
} else {
|
||||
@@ -1152,7 +1152,7 @@ const openUserProfile = async (item, fieldKey) => {
|
||||
// 在新标签页中打开
|
||||
window.open(userProfileUrl, '_blank')
|
||||
} else {
|
||||
console.error('无法获取用户的小石榴号,字段:', fieldKey, '数据:', item)
|
||||
console.error('无法获取用户的卜卜号,字段:', fieldKey, '数据:', item)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取用户信息失败:', error)
|
||||
|
@@ -12,7 +12,7 @@ const route = useRoute()
|
||||
const searchHistoryStore = useSearchHistoryStore()
|
||||
|
||||
// 静态资源URL
|
||||
const logoUrl = new URL('@/assets/imgs/小石榴.png', import.meta.url).href
|
||||
const logoUrl = new URL('@/assets/imgs/卜卜.png', import.meta.url).href
|
||||
|
||||
const isLargeScreen = ref(window.innerWidth > 695)
|
||||
const showSidebar = ref(window.innerWidth > 960)
|
||||
@@ -175,12 +175,12 @@ onUnmounted(() => {
|
||||
<div class="header-container">
|
||||
<template v-if="displaySearch">
|
||||
<div v-if="isLargeScreen" class="logo" @click="router.push('/')">
|
||||
<img :src="logoUrl" alt="小石榴" />
|
||||
<img :src="logoUrl" alt="卜卜" />
|
||||
</div>
|
||||
<div class="search-row" :class="{ 'large-screen': isLargeScreen, 'small-screen': !isLargeScreen }">
|
||||
<div class="search-bar-container">
|
||||
<div class="search-bar">
|
||||
<input v-model="searchText" type="text" placeholder="搜索小石榴" @keypress="handleKeyPress"
|
||||
<input v-model="searchText" type="text" placeholder="搜索卜卜" @keypress="handleKeyPress"
|
||||
@focus="handleSearchFocus" @blur="handleSearchBlur" />
|
||||
<div class="input-controls">
|
||||
<div class="clear-btn" @click="clearInput"
|
||||
@@ -215,7 +215,7 @@ onUnmounted(() => {
|
||||
|
||||
<template v-else>
|
||||
<div class="logo" @click="router.push('/')">
|
||||
<img :src="logoUrl" alt="小石榴" />
|
||||
<img :src="logoUrl" alt="卜卜" />
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<div @click="openSearch" class="circle-btn">
|
||||
|
@@ -208,7 +208,7 @@ async function loadLikesData(isLoadMore = false) {
|
||||
// 转换后端数据格式为前端期望的格式
|
||||
const transformedData = (response.data?.notifications || []).map(item => ({
|
||||
notificationId: item.id, // 通知ID,用于标记已读
|
||||
id: item.from_user_id, // 使用from_user_id字段(小石榴号)用于导航
|
||||
id: item.from_user_id, // 使用from_user_id字段(卜卜号)用于导航
|
||||
autoId: item.from_user_auto_id, // 自增ID,用于API调用
|
||||
username: item.from_nickname || '未知用户',
|
||||
avatar: item.from_avatar || new URL('@/assets/imgs/avatar.png', import.meta.url).href,
|
||||
@@ -303,7 +303,7 @@ async function loadFollowsData(isLoadMore = false) {
|
||||
|
||||
return {
|
||||
notificationId: item.id, // 通知ID,用于标记已读
|
||||
id: item.from_user_id, // 使用from_user_id字段(小石榴号)用于导航
|
||||
id: item.from_user_id, // 使用from_user_id字段(卜卜号)用于导航
|
||||
from_user_id: item.from_user_id, // 添加from_user_id字段供FollowButton使用
|
||||
autoId: item.from_user_auto_id, // 自增ID,用于API调用
|
||||
username: item.from_nickname || '未知用户',
|
||||
@@ -361,7 +361,7 @@ async function loadCollectionsData(isLoadMore = false) {
|
||||
// 转换后端数据格式为前端期望的格式
|
||||
const transformedData = (response.data?.notifications || []).map(item => ({
|
||||
notificationId: item.id, // 通知ID,用于标记已读
|
||||
id: item.from_user_id, // 使用from_user_id字段(小石榴号)用于导航
|
||||
id: item.from_user_id, // 使用from_user_id字段(卜卜号)用于导航
|
||||
autoId: item.from_user_auto_id, // 自增ID,用于API调用
|
||||
username: item.from_nickname || '未知用户',
|
||||
avatar: item.from_avatar || new URL('@/assets/imgs/avatar.png', import.meta.url).href,
|
||||
@@ -704,7 +704,7 @@ const getUserHoverConfig = (userId) => {
|
||||
console.error('获取用户笔记封面失败:', error)
|
||||
}
|
||||
|
||||
// 获取最新的关注状态 - 使用小石榴号来获取关注状态
|
||||
// 获取最新的关注状态 - 使用卜卜号来获取关注状态
|
||||
let followStatus = { followed: false, isMutual: false, buttonType: 'follow' }
|
||||
try {
|
||||
const followResponse = await followStore.fetchFollowStatus(userId)
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<h3 class="user-nickname" v-user-hover="userHoverConfig">{{ user.nickname }}</h3>
|
||||
<VerifiedBadge :verified="user.verified" />
|
||||
</div>
|
||||
<div class="user-id">小石榴号:{{ user.userId }}</div>
|
||||
<div class="user-id">卜卜号:{{ user.userId }}</div>
|
||||
<div class="user-stats">
|
||||
<span class="stat-item">粉丝 · {{ formatNumber(user.followers) }}</span>
|
||||
<span class="stat-item">笔记 · {{ formatNumber(user.post_count) }}</span>
|
||||
@@ -76,8 +76,8 @@ const isCurrentUser = computed(() => {
|
||||
return false
|
||||
}
|
||||
|
||||
const currentUserId = userStore.userInfo.user_id // 当前用户的小石榴号
|
||||
const userId = props.user.user_id || props.user.userId // 用户的小石榴号
|
||||
const currentUserId = userStore.userInfo.user_id // 当前用户的卜卜号
|
||||
const userId = props.user.user_id || props.user.userId // 用户的卜卜号
|
||||
|
||||
return currentUserId === userId
|
||||
})
|
||||
@@ -220,11 +220,11 @@ const userHoverConfig = computed(() => ({
|
||||
},
|
||||
onFollow: (userInfo) => {
|
||||
const userId = props.user.user_id || props.user.userId
|
||||
handleFollow(userId) // 使用小石榴号进行关注操作
|
||||
handleFollow(userId) // 使用卜卜号进行关注操作
|
||||
},
|
||||
onUnfollow: (userInfo) => {
|
||||
const userId = props.user.user_id || props.user.userId
|
||||
handleUnfollow(userId) // 使用小石榴号进行取消关注操作
|
||||
handleUnfollow(userId) // 使用卜卜号进行取消关注操作
|
||||
},
|
||||
delay: 500
|
||||
}))
|
||||
|
@@ -266,7 +266,7 @@ onMounted(async () => {
|
||||
<VerifiedBadge :verified="userInfo?.verified" size="large" />
|
||||
</div>
|
||||
<div class="user-content">
|
||||
<div class="user-id text-ellipsis">小石榴号:{{ userInfo?.user_id || '' }}</div>
|
||||
<div class="user-id text-ellipsis">卜卜号:{{ userInfo?.user_id || '' }}</div>
|
||||
<div class="user-IP text-ellipsis">IP属地:{{ userInfo?.location || '未知' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -322,7 +322,7 @@ function handleCollect(data) {
|
||||
<VerifiedBadge v-if="userStore.userInfo?.verified" :verified="userStore.userInfo.verified" size="large"/>
|
||||
</div>
|
||||
<div class="user-content">
|
||||
<div class="user-id text-ellipsis">小石榴号:{{ userStore.userInfo?.user_id || '' }}</div>
|
||||
<div class="user-id text-ellipsis">卜卜号:{{ userStore.userInfo?.user_id || '' }}</div>
|
||||
<div class="user-IP text-ellipsis">IP属地:{{ userStore.userInfo?.location || '未知' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* 小石榴校园图文社区 - Vite配置文件
|
||||
* 卜卜校园图文社区 - Vite配置文件
|
||||
*
|
||||
* @author ZTMYO
|
||||
* @github https://github.com/ZTMYO
|
||||
|
Reference in New Issue
Block a user