fix problems
All checks were successful
Xiaoshiliu / build (push) Successful in 3m49s

This commit is contained in:
lychang
2025-10-04 22:21:26 +08:00
parent 0dca79c5f5
commit 3fd71180ca
38 changed files with 128 additions and 128 deletions

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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}%`];

View File

@@ -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: '用户不存在' });

View File

@@ -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(),

View File

@@ -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 '个人简介',

View File

@@ -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 '个人简介',

View File

@@ -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 {

View File

@@ -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

View File

@@ -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')
}

View File

@@ -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

View File

@@ -49,7 +49,7 @@ const handleMenuClick = (action) => {
<template>
<DropdownItem @click="handleMenuClick('about')">
关于卜卜
关于人生无限公司
</DropdownItem>
<DropdownItem @click="handleMenuClick('keyboardShortcuts')">
键盘快捷键

View File

@@ -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>&copy; 2025 卜卜校园图文社区. Made with by @ZTMYO</p>
<p>&copy; 2025 人生无限公司. Made with by @ZTMYO</p>
</div>
</div>
</div>

View File

@@ -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
}

View File

@@ -1,5 +1,5 @@
/**
* 卜卜校园图文社区 - Vue3前端应用
* 人生无限公司 - Vue3前端应用
*
* @author ZTMYO
* @github https://github.com/ZTMYO

View File

@@ -3,7 +3,7 @@ import { ref } from 'vue'
/**
* 关于模态框状态管理
* 集中管理关于卜卜模态框的显示状态
* 集中管理关于模态框的显示状态
*/
export const useAboutStore = defineStore('about', () => {
// 模态框显示状态

View File

@@ -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,

View File

@@ -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>`
})

View File

@@ -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">

View File

@@ -4,7 +4,7 @@
<div class="login-card">
<div class="login-header">
<h1 class="login-title">卜卜管理后台</h1>
<h1 class="login-title">公司管理后台</h1>
</div>

View File

@@ -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: '用户代理' }
]
},

View File

@@ -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: '认证类型',

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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: '目标类型',

View File

@@ -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: '通知类型',

View File

@@ -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>

View File

@@ -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: '活跃状态',

View File

@@ -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: '搜索属地' },
{

View File

@@ -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)

View File

@@ -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">

View File

@@ -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)

View File

@@ -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
}))

View File

@@ -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>

View File

@@ -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>