安卓会议重构

dev_na
chenhao 2026-06-05 15:07:45 +08:00
parent 40bf049a0e
commit 2e20799b4b
75 changed files with 7783 additions and 1350 deletions

View File

@ -16,6 +16,10 @@ public final class MeetingConstants {
public static final String DEVICE_DELIVERY_EXPIRED = "EXPIRED";
public static final String DEVICE_DELIVERY_CANCELLED = "CANCELLED";
public static final String OFFLINE_RECORDING_ACTIVE = "ACTIVE";
public static final String OFFLINE_RECORDING_PRE_END = "PRE_END";
public static final String OFFLINE_RECORDING_UPLOAD_FINISHED = "UPLOAD_FINISHED";
public static final String SUMMARY_DETAIL_DETAILED = "DETAILED";
public static final String SUMMARY_DETAIL_STANDARD = "STANDARD";
public static final String SUMMARY_DETAIL_BRIEF = "BRIEF";

View File

@ -115,8 +115,8 @@ public final class RedisKeys {
return "biz:meeting:public-session:" + sessionId;
}
public static String androidChunkUploadSessionKey(String uploadSessionId) {
return "biz:meeting:android:chunk-upload:" + uploadSessionId;
public static String androidChunkUploadSessionKey(Long meetingId) {
return "biz:meeting:android:chunk-upload:" + meetingId;
}
public static String androidPendingMeetingDraftKey(Long meetingId) {

View File

@ -43,18 +43,16 @@ public class AndroidMeetingChunkUploadController {
@Anonymous
public ApiResponse<Boolean> uploadChunk(HttpServletRequest request,
@RequestParam("meeting_id") Long meetingId,
@RequestParam("upload_session_id") String uploadSessionId,
@RequestParam("chunk_index") Integer chunkIndex,
@RequestParam("total_chunks") Integer totalChunks,
@RequestParam("chunk_file") MultipartFile chunkFile) throws IOException {
AndroidRequestLogHelper.logRequest(log, "Android会议", "上传会议音频分片",
"meetingId", meetingId,
"uploadSessionId", uploadSessionId,
"chunkIndex", chunkIndex,
"totalChunks", totalChunks,
"chunkFile", chunkFile);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
androidChunkUploadService.saveChunk(meetingId, uploadSessionId, chunkIndex, totalChunks, chunkFile, authContext);
androidChunkUploadService.saveChunk(meetingId, chunkIndex, totalChunks, chunkFile, authContext);
return ApiResponse.ok(true);
}
@ -69,25 +67,10 @@ public class AndroidMeetingChunkUploadController {
@PostMapping("/complete")
@Anonymous
public ApiResponse<LegacyUploadAudioResponse> completeUpload(HttpServletRequest request,
@RequestParam("meeting_id") Long meetingId,
@RequestParam("upload_session_id") String uploadSessionId,
@RequestParam(value = "force_replace", defaultValue = "false") boolean forceReplace,
@RequestParam(value = "prompt_id", required = false) Long promptId,
@RequestParam(value = "model_code", required = false) String modelCode) throws IOException {
@RequestParam("meeting_id") Long meetingId) throws IOException {
AndroidRequestLogHelper.logRequest(log, "Android会议", "完成分片上传",
"meetingId", meetingId,
"uploadSessionId", uploadSessionId,
"forceReplace", forceReplace,
"promptId", promptId,
"modelCode", modelCode);
"meetingId", meetingId);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
return ApiResponse.ok(androidChunkUploadService.completeUpload(
meetingId,
uploadSessionId,
forceReplace,
promptId,
modelCode,
authContext
));
return ApiResponse.ok(androidChunkUploadService.completeUpload(meetingId, authContext));
}
}

View File

@ -2,9 +2,13 @@ package com.imeeting.controller.android;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.imeeting.common.MeetingConstants;
import com.imeeting.common.SysParamKeys;
import com.imeeting.common.exception.ExistingOfflineMeetingException;
import com.imeeting.dto.android.AndroidAuthContext;
import com.imeeting.dto.android.AndroidMeetingConfigVo;
import com.imeeting.dto.android.AndroidOfflineMeetingConflictVO;
import com.imeeting.dto.android.AndroidOfflineMeetingFinishRequest;
import com.imeeting.dto.android.legacy.LegacyMeetingAccessPasswordRequest;
import com.imeeting.dto.android.legacy.LegacyMeetingAttendeeResponse;
import com.imeeting.dto.android.legacy.LegacyMeetingCreateRequest;
@ -19,9 +23,11 @@ import com.imeeting.entity.biz.AiTask;
import com.imeeting.entity.biz.Meeting;
import com.imeeting.entity.biz.PromptTemplate;
import com.imeeting.service.android.AndroidAuthService;
import com.imeeting.service.android.AndroidChunkUploadService;
import com.imeeting.service.android.legacy.LegacyMeetingAdapterService;
import com.imeeting.support.AndroidRequestLogHelper;
import com.imeeting.service.biz.*;
import com.unisbase.annotation.Anonymous;
import com.unisbase.common.ApiResponse;
import com.unisbase.common.annotation.Log;
import com.unisbase.dto.PageResult;
@ -74,6 +80,7 @@ public class AndroidMeetingController {
private static final String STAGE_COMPLETED = "completed";
private final AndroidAuthService androidAuthService;
private final AndroidChunkUploadService androidChunkUploadService;
private final LegacyMeetingAdapterService legacyMeetingAdapterService;
private final MeetingQueryService meetingQueryService;
private final MeetingAccessService meetingAccessService;
@ -89,6 +96,7 @@ public class AndroidMeetingController {
@Autowired
public AndroidMeetingController(AndroidAuthService androidAuthService,
AndroidChunkUploadService androidChunkUploadService,
LegacyMeetingAdapterService legacyMeetingAdapterService,
MeetingQueryService meetingQueryService,
MeetingAccessService meetingAccessService,
@ -102,6 +110,7 @@ public class AndroidMeetingController {
SysParamService paramService,
MeetingProgressService meetingProgressService) {
this.androidAuthService = androidAuthService;
this.androidChunkUploadService = androidChunkUploadService;
this.legacyMeetingAdapterService = legacyMeetingAdapterService;
this.meetingQueryService = meetingQueryService;
this.meetingAccessService = meetingAccessService;
@ -124,17 +133,22 @@ public class AndroidMeetingController {
content = @Content(schema = @Schema(implementation = MeetingVO.class))
)
})
@PostMapping
@PostMapping("/create")
@Anonymous
@Log(value = "新增Android会议", type = "Android会议管理")
public ApiResponse<MeetingVO> create(HttpServletRequest request, @RequestBody LegacyMeetingCreateRequest command) {
public ApiResponse<Object> create(HttpServletRequest request, @RequestBody LegacyMeetingCreateRequest command) {
AndroidRequestLogHelper.logRequest(log, "Android会议", "创建离线会议接口", "request", command);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
LoginUser loginUser = AndroidLoginUserSupport.requireLoginUser(authContext);
LoginUser loginUser = authContext.isAnonymous() ? null : AndroidLoginUserSupport.requireLoginUser(authContext);
try {
// Meeting existingMeeting = findLatestUnfinishedMeetingByDevice(authContext.getDeviceId());
// if (existingMeeting != null) {
// return new ApiResponse<>("409", "设备端已有会议", meetingQueryService.getDetailIgnoreTenant(existingMeeting.getId()));
// }
return ApiResponse.ok(legacyMeetingAdapterService.createMeeting(command, authContext, loginUser));
} catch (ExistingOfflineMeetingException ex) {
return new ApiResponse<>("409", "有未结束会议", new AndroidOfflineMeetingConflictVO(ex.getMeetingId()));
}
}
@Operation(summary = "上传Android会议音频")
@ -146,6 +160,7 @@ public class AndroidMeetingController {
)
})
@PostMapping("/upload-audio")
@Anonymous
public ApiResponse<LegacyUploadAudioResponse> uploadAudio(HttpServletRequest request,
@RequestParam("id") Long meetingId,
@RequestParam(value = "prompt_id", required = false) Long promptId,
@ -162,6 +177,8 @@ public class AndroidMeetingController {
if (authContext.isAnonymous()) {
return ApiResponse.ok(legacyMeetingAdapterService.uploadAndTriggerOfflineProcessForPublicDevice(
meetingId,
promptId,
modelCode,
forceReplace,
audioFile,
authContext
@ -179,6 +196,32 @@ public class AndroidMeetingController {
));
}
@Operation(summary = "结束 Android 离线会议录音阶段")
@ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "200",
description = "结束成功返回 true",
content = @Content(schema = @Schema(implementation = Boolean.class))
)
})
@PostMapping("/{meetingId}/finish")
@Anonymous
public ApiResponse<Boolean> finishOfflineMeeting(HttpServletRequest request,
@PathVariable Long meetingId,
@RequestBody(required = false) AndroidOfflineMeetingFinishRequest command) throws IOException {
AndroidRequestLogHelper.logRequest(log, "Android会议", "结束离线会议录音阶段",
"meetingId", meetingId,
"request", command);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
LoginUser loginUser = authContext.isAnonymous() ? null : AndroidLoginUserSupport.requireLoginUser(authContext);
Meeting meeting = requireOperableOfflineMeeting(meetingId, authContext, loginUser);
if (isUploadFinishedStage(command)) {
androidChunkUploadService.completeUpload(meeting.getId(), authContext);
}
meetingCommandService.finishOfflineMeeting(meeting.getId(), command == null ? null : command.getFinishStage());
return ApiResponse.ok(true);
}
@Operation(summary = "分页查询Android会议")
@ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(
@ -320,6 +363,37 @@ public class AndroidMeetingController {
return ApiResponse.ok(resultVo);
}
private Meeting requireOperableOfflineMeeting(Long meetingId, AndroidAuthContext authContext, LoginUser loginUser) {
Meeting meeting = meetingService.getById(meetingId);
if (meeting == null) {
throw new RuntimeException("会议不存在");
}
if (!MeetingConstants.TYPE_OFFLINE.equals(meeting.getMeetingType())) {
throw new RuntimeException("当前会议不是离线会议");
}
if (authContext == null || authContext.getDeviceId() == null || authContext.getDeviceId().isBlank()) {
throw new RuntimeException("设备ID不能为空");
}
if (meeting.getSourceDeviceCode() == null || !meeting.getSourceDeviceCode().equals(authContext.getDeviceId())) {
throw new RuntimeException("当前会议不属于该设备");
}
if (authContext.isAnonymous()) {
if (!MeetingConstants.DEVICE_MODE_PUBLIC.equals(meeting.getSourceDeviceMode())) {
throw new RuntimeException("当前会议不是公有设备会议");
}
return meeting;
}
if (loginUser == null || !Objects.equals(meeting.getCreatorId(), loginUser.getUserId())) {
throw new RuntimeException("仅会议创建人可操作当前会议");
}
return meeting;
}
private boolean isUploadFinishedStage(AndroidOfflineMeetingFinishRequest command) {
return command != null
&& MeetingConstants.OFFLINE_RECORDING_UPLOAD_FINISHED.equalsIgnoreCase(command.getFinishStage());
}
private LegacyMeetingPreviewResult buildPreviewResult(Long meetingId) {
Meeting meeting = meetingService.getById(meetingId);
if (meeting == null) {

View File

@ -1,16 +1,17 @@
package com.imeeting.controller.android;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.imeeting.dto.android.AndroidAuthContext;
import com.imeeting.dto.android.AndroidPushMessageVO;
import com.imeeting.dto.android.AndroidPublicMeetingSessionResultVO;
import com.imeeting.dto.android.AndroidPublicMeetingSessionRequest;
import com.imeeting.dto.android.AndroidPublicMeetingSessionVO;
import com.imeeting.dto.biz.MeetingVO;
import com.imeeting.entity.biz.AndroidPushMessage;
import com.imeeting.entity.biz.Meeting;
import com.imeeting.enums.MeetingPushTypeEnum;
import com.imeeting.mapper.DeviceInfoMapper;
import com.imeeting.service.android.AndroidAuthService;
import com.imeeting.service.android.AndroidPushMessageService;
import com.imeeting.service.android.AndroidPublicMeetingSessionService;
import com.imeeting.service.biz.MeetingCommandService;
import com.imeeting.service.biz.MeetingQueryService;
import com.imeeting.service.biz.MeetingService;
import com.imeeting.support.AndroidRequestLogHelper;
import com.unisbase.annotation.Anonymous;
@ -23,6 +24,7 @@ import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -37,7 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
public class AndroidPublicMeetingController {
private final AndroidAuthService androidAuthService;
private final AndroidPublicMeetingSessionService androidPublicMeetingSessionService;
private final MeetingQueryService meetingQueryService;
private final AndroidPushMessageService androidPushMessageService;
private final MeetingCommandService meetingCommandService;
private final MeetingService meetingService;
private final DeviceInfoMapper deviceInfoMapper;
@ -46,27 +48,48 @@ public class AndroidPublicMeetingController {
@io.swagger.v3.oas.annotations.responses.ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "200",
description = "返回扫码会话信息,供设备展示二维码",
content = @Content(schema = @Schema(implementation = AndroidPublicMeetingSessionVO.class))
description = "优先返回待处理扫码消息,否则返回扫码会话二维码",
content = @Content(schema = @Schema(implementation = AndroidPublicMeetingSessionResultVO.class))
)
})
@PostMapping("/session")
@Anonymous
public ApiResponse<Object> createSession(HttpServletRequest request,
public ApiResponse<AndroidPublicMeetingSessionResultVO> createSession(HttpServletRequest request,
@RequestBody(required = false) AndroidPublicMeetingSessionRequest command) {
AndroidRequestLogHelper.logRequest(log, "Android公有会议", "创建扫码发会会话",
"request", command);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
assertPublicDevice(authContext.getDeviceId());
Meeting existingMeeting = findLatestUnfinishedMeetingByDevice(authContext.getDeviceId());
if (existingMeeting != null) {
return new ApiResponse<>("409", "设备端已有会议", meetingQueryService.getDetailIgnoreTenant(existingMeeting.getId()));
AndroidPushMessage pendingMessage = androidPushMessageService.findLatestPendingMessage(
authContext.getDeviceId(),
MeetingPushTypeEnum.PUBLIC_MEETING_LOGIN_CONFIRM.getCode()
);
AndroidPublicMeetingSessionResultVO result = new AndroidPublicMeetingSessionResultVO();
if (pendingMessage != null) {
result.setMode("PENDING_MESSAGE");
result.setMessage(androidPushMessageService.toPushMessageVO(pendingMessage));
return ApiResponse.ok(result);
}
AndroidPublicMeetingSessionVO vo = androidPublicMeetingSessionService.create(
result.setMode("QR_CODE");
result.setQrCode(androidPublicMeetingSessionService.create(
authContext.getDeviceId(),
command == null ? null : command.getTitle()
));
return ApiResponse.ok(result);
}
@Operation(summary = "主动拉取未确认扫码消息")
@GetMapping("/pending-login-message")
@Anonymous
public ApiResponse<AndroidPushMessageVO> pullPendingLoginMessage(HttpServletRequest request) {
AndroidRequestLogHelper.logRequest(log, "Android公有会议", "主动拉取未确认扫码消息");
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
assertPublicDevice(authContext.getDeviceId());
AndroidPushMessage pendingMessage = androidPushMessageService.findLatestPendingMessage(
authContext.getDeviceId(),
MeetingPushTypeEnum.PUBLIC_MEETING_LOGIN_CONFIRM.getCode()
);
return ApiResponse.ok(vo);
return ApiResponse.ok(androidPushMessageService.toPushMessageVO(pendingMessage));
}
@Operation(summary = "公有设备删除未开始会议")
@ -97,17 +120,6 @@ public class AndroidPublicMeetingController {
return ApiResponse.ok(true);
}
private Meeting findLatestUnfinishedMeetingByDevice(String deviceId) {
if (deviceId == null || deviceId.isBlank()) {
return null;
}
return meetingService.getOne(new LambdaQueryWrapper<Meeting>()
.eq(Meeting::getSourceDeviceCode, deviceId)
.in(Meeting::getStatus, 0, 1, 2)
.orderByDesc(Meeting::getId)
.last("LIMIT 1"));
}
private void assertPublicDevice(String deviceId) {
if (deviceId == null || deviceId.isBlank()) {
throw new RuntimeException("设备ID不能为空");

View File

@ -44,11 +44,13 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -86,6 +88,9 @@ public class MeetingController {
private final SysParamService sysParamService;
private final AiTaskService aiTaskService;
@Value("${imeeting.h5.base-url:}")
private String h5BaseUrl;
@Autowired
public MeetingController(MeetingQueryService meetingQueryService,
MeetingCommandService meetingCommandService,
@ -203,6 +208,19 @@ public class MeetingController {
return ApiResponse.ok(vo);
}
@Operation(summary = "获取会议分享配置")
@GetMapping("/share-config")
@PreAuthorize("isAuthenticated()")
public ApiResponse<Map<String, String>> getShareConfig() {
String baseUrl = StringUtils.hasText(h5BaseUrl) ? h5BaseUrl.trim() : "";
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
}
Map<String, String> result = new HashMap<>();
result.put("h5BaseUrl", baseUrl);
return ApiResponse.ok(result);
}
@Operation(summary = "创建离线会议")
@PostMapping
@PreAuthorize("isAuthenticated()")

View File

@ -1,27 +1,19 @@
package com.imeeting.controller.biz;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.imeeting.dto.android.AndroidPublicLoginConfirmPayload;
import com.imeeting.dto.android.AndroidPublicMeetingSessionState;
import com.imeeting.dto.biz.MeetingVO;
import com.imeeting.dto.biz.PublicDeviceMeetingCreateCommand;
import com.imeeting.entity.biz.Meeting;
import com.imeeting.service.android.AndroidMeetingPushService;
import com.imeeting.service.android.AndroidPublicMeetingSessionService;
import com.imeeting.service.biz.MeetingCommandService;
import com.imeeting.service.biz.MeetingQueryService;
import com.imeeting.service.biz.MeetingService;
import com.unisbase.common.ApiResponse;
import com.unisbase.security.LoginUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -30,62 +22,35 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/biz/public-device-meetings")
public class PublicDeviceMeetingController {
private final AndroidPublicMeetingSessionService androidPublicMeetingSessionService;
private final MeetingCommandService meetingCommandService;
private final MeetingQueryService meetingQueryService;
private final AndroidMeetingPushService androidMeetingPushService;
private final MeetingService meetingService;
public PublicDeviceMeetingController(AndroidPublicMeetingSessionService androidPublicMeetingSessionService,
MeetingCommandService meetingCommandService,
MeetingQueryService meetingQueryService,
AndroidMeetingPushService androidMeetingPushService,
MeetingService meetingService) {
AndroidMeetingPushService androidMeetingPushService) {
this.androidPublicMeetingSessionService = androidPublicMeetingSessionService;
this.meetingCommandService = meetingCommandService;
this.meetingQueryService = meetingQueryService;
this.androidMeetingPushService = androidMeetingPushService;
this.meetingService = meetingService;
}
@Operation(summary = "H5扫码为公有设备创建会议")
@Operation(summary = "H5扫码确认公有设备登录")
@io.swagger.v3.oas.annotations.responses.ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "200",
description = "返回已创建的会议详情;若设备已有未结束会议,则返回已有会议",
content = @Content(schema = @Schema(implementation = MeetingVO.class))
description = "确认成功返回 true并向设备推送扫码用户信息",
content = @Content(schema = @Schema(implementation = Boolean.class))
)
})
@PostMapping("/sessions/{sessionId}/create")
public ApiResponse<Object> createBySession(@PathVariable String sessionId,
@Valid @RequestBody PublicDeviceMeetingCreateCommand command) {
public ApiResponse<Boolean> createBySession(@PathVariable String sessionId) {
LoginUser loginUser = currentLoginUser();
AndroidPublicMeetingSessionState session = androidPublicMeetingSessionService.require(sessionId);
Meeting existingMeeting = findLatestUnfinishedMeetingByDevice(session.getDeviceId());
if (existingMeeting != null) {
return new ApiResponse<>("409", "设备端已有会议", meetingQueryService.getDetailIgnoreTenant(existingMeeting.getId()));
}
String creatorName = loginUser.getDisplayName() != null ? loginUser.getDisplayName() : loginUser.getUsername();
MeetingVO vo = meetingCommandService.createPublicDeviceMeeting(
command,
loginUser.getTenantId(),
loginUser.getUserId(),
creatorName,
session.getDeviceId()
);
androidMeetingPushService.pushPendingMeetingToDevice(vo.getId(), session.getDeviceId());
androidPublicMeetingSessionService.clear(sessionId);
return ApiResponse.ok(vo);
}
private Meeting findLatestUnfinishedMeetingByDevice(String deviceId) {
if (deviceId == null || deviceId.isBlank()) {
return null;
}
return meetingService.getOne(new LambdaQueryWrapper<Meeting>()
.eq(Meeting::getSourceDeviceCode, deviceId)
.in(Meeting::getStatus, 0, 1, 2)
.orderByDesc(Meeting::getId)
.last("LIMIT 1"));
AndroidPublicLoginConfirmPayload payload = new AndroidPublicLoginConfirmPayload();
payload.setSessionId(sessionId);
payload.setTenantId(loginUser.getTenantId());
payload.setUserId(loginUser.getUserId());
payload.setUsername(loginUser.getUsername());
payload.setDisplayName(loginUser.getDisplayName());
androidMeetingPushService.pushPublicLoginConfirm(session.getDeviceId(), payload);
androidPublicMeetingSessionService.invalidate(sessionId);
return ApiResponse.ok(true);
}
private LoginUser currentLoginUser() {

View File

@ -2,16 +2,19 @@ package com.imeeting.dto.android;
import lombok.Data;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
@Data
public class AndroidChunkUploadSessionState {
private String uploadSessionId;
private Long meetingId;
private String deviceId;
private Integer totalChunks;
private String fileName;
private String contentType;
private Set<Integer> receivedChunks = new TreeSet<>();
private Set<String> uploadedChunkFileNames = new TreeSet<>();
private Map<Integer, String> chunkFileNames = new TreeMap<>();
}

View File

@ -10,5 +10,6 @@ public class AndroidPublicMeetingSessionState {
private String sessionToken;
private String deviceId;
private String title;
private Boolean invalidated;
private LocalDateTime expireAt;
}

View File

@ -17,6 +17,9 @@ public class AndroidPublicMeetingSessionVO {
@Schema(description = "设备ID")
private String deviceId;
@Schema(description = "H5 扫码确认完整地址")
private String qrUrl;
@Schema(description = "会话过期时间")
private LocalDateTime expireAt;
}

View File

@ -10,6 +10,12 @@ public class LegacyMeetingCreateRequest {
@JsonProperty("user_id")
private Long userId;
@JsonProperty("tenant_id")
private Long tenantId;
@JsonProperty("creator_name")
private String creatorName;
private String title;
@JsonProperty("meeting_time")

View File

@ -47,6 +47,8 @@ public class MeetingVO {
private String sourceDeviceCode;
@Schema(description = "来源设备模式")
private String sourceDeviceMode;
@Schema(description = "离线录音阶段ACTIVE / PRE_END / UPLOAD_FINISHED")
private String offlineRecordingStatus;
@Schema(description = "总结详细程度")
private String summaryDetailLevel;
@Schema(description = "音频保存状态")

View File

@ -24,6 +24,8 @@ public class AndroidPushMessage extends BaseEntity {
private String messageType;
private String messageTitle;
private String payload;
private Integer needAck;

View File

@ -47,6 +47,9 @@ public class Meeting extends BaseEntity {
@Schema(description = "来源设备模式")
private String sourceDeviceMode;
@Schema(description = "离线录音阶段ACTIVE / PRE_END / UPLOAD_FINISHED")
private String offlineRecordingStatus;
@Schema(description = "总结详细程度")
private String summaryDetailLevel;

View File

@ -4,6 +4,7 @@ import lombok.Getter;
@Getter
public enum MeetingPushTypeEnum {
PUBLIC_MEETING_LOGIN_CONFIRM("PUBLIC_MEETING_LOGIN_CONFIRM", "公有设备扫码登录确认消息"),
MEETING_PENDING("MEETING_PENDING", "待开始会议通知"),
MEETING_COMPLETED("MEETING_COMPLETED", "会议完成通知");

View File

@ -8,16 +8,11 @@ import java.io.IOException;
public interface AndroidChunkUploadService {
void saveChunk(Long meetingId,
String uploadSessionId,
Integer chunkIndex,
Integer totalChunks,
MultipartFile chunkFile,
AndroidAuthContext authContext) throws IOException;
LegacyUploadAudioResponse completeUpload(Long meetingId,
String uploadSessionId,
boolean forceReplace,
Long promptId,
String modelCode,
AndroidAuthContext authContext) throws IOException;
}

View File

@ -1,7 +1,11 @@
package com.imeeting.service.android;
import com.imeeting.dto.android.AndroidPublicLoginConfirmPayload;
public interface AndroidMeetingPushService {
void pushPendingMeetingToDevice(Long meetingId, String deviceId);
void pushPublicLoginConfirm(String deviceId, AndroidPublicLoginConfirmPayload payload);
void pushMeetingCompleted(Long meetingId);
}

View File

@ -8,5 +8,7 @@ public interface AndroidPublicMeetingSessionService {
AndroidPublicMeetingSessionState require(String sessionId);
void invalidate(String sessionId);
void clear(String sessionId);
}

View File

@ -1,5 +1,6 @@
package com.imeeting.service.android;
import com.imeeting.dto.android.AndroidPushMessageVO;
import com.imeeting.entity.biz.AndroidPushMessage;
import com.imeeting.grpc.push.PushMessage;
@ -12,6 +13,10 @@ public interface AndroidPushMessageService {
List<AndroidPushMessage> listPendingMeetingPushMessages();
AndroidPushMessage findLatestPendingMessage(String deviceCode, String messageType);
AndroidPushMessageVO toPushMessageVO(AndroidPushMessage message);
void markPushed(Long id);
void markExpired(Long id);

View File

@ -1,12 +1,12 @@
package com.imeeting.service.android.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.imeeting.dto.android.AndroidAuthContext;
import com.imeeting.dto.android.AndroidChunkUploadSessionState;
import com.imeeting.dto.android.legacy.LegacyUploadAudioResponse;
import com.imeeting.service.android.AndroidChunkUploadService;
import com.imeeting.service.android.legacy.LegacyMeetingAdapterService;
import com.imeeting.support.redis.AndroidChunkUploadSessionCache;
import com.unisbase.security.LoginUser;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -19,10 +19,9 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.Map;
import java.util.Objects;
import com.unisbase.security.LoginUser;
@Service
@RequiredArgsConstructor
public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService {
@ -34,13 +33,12 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
@Override
public void saveChunk(Long meetingId,
String uploadSessionId,
Integer chunkIndex,
Integer totalChunks,
MultipartFile chunkFile,
AndroidAuthContext authContext) throws IOException {
if (meetingId == null || uploadSessionId == null || uploadSessionId.isBlank()) {
throw new RuntimeException("uploadSessionId不能为空");
if (meetingId == null) {
throw new RuntimeException("meeting_id不能为空");
}
if (chunkIndex == null || totalChunks == null || chunkIndex < 0 || totalChunks <= 0) {
throw new RuntimeException("分片参数无效");
@ -48,33 +46,47 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
if (chunkFile == null || chunkFile.isEmpty()) {
throw new RuntimeException("chunk_file不能为空");
}
AndroidChunkUploadSessionState state = getOrCreateState(meetingId, uploadSessionId, totalChunks, chunkFile, authContext);
AndroidChunkUploadSessionState state = getOrCreateState(meetingId, totalChunks, chunkFile, authContext);
if (!Objects.equals(state.getMeetingId(), meetingId) || !Objects.equals(state.getDeviceId(), authContext.getDeviceId())) {
throw new RuntimeException("分片上传会话与当前设备或会议不匹配");
}
Path sessionDir = sessionDir(uploadSessionId);
Files.createDirectories(sessionDir);
Files.write(sessionDir.resolve(chunkIndex + ".part"), chunkFile.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
String chunkFileName = normalizeChunkFileName(chunkFile.getOriginalFilename(), chunkIndex);
String previousFileName = state.getChunkFileNames().get(chunkIndex);
Path meetingDir = sessionDir(meetingId);
Files.createDirectories(meetingDir);
if (previousFileName != null && !previousFileName.equals(chunkFileName)) {
deleteQuietly(meetingDir.resolve(previousFileName));
state.getUploadedChunkFileNames().remove(previousFileName);
}
if (state.getUploadedChunkFileNames().contains(chunkFileName)) {
state.getChunkFileNames().put(chunkIndex, chunkFileName);
state.getReceivedChunks().add(chunkIndex);
saveState(uploadSessionId, state);
saveState(meetingId, state);
return;
}
Files.write(meetingDir.resolve(chunkFileName), chunkFile.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
state.getUploadedChunkFileNames().add(chunkFileName);
state.getChunkFileNames().put(chunkIndex, chunkFileName);
state.getReceivedChunks().add(chunkIndex);
saveState(meetingId, state);
}
@Override
public LegacyUploadAudioResponse completeUpload(Long meetingId,
String uploadSessionId,
boolean forceReplace,
Long promptId,
String modelCode,
AndroidAuthContext authContext) throws IOException {
AndroidChunkUploadSessionState state = requireState(uploadSessionId);
AndroidChunkUploadSessionState state = requireState(meetingId);
if (!Objects.equals(state.getMeetingId(), meetingId) || !Objects.equals(state.getDeviceId(), authContext.getDeviceId())) {
throw new RuntimeException("分片上传会话与当前设备或会议不匹配");
}
for (int i = 0; i < state.getTotalChunks(); i++) {
if (!state.getReceivedChunks().contains(i)) {
if (!state.getReceivedChunks().contains(i) || !state.getChunkFileNames().containsKey(i)) {
throw new RuntimeException("分片未上传完整");
}
}
Path mergedFile = mergeChunks(state);
try {
MultipartFile mergedMultipart = new LocalMultipartFile(
@ -85,7 +97,9 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
if (authContext.isAnonymous()) {
return legacyMeetingAdapterService.uploadAndTriggerOfflineProcessForPublicDevice(
meetingId,
forceReplace,
null,
null,
false,
mergedMultipart,
authContext
);
@ -93,70 +107,76 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
LoginUser loginUser = toLoginUser(authContext);
return legacyMeetingAdapterService.uploadAndTriggerOfflineProcess(
meetingId,
promptId,
modelCode,
forceReplace,
null,
null,
false,
mergedMultipart,
authContext,
loginUser
);
} finally {
cleanup(uploadSessionId);
cleanup(meetingId);
}
}
private AndroidChunkUploadSessionState getOrCreateState(Long meetingId,
String uploadSessionId,
Integer totalChunks,
MultipartFile chunkFile,
AndroidAuthContext authContext) throws IOException {
AndroidChunkUploadSessionState existing = getState(uploadSessionId);
AndroidChunkUploadSessionState existing = getState(meetingId);
if (existing != null) {
String currentFileName = chunkFile == null ? null : chunkFile.getOriginalFilename();
boolean sameTotalChunks = Objects.equals(existing.getTotalChunks(), totalChunks);
boolean sameFileName = Objects.equals(existing.getFileName(), currentFileName);
if (sameTotalChunks && sameFileName) {
return existing;
}
cleanup(meetingId);
}
AndroidChunkUploadSessionState state = new AndroidChunkUploadSessionState();
state.setUploadSessionId(uploadSessionId);
state.setMeetingId(meetingId);
state.setDeviceId(authContext.getDeviceId());
state.setTotalChunks(totalChunks);
state.setFileName(chunkFile.getOriginalFilename());
state.setContentType(chunkFile.getContentType());
saveState(uploadSessionId, state);
saveState(meetingId, state);
return state;
}
private Path mergeChunks(AndroidChunkUploadSessionState state) throws IOException {
Path sessionDir = sessionDir(state.getUploadSessionId());
Path merged = sessionDir.resolve("merged.bin");
Path meetingDir = sessionDir(state.getMeetingId());
Path merged = meetingDir.resolve("merged.bin");
Files.deleteIfExists(merged);
Files.createFile(merged);
for (int i = 0; i < state.getTotalChunks(); i++) {
Files.write(merged, Files.readAllBytes(sessionDir.resolve(i + ".part")), StandardOpenOption.APPEND);
for (Map.Entry<Integer, String> entry : state.getChunkFileNames().entrySet()) {
Files.write(merged, Files.readAllBytes(meetingDir.resolve(entry.getValue())), StandardOpenOption.APPEND);
}
return merged;
}
private AndroidChunkUploadSessionState requireState(String uploadSessionId) {
AndroidChunkUploadSessionState state = getState(uploadSessionId);
private AndroidChunkUploadSessionState requireState(Long meetingId) {
AndroidChunkUploadSessionState state = getState(meetingId);
if (state == null) {
throw new RuntimeException("分片上传会话不存在或已过期");
}
return state;
}
private AndroidChunkUploadSessionState getState(String uploadSessionId) {
return sessionCache.get(uploadSessionId);
private AndroidChunkUploadSessionState getState(Long meetingId) {
return sessionCache.get(meetingId);
}
private void saveState(String uploadSessionId, AndroidChunkUploadSessionState state) {
sessionCache.save(uploadSessionId, state);
private void saveState(Long meetingId, AndroidChunkUploadSessionState state) {
sessionCache.save(meetingId, state);
}
private void cleanup(String uploadSessionId) throws IOException {
sessionCache.clear(uploadSessionId);
Path sessionDir = sessionDir(uploadSessionId);
if (Files.exists(sessionDir)) {
try (var paths = Files.walk(sessionDir)) {
private void cleanup(Long meetingId) throws IOException {
sessionCache.clear(meetingId);
Path meetingDir = sessionDir(meetingId);
if (!Files.exists(meetingDir)) {
return;
}
try (var paths = Files.walk(meetingDir)) {
paths.sorted((left, right) -> right.compareTo(left)).forEach(path -> {
try {
Files.deleteIfExists(path);
@ -166,11 +186,27 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
});
}
}
private Path sessionDir(Long meetingId) {
String normalizedBasePath = uploadPath.endsWith("/") || uploadPath.endsWith("\\") ? uploadPath : uploadPath + "/";
return Paths.get(normalizedBasePath, "android-chunks", String.valueOf(meetingId));
}
private Path sessionDir(String uploadSessionId) {
String normalizedBasePath = uploadPath.endsWith("/") || uploadPath.endsWith("\\") ? uploadPath : uploadPath + "/";
return Paths.get(normalizedBasePath, "android-chunks", uploadSessionId);
private String normalizeChunkFileName(String originalFileName, Integer chunkIndex) {
String fallback = "chunk-" + (chunkIndex == null ? "unknown" : chunkIndex);
String fileName = originalFileName == null || originalFileName.isBlank() ? fallback : originalFileName.trim();
fileName = Paths.get(fileName).getFileName().toString();
return fileName.isBlank() ? fallback : fileName;
}
private void deleteQuietly(Path path) {
if (path == null) {
return;
}
try {
Files.deleteIfExists(path);
} catch (IOException ignored) {
}
}
private LoginUser toLoginUser(AndroidAuthContext authContext) {

View File

@ -1,6 +1,7 @@
package com.imeeting.service.android.impl;
import cn.hutool.json.JSONUtil;
import com.imeeting.dto.android.AndroidPublicLoginConfirmPayload;
import com.imeeting.dto.biz.MeetingVO;
import com.imeeting.enums.MeetingPushTypeEnum;
import com.imeeting.grpc.push.PushMessage;
@ -61,6 +62,28 @@ public class AndroidMeetingPushServiceImpl implements AndroidMeetingPushService
log.info("Android pending meeting push finished, meetingId={}, deviceId={}, pushedConnections={}", meetingId, deviceId, pushed);
}
@Override
public void pushPublicLoginConfirm(String deviceId, AndroidPublicLoginConfirmPayload payload) {
if (deviceId == null || deviceId.isBlank() || payload == null || payload.getUserId() == null) {
return;
}
PushMessage message = PushMessage.newBuilder()
.setMessageId("public_login_confirm:" + payload.getSessionId() + ":" + UUID.randomUUID())
.setTimestamp(System.currentTimeMillis())
.setType(MeetingPushTypeEnum.PUBLIC_MEETING_LOGIN_CONFIRM.getCode())
.setTitle("扫码登录确认")
.setContent(JSONUtil.toJsonStr(payload))
.setNeedAck(true)
.build();
var pushEntity = androidPushMessageService.saveMeetingPushMessage(payload.getTenantId(), null, deviceId, message, pendingExpireMinutes);
int pushed = androidGatewayPushService.pushToDevice(deviceId, message);
if (pushEntity.getId() != null) {
androidPushMessageService.markPushed(pushEntity.getId());
}
log.info("Android public login confirm push finished, deviceId={}, sessionId={}, pushedConnections={}",
deviceId, payload.getSessionId(), pushed);
}
@Override
public void pushMeetingCompleted(Long meetingId) {
if (meetingId == null) {

View File

@ -7,6 +7,7 @@ import com.imeeting.support.redis.AndroidPublicMeetingSessionCache;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.time.Duration;
import java.time.LocalDateTime;
@ -20,6 +21,9 @@ public class AndroidPublicMeetingSessionServiceImpl implements AndroidPublicMeet
@Value("${imeeting.public-device.session-ttl-minutes:30}")
private long sessionTtlMinutes;
@Value("${imeeting.h5.base-url:}")
private String h5BaseUrl;
@Override
public AndroidPublicMeetingSessionVO create(String deviceId, String title) {
String sessionId = UUID.randomUUID().toString().replace("-", "");
@ -35,6 +39,7 @@ public class AndroidPublicMeetingSessionServiceImpl implements AndroidPublicMeet
vo.setSessionId(sessionId);
vo.setSessionToken(sessionId);
vo.setDeviceId(deviceId);
vo.setQrUrl(buildQrUrl(sessionId));
vo.setExpireAt(expireAt);
return vo;
}
@ -45,11 +50,35 @@ public class AndroidPublicMeetingSessionServiceImpl implements AndroidPublicMeet
if (state == null) {
throw new RuntimeException("公有设备发会会话不存在或已过期");
}
if (Boolean.TRUE.equals(state.getInvalidated())) {
throw new RuntimeException("二维码已失效");
}
return state;
}
@Override
public void invalidate(String sessionId) {
AndroidPublicMeetingSessionState state = sessionCache.get(sessionId);
if (state == null) {
return;
}
state.setInvalidated(true);
sessionCache.save(sessionId, state, Duration.ofMinutes(Math.max(sessionTtlMinutes, 1)));
}
@Override
public void clear(String sessionId) {
sessionCache.clear(sessionId);
}
private String buildQrUrl(String sessionId) {
String baseUrl = StringUtils.hasText(h5BaseUrl) ? h5BaseUrl.trim() : "";
if (!StringUtils.hasText(baseUrl)) {
throw new RuntimeException("未配置 imeeting.h5.base-url无法生成 H5 扫码确认地址");
}
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
}
return baseUrl + "/scan-confirm/" + sessionId;
}
}

View File

@ -3,6 +3,7 @@ package com.imeeting.service.android.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.imeeting.common.MeetingConstants;
import com.imeeting.dto.android.AndroidPushMessageVO;
import com.imeeting.entity.biz.AndroidPushMessage;
import com.imeeting.grpc.push.PushMessage;
import com.imeeting.mapper.biz.AndroidPushMessageMapper;
@ -30,6 +31,7 @@ public class AndroidPushMessageServiceImpl implements AndroidPushMessageService
entity.setDeviceCode(deviceCode);
entity.setMessageId(pushMessage.getMessageId());
entity.setMessageType(pushMessage.getType());
entity.setMessageTitle(pushMessage.getTitle());
entity.setPayload(pushMessage.getContent());
entity.setNeedAck(pushMessage.getNeedAck() ? 1 : 0);
entity.setAcked(0);
@ -64,6 +66,39 @@ public class AndroidPushMessageServiceImpl implements AndroidPushMessageService
.eq(AndroidPushMessage::getIsDeleted, 0));
}
@Override
public AndroidPushMessage findLatestPendingMessage(String deviceCode, String messageType) {
if (deviceCode == null || deviceCode.isBlank() || messageType == null || messageType.isBlank()) {
return null;
}
return androidPushMessageMapper.selectOne(new LambdaQueryWrapper<AndroidPushMessage>()
.eq(AndroidPushMessage::getDeviceCode, deviceCode.trim())
.eq(AndroidPushMessage::getMessageType, messageType.trim())
.eq(AndroidPushMessage::getNeedAck, 1)
.eq(AndroidPushMessage::getAcked, 0)
.eq(AndroidPushMessage::getPushStatus, MeetingConstants.DEVICE_DELIVERY_PENDING)
.and(wrapper -> wrapper.isNull(AndroidPushMessage::getExpireAt).or().gt(AndroidPushMessage::getExpireAt, LocalDateTime.now()))
.eq(AndroidPushMessage::getIsDeleted, 0)
.orderByDesc(AndroidPushMessage::getCreatedAt)
.orderByDesc(AndroidPushMessage::getId)
.last("LIMIT 1"));
}
@Override
public AndroidPushMessageVO toPushMessageVO(AndroidPushMessage message) {
if (message == null) {
return null;
}
AndroidPushMessageVO vo = new AndroidPushMessageVO();
vo.setMessageId(message.getMessageId());
vo.setTimestamp(resolveTimestamp(message));
vo.setType(message.getMessageType());
vo.setTitle(message.getMessageTitle());
vo.setContent(message.getPayload());
vo.setNeedAck(Integer.valueOf(1).equals(message.getNeedAck()));
return vo;
}
@Override
public void markPushed(Long id) {
androidPushMessageMapper.update(null, new LambdaUpdateWrapper<AndroidPushMessage>()
@ -92,4 +127,14 @@ public class AndroidPushMessageServiceImpl implements AndroidPushMessageService
.eq(AndroidPushMessage::getIsDeleted, 0)
.set(AndroidPushMessage::getPushStatus, MeetingConstants.DEVICE_DELIVERY_CANCELLED));
}
private long resolveTimestamp(AndroidPushMessage message) {
if (message.getCreatedAt() != null) {
return message.getCreatedAt().atZone(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli();
}
if (message.getLastPushAt() != null) {
return message.getLastPushAt().atZone(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli();
}
return System.currentTimeMillis();
}
}

View File

@ -21,6 +21,8 @@ public interface LegacyMeetingAdapterService {
LoginUser loginUser) throws IOException;
LegacyUploadAudioResponse uploadAndTriggerOfflineProcessForPublicDevice(Long meetingId,
Long promptId,
String modelCode,
boolean forceReplace,
MultipartFile audioFile,
AndroidAuthContext authContext) throws IOException;

View File

@ -2,22 +2,19 @@ package com.imeeting.service.android.legacy.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.imeeting.common.MeetingConstants;
import com.imeeting.common.exception.ExistingOfflineMeetingException;
import com.imeeting.dto.android.AndroidAuthContext;
import com.imeeting.dto.android.AndroidPendingMeetingDraft;
import com.imeeting.dto.android.legacy.LegacyMeetingCreateRequest;
import com.imeeting.dto.android.legacy.LegacyUploadAudioResponse;
import com.imeeting.dto.biz.MeetingVO;
import com.imeeting.dto.biz.PublicDeviceMeetingCreateCommand;
import com.imeeting.dto.biz.RealtimeMeetingRuntimeProfile;
import com.imeeting.entity.biz.AiTask;
import com.imeeting.entity.biz.LlmModel;
import com.imeeting.entity.biz.Meeting;
import com.imeeting.entity.biz.MeetingTranscript;
import com.imeeting.entity.biz.PromptTemplate;
import com.imeeting.mapper.biz.LlmModelMapper;
import com.imeeting.mapper.biz.MeetingTranscriptMapper;
import com.imeeting.service.android.legacy.LegacyMeetingAdapterService;
import com.imeeting.service.android.AndroidPendingMeetingDraftService;
import com.imeeting.service.biz.AiTaskService;
import com.imeeting.service.biz.MeetingAccessService;
import com.imeeting.service.biz.MeetingRuntimeProfileResolver;
@ -60,7 +57,6 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
private final MeetingTranscriptMapper transcriptMapper;
private final LlmModelMapper llmModelMapper;
private final MeetingAudioUploadSupport meetingAudioUploadSupport;
private final AndroidPendingMeetingDraftService androidPendingMeetingDraftService;
@Override
@Transactional(rollbackFor = Exception.class)
@ -73,6 +69,33 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
throw new RuntimeException("会议时间不能为空");
}
Long creatorUserId;
Long tenantId;
String creatorName;
String sourceDeviceMode;
if (authContext != null && authContext.isAnonymous()) {
if (request.getUserId() == null || request.getTenantId() == null) {
throw new RuntimeException("公有设备创建会议缺少用户或租户信息");
}
creatorUserId = request.getUserId();
tenantId = request.getTenantId();
creatorName = normalizeCreatorName(request.getCreatorName(), creatorUserId);
sourceDeviceMode = MeetingConstants.DEVICE_MODE_PUBLIC;
} else {
if (loginUser == null || loginUser.getUserId() == null || loginUser.getTenantId() == null) {
throw new RuntimeException("安卓用户未登录或认证无效");
}
creatorUserId = loginUser.getUserId();
tenantId = loginUser.getTenantId();
creatorName = resolveCreatorName(loginUser);
sourceDeviceMode = MeetingConstants.DEVICE_MODE_PRIVATE;
}
Meeting existingMeeting = findLatestBlockingOfflineMeeting(authContext == null ? null : authContext.getDeviceId(), creatorUserId);
if (existingMeeting != null) {
throw new ExistingOfflineMeetingException(existingMeeting.getId());
}
Meeting meeting = meetingDomainSupport.initMeeting(
request.getTitle().trim(),
meetingTime,
@ -81,15 +104,15 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
null,
MeetingConstants.TYPE_OFFLINE,
MeetingConstants.SOURCE_ANDROID,
loginUser.getTenantId(),
loginUser.getUserId(),
resolveCreatorName(loginUser),
loginUser.getUserId(),
resolveCreatorName(loginUser),
tenantId,
creatorUserId,
creatorName,
creatorUserId,
creatorName,
MeetingConstants.SUMMARY_DETAIL_STANDARD,
0,
authContext == null ? null : authContext.getDeviceId(),
MeetingConstants.DEVICE_MODE_PRIVATE
sourceDeviceMode
);
meetingService.save(meeting);
@ -156,6 +179,7 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
meeting.setAudioUrl(relocatedUrl);
meeting.setAudioSaveStatus(RealtimeMeetingAudioStorageService.STATUS_SUCCESS);
meeting.setAudioSaveMessage(null);
meeting.setOfflineRecordingStatus(MeetingConstants.OFFLINE_RECORDING_UPLOAD_FINISHED);
meeting.setStatus(1);
meetingService.updateById(meeting);
@ -170,6 +194,8 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
@Override
@Transactional(rollbackFor = Exception.class)
public LegacyUploadAudioResponse uploadAndTriggerOfflineProcessForPublicDevice(Long meetingId,
Long promptId,
String modelCode,
boolean forceReplace,
MultipartFile audioFile,
AndroidAuthContext authContext) throws IOException {
@ -187,46 +213,48 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
if (!forceReplace && meeting.getAudioUrl() != null && !meeting.getAudioUrl().isBlank()) {
throw new RuntimeException("当前会议已存在音频,如需替换请设置 force_replace=true");
}
AndroidPendingMeetingDraft draft = androidPendingMeetingDraftService.get(meetingId);
if (draft == null || draft.getCommand() == null) {
throw new RuntimeException("未找到公有设备会议配置草稿");
}
long transcriptCount = transcriptMapper.selectCount(new LambdaQueryWrapper<MeetingTranscript>()
.eq(MeetingTranscript::getMeetingId, meetingId));
if (transcriptCount > 0) {
throw new RuntimeException("当前会议已存在转录内容,不支持替换已生成的转录");
}
PublicDeviceMeetingCreateCommand command = draft.getCommand();
LoginUser loginUser = toMeetingOwnerLoginUser(meeting);
if (promptId != null && !promptTemplateService.isTemplateEnabledForUser(
promptId,
loginUser.getTenantId(),
loginUser.getUserId(),
Boolean.TRUE.equals(loginUser.getIsPlatformAdmin()),
Boolean.TRUE.equals(loginUser.getIsTenantAdmin()))) {
throw new RuntimeException("总结模板不可用");
}
RealtimeMeetingRuntimeProfile profile = runtimeProfileResolver.resolve(
meeting.getTenantId(),
command.getAsrModelId(),
command.getSummaryModelId(),
command.getPromptId(),
null,
resolveSummaryModelId(modelCode, meeting.getTenantId()),
promptId,
null,
null,
command.getUseSpkId(),
null,
null,
command.getEnableTextRefine(),
null,
command.getHotWordGroupId(),
command.getHotWords()
null,
null,
null,
List.of()
);
String stagingUrl = storeStagingAudio(audioFile);
String relocatedUrl = meetingDomainSupport.relocateAudioUrl(meetingId, stagingUrl);
meeting.setAudioUrl(relocatedUrl);
meeting.setAudioSaveStatus(RealtimeMeetingAudioStorageService.STATUS_SUCCESS);
meeting.setAudioSaveMessage(null);
meeting.setOfflineRecordingStatus(MeetingConstants.OFFLINE_RECORDING_UPLOAD_FINISHED);
meeting.setStatus(1);
meetingService.updateById(meeting);
resetOrCreateAsrTask(meetingId, profile);
Long summaryModelId = profile.getResolvedSummaryModelId();
Long chapterModelId = command.getChapterModelId() != null ? command.getChapterModelId() : summaryModelId;
resetOrCreateChapterTask(meetingId, summaryModelId, chapterModelId, profile.getResolvedPromptId(), command.getUserPrompt(), command.getSummaryDetailLevel());
resetOrCreateSummaryTask(meetingId, summaryModelId, chapterModelId, profile.getResolvedPromptId(), command.getUserPrompt(), command.getSummaryDetailLevel());
resetOrCreateChapterTask(meetingId, profile);
resetOrCreateSummaryTask(meetingId, profile);
dispatchTasksAfterCommit(meetingId, meeting.getTenantId(), meeting.getCreatorId());
androidPendingMeetingDraftService.clear(meetingId);
return new LegacyUploadAudioResponse(meetingId, relocatedUrl);
}
@ -431,6 +459,13 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
return loginUser.getDisplayName() != null ? loginUser.getDisplayName() : loginUser.getUsername();
}
private String normalizeCreatorName(String creatorName, Long creatorUserId) {
if (creatorName != null && !creatorName.isBlank()) {
return creatorName.trim();
}
return creatorUserId == null ? "android" : String.valueOf(creatorUserId);
}
private void assertDeviceOwnsMeeting(Meeting meeting, AndroidAuthContext authContext) {
if (meeting == null || authContext == null || authContext.getDeviceId() == null) {
return;
@ -440,4 +475,28 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
throw new RuntimeException("当前会议不属于该设备");
}
}
private Meeting findLatestBlockingOfflineMeeting(String deviceId, Long creatorUserId) {
if (deviceId == null || deviceId.isBlank() || creatorUserId == null) {
return null;
}
return meetingService.getOne(new LambdaQueryWrapper<Meeting>()
.eq(Meeting::getMeetingType, MeetingConstants.TYPE_OFFLINE)
.eq(Meeting::getSourceDeviceCode, deviceId)
.eq(Meeting::getCreatorId, creatorUserId)
.and(wrapper -> wrapper
.eq(Meeting::getOfflineRecordingStatus, MeetingConstants.OFFLINE_RECORDING_ACTIVE)
.or()
.isNull(Meeting::getOfflineRecordingStatus))
.orderByDesc(Meeting::getId)
.last("LIMIT 1"));
}
private LoginUser toMeetingOwnerLoginUser(Meeting meeting) {
LoginUser loginUser = new LoginUser();
loginUser.setUserId(meeting.getCreatorId());
loginUser.setTenantId(meeting.getTenantId());
loginUser.setDisplayName(meeting.getCreatorName());
return loginUser;
}
}

View File

@ -34,6 +34,8 @@ public interface MeetingCommandService {
void completeRealtimeMeeting(Long meetingId, String audioUrl, boolean overwriteAudio);
void finishOfflineMeeting(Long meetingId, String finishStage);
void updateSpeakerInfo(Long meetingId, String speakerId, String newName, String label);
void updateMeetingTranscript(UpdateMeetingTranscriptCommand command);

View File

@ -493,6 +493,28 @@ public class MeetingCommandServiceImpl implements MeetingCommandService {
aiTaskService.dispatchSummaryTask(meetingId, meeting.getTenantId(), meeting.getCreatorId());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void finishOfflineMeeting(Long meetingId, String finishStage) {
Meeting meeting = meetingService.getById(meetingId);
if (meeting == null) {
throw new RuntimeException("会议不存在");
}
if (!MeetingConstants.TYPE_OFFLINE.equals(meeting.getMeetingType())) {
throw new RuntimeException("当前会议不是离线会议");
}
String normalizedStage = normalizeOfflineFinishStage(finishStage);
String currentStage = meeting.getOfflineRecordingStatus();
if (MeetingConstants.OFFLINE_RECORDING_UPLOAD_FINISHED.equals(currentStage)) {
return;
}
if (Objects.equals(currentStage, normalizedStage)) {
return;
}
meeting.setOfflineRecordingStatus(normalizedStage);
meetingService.updateById(meeting);
}
private void applyRealtimeAudioFinalizeResult(Meeting meeting, RealtimeMeetingAudioStorageService.FinalizeResult result) {
if (result == null) {
markAudioSaveFailure(meeting, RealtimeMeetingAudioStorageService.DEFAULT_FAILURE_MESSAGE);
@ -520,6 +542,18 @@ public class MeetingCommandServiceImpl implements MeetingCommandService {
: message);
}
private String normalizeOfflineFinishStage(String finishStage) {
if (finishStage == null || finishStage.isBlank()) {
throw new RuntimeException("结束阶段不能为空");
}
String normalized = finishStage.trim().toUpperCase();
if (MeetingConstants.OFFLINE_RECORDING_PRE_END.equals(normalized)
|| MeetingConstants.OFFLINE_RECORDING_UPLOAD_FINISHED.equals(normalized)) {
return normalized;
}
throw new RuntimeException("结束阶段无效");
}
private void prepareOfflineReprocessTasks(Long meetingId, RealtimeMeetingSessionStatusVO currentStatus) {
RealtimeMeetingResumeConfig resumeConfig = currentStatus == null ? null : currentStatus.getResumeConfig();
if (resumeConfig == null || resumeConfig.getAsrModelId() == null) {

View File

@ -86,6 +86,9 @@ public class MeetingDomainSupport {
meeting.setSourceDeviceMode(sourceDeviceMode);
meeting.setSummaryDetailLevel(normalizeSummaryDetailLevel(summaryDetailLevel));
meeting.setAudioSaveStatus(RealtimeMeetingAudioStorageService.STATUS_NONE);
if (MeetingConstants.TYPE_OFFLINE.equalsIgnoreCase(meetingType)) {
meeting.setOfflineRecordingStatus(MeetingConstants.OFFLINE_RECORDING_ACTIVE);
}
meeting.setStatus(status);
return meeting;
}
@ -396,6 +399,7 @@ public class MeetingDomainSupport {
vo.setMeetingSource(meeting.getMeetingSource());
vo.setSourceDeviceCode(meeting.getSourceDeviceCode());
vo.setSourceDeviceMode(meeting.getSourceDeviceMode());
vo.setOfflineRecordingStatus(meeting.getOfflineRecordingStatus());
vo.setSummaryDetailLevel(normalizeSummaryDetailLevel(meeting.getSummaryDetailLevel()));
vo.setAudioSaveStatus(meeting.getAudioSaveStatus());
vo.setAudioSaveMessage(meeting.getAudioSaveMessage());

View File

@ -16,21 +16,24 @@ public class AndroidChunkUploadSessionCache {
private final RedisSupport redisSupport;
public AndroidChunkUploadSessionState get(String uploadSessionId) {
if (uploadSessionId == null || uploadSessionId.isBlank()) {
public AndroidChunkUploadSessionState get(Long meetingId) {
if (meetingId == null) {
return null;
}
return redisSupport.getJsonQuietly(RedisKeys.androidChunkUploadSessionKey(uploadSessionId), AndroidChunkUploadSessionState.class);
return redisSupport.getJsonQuietly(RedisKeys.androidChunkUploadSessionKey(meetingId), AndroidChunkUploadSessionState.class);
}
public void save(String uploadSessionId, AndroidChunkUploadSessionState state) {
redisSupport.setJson(RedisKeys.androidChunkUploadSessionKey(uploadSessionId), state, SESSION_TTL);
}
public void clear(String uploadSessionId) {
if (uploadSessionId == null || uploadSessionId.isBlank()) {
public void save(Long meetingId, AndroidChunkUploadSessionState state) {
if (meetingId == null) {
return;
}
redisSupport.deleteQuietly(RedisKeys.androidChunkUploadSessionKey(uploadSessionId));
redisSupport.setJson(RedisKeys.androidChunkUploadSessionKey(meetingId), state, SESSION_TTL);
}
public void clear(Long meetingId) {
if (meetingId == null) {
return;
}
redisSupport.deleteQuietly(RedisKeys.androidChunkUploadSessionKey(meetingId));
}
}

View File

@ -31,15 +31,23 @@ public class AndroidPushMessageRetryTask {
.setMessageId(message.getMessageId())
.setTimestamp(System.currentTimeMillis())
.setType(message.getMessageType())
.setTitle("待开始会议")
.setTitle(resolveMessageTitle(message))
.setContent(message.getPayload() == null ? "" : message.getPayload())
.setNeedAck(true)
.build();
int pushed = androidGatewayPushService.pushToDevice(message.getDeviceCode(), pushMessage);
if (pushed > 0) {
androidPushMessageService.markPushed(message.getId());
log.info("Retried android push message, messageId={}, deviceCode={}, pushCountIncreased=true", message.getMessageId(), message.getDeviceCode());
log.info("Retried android push message, messageId={}, deviceCode={}, pushCountIncreased=true",
message.getMessageId(), message.getDeviceCode());
}
}
}
private String resolveMessageTitle(AndroidPushMessage message) {
if (message == null || message.getMessageTitle() == null || message.getMessageTitle().isBlank()) {
return "待处理消息";
}
return message.getMessageTitle();
}
}

View File

@ -34,5 +34,7 @@ unisbase:
server-base-url: ${APP_SERVER_BASE_URL:http://127.0.0.1:${server.port}}
upload-path: ${APP_UPLOAD_PATH:D:/data/imeeting/uploads/}
imeeting:
h5:
base-url: ${IMEETING_H5_BASE_URL:http://127.0.0.1:3000}
audio:
ffmpeg-path: D:\tools\exe\ffmpeg-master-latest-win64-gpl-shared\bin\ffmpeg

View File

@ -22,5 +22,7 @@ unisbase:
server-base-url: ${APP_SERVER_BASE_URL:http://127.0.0.1:${server.port}}
upload-path: ${APP_UPLOAD_PATH:/data/imeeting/uploads/}
imeeting:
h5:
base-url: ${IMEETING_H5_BASE_URL}
audio:
ffmpeg-path: ${IMEETING_AUDIO_FFMPEG_PATH:ffmpeg}

View File

@ -26,5 +26,7 @@ unisbase:
server-base-url: ${APP_SERVER_BASE_URL:http://10.100.53.199:${server.port}}
upload-path: ${APP_UPLOAD_PATH:D:/data/imeeting-test/uploads/}
imeeting:
h5:
base-url: ${IMEETING_H5_BASE_URL:http://127.0.0.1:3000}
audio:
ffmpeg-path: ${IMEETING_AUDIO_FFMPEG_PATH:ffmpeg}

View File

@ -184,10 +184,16 @@ export const createMeeting = (data: CreateMeetingCommand) => {
);
};
export const createPublicDeviceMeetingBySession = (sessionId: string, data: PublicDeviceMeetingCreateCommand) => {
return http.post<{ code: string; data: MeetingVO; msg: string }>(
export const createPublicDeviceMeetingBySession = (sessionId: string) => {
return http.post<{ code: string; data: boolean; msg: string }>(
`/api/biz/public-device-meetings/sessions/${sessionId}/create`,
data
{}
);
};
export const getMeetingShareConfig = () => {
return http.get<{ code: string; data: { h5BaseUrl?: string }; msg: string }>(
"/api/biz/meeting/share-config"
);
};

View File

@ -31,6 +31,7 @@ import {
getMeetingDetail,
getMeetingChapters,
getMeetingProgress,
getMeetingShareConfig,
getTranscripts,
MeetingChapterVO,
MeetingProgress,
@ -159,11 +160,13 @@ const getMeetingAudioDownloadName = (meeting?: Pick<MeetingVO, 'title' | 'audioU
return `${sanitizeDownloadFileName(meeting?.title)}-录音.${extension}`;
};
const buildMeetingPreviewUrl = (meetingId?: number, accessPassword?: string) => {
if (!meetingId || Number.isNaN(meetingId) || typeof window === 'undefined') {
const buildMeetingPreviewUrl = (baseUrl?: string, meetingId?: number, accessPassword?: string) => {
const normalizedBaseUrl = (baseUrl || '').trim();
if (!normalizedBaseUrl || !meetingId || Number.isNaN(meetingId)) {
return '';
}
const url = new URL(`/meetings/${meetingId}/preview`, window.location.origin);
const safeBaseUrl = normalizedBaseUrl.endsWith('/') ? normalizedBaseUrl.slice(0, -1) : normalizedBaseUrl;
const url = new URL(`${safeBaseUrl}/meetings/${meetingId}/preview`);
const normalizedPassword = (accessPassword || '').trim();
if (normalizedPassword) {
url.searchParams.set('accessPassword', normalizedPassword);
@ -864,6 +867,7 @@ const MeetingDetail: React.FC = () => {
const [highlightKeyword, setHighlightKeyword] = useState('');
const [linkedTranscriptIds, setLinkedTranscriptIds] = useState<number[]>([]);
const [linkedChapterKey, setLinkedChapterKey] = useState<string | null>(null);
const [meetingShareBaseUrl, setMeetingShareBaseUrl] = useState('');
const audioRef = useRef<HTMLAudioElement>(null);
const [audioCurrentTime, setAudioCurrentTime] = useState(0);
@ -886,14 +890,16 @@ const MeetingDetail: React.FC = () => {
const fetchData = useCallback(async (meetingId: number) => {
try {
const [detailRes, transcriptRes, chapterRes] = await Promise.all([
const [detailRes, transcriptRes, chapterRes, shareConfigRes] = await Promise.all([
getMeetingDetail(meetingId),
getTranscripts(meetingId),
getMeetingChapters(meetingId),
getMeetingShareConfig().catch(() => null),
]);
setMeeting(detailRes.data.data);
setTranscripts(transcriptRes.data.data || []);
setMeetingChapters(chapterRes.data.data || []);
setMeetingShareBaseUrl(shareConfigRes?.data?.data?.h5BaseUrl || '');
} catch (error) {
console.error(error);
} finally {
@ -1003,12 +1009,12 @@ const MeetingDetail: React.FC = () => {
}, [analysis.chapters, meetingChapters, transcripts]);
const sharePreviewUrl = useMemo(() => {
const meetingId = meeting?.id ?? (id ? Number(id) : NaN);
return buildMeetingPreviewUrl(meetingId);
}, [meeting?.id, id]);
return buildMeetingPreviewUrl(meetingShareBaseUrl, meetingId);
}, [meetingShareBaseUrl, meeting?.id, id]);
const meetingPreviewUrl = useMemo(() => {
const meetingId = meeting?.id ?? (id ? Number(id) : NaN);
return buildMeetingPreviewUrl(meetingId, previewAccessPassword);
}, [meeting?.id, id, previewAccessPassword]);
return buildMeetingPreviewUrl(meetingShareBaseUrl, meetingId, previewAccessPassword);
}, [meetingShareBaseUrl, meeting?.id, id, previewAccessPassword]);
const isOwner = useMemo(() => {
if (!meeting) return false;

View File

@ -1,62 +1,19 @@
import { App, Button, Card, Col, DatePicker, Form, Input, Radio, Row, Select, Space, Spin, Typography } from "antd";
import { AudioOutlined, CheckCircleOutlined, QrcodeOutlined } from "@ant-design/icons";
import dayjs from "dayjs";
import { useEffect, useMemo, useState } from "react";
import { App, Button, Card, Result, Space, Spin, Typography } from "antd";
import { CheckCircleOutlined, QrcodeOutlined } from "@ant-design/icons";
import { useEffect, useState } from "react";
import { useNavigate, useParams } from "react-router-dom";
import { listUsers } from "@/api";
import { getAiModelDefault, getAiModelPage, type AiModelVO } from "@/api/business/aimodel";
import { getHotWordPage, type HotWordVO } from "@/api/business/hotword";
import { getHotWordGroupOptions, type HotWordGroupVO } from "@/api/business/hotwordGroup";
import {
createPublicDeviceMeetingBySession,
type PublicDeviceMeetingCreateCommand,
type SummaryDetailLevel,
} from "@/api/business/meeting";
import { getPromptPage, type PromptTemplateVO } from "@/api/business/prompt";
import type { SysUser } from "@/types";
import { createPublicDeviceMeetingBySession } from "@/api/business/meeting";
const { Title, Text } = Typography;
const { Option } = Select;
type FormValues = {
title: string;
meetingTime: dayjs.Dayjs;
participants?: number[];
tags?: string[];
hostUserId?: number;
asrModelId: number;
summaryModelId: number;
promptId: number;
hotWordGroupId?: number;
summaryDetailLevel: SummaryDetailLevel;
useSpkId?: boolean;
enableTextRefine?: boolean;
userPrompt?: string;
accessPassword?: string;
};
export default function PublicDeviceMeetingCreate() {
const { message } = App.useApp();
const navigate = useNavigate();
const { sessionId } = useParams<{ sessionId: string }>();
const [form] = Form.useForm<FormValues>();
const [loading, setLoading] = useState(true);
const [ready, setReady] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [asrModels, setAsrModels] = useState<AiModelVO[]>([]);
const [llmModels, setLlmModels] = useState<AiModelVO[]>([]);
const [prompts, setPrompts] = useState<PromptTemplateVO[]>([]);
const [hotwordList, setHotwordList] = useState<HotWordVO[]>([]);
const [hotWordGroups, setHotWordGroups] = useState<HotWordGroupVO[]>([]);
const [userList, setUserList] = useState<SysUser[]>([]);
const watchedPromptId = Form.useWatch("promptId", form);
const watchedHotWordGroupId = Form.useWatch("hotWordGroupId", form);
const selectedPrompt = useMemo(
() => prompts.find((item) => item.id === watchedPromptId) || null,
[prompts, watchedPromptId]
);
const [confirmed, setConfirmed] = useState(false);
useEffect(() => {
const token = localStorage.getItem("accessToken");
@ -65,239 +22,126 @@ export default function PublicDeviceMeetingCreate() {
navigate(`/login?redirect=${redirect}`, { replace: true });
return;
}
void loadInitialData();
setReady(true);
}, [navigate]);
const loadInitialData = async () => {
setLoading(true);
try {
const [asrRes, llmRes, promptRes, hotwordRes, hotWordGroupRes, users, defaultAsr, defaultLlm] = await Promise.all([
getAiModelPage({ current: 1, size: 100, type: "ASR" }),
getAiModelPage({ current: 1, size: 100, type: "LLM" }),
getPromptPage({ current: 1, size: 100 }),
getHotWordPage({ current: 1, size: 1000 }),
getHotWordGroupOptions(),
listUsers(),
getAiModelDefault("ASR"),
getAiModelDefault("LLM"),
]);
const activePrompts = promptRes.data.data.records.filter((item: PromptTemplateVO) => item.status === 1);
const defaultPrompt = activePrompts[0];
setAsrModels(asrRes.data.data.records.filter((item: AiModelVO) => item.status === 1));
setLlmModels(llmRes.data.data.records.filter((item: AiModelVO) => item.status === 1));
setPrompts(activePrompts);
setHotwordList(hotwordRes.data.data.records.filter((item: HotWordVO) => item.status === 1));
setHotWordGroups((hotWordGroupRes.data.data || []).filter((item: HotWordGroupVO) => item.status === 1));
setUserList(users || []);
form.setFieldsValue({
title: `设备会议 ${dayjs().format("MM-DD HH:mm")}`,
meetingTime: dayjs(),
asrModelId: defaultAsr.data.data?.id,
summaryModelId: defaultLlm.data.data?.id,
promptId: defaultPrompt?.id,
hotWordGroupId: defaultPrompt?.hotWordGroupId ?? 0,
summaryDetailLevel: "STANDARD",
useSpkId: true,
enableTextRefine: false,
});
} catch {
message.error("加载建会配置失败");
} finally {
setLoading(false);
}
};
const handleSubmit = async () => {
const handleConfirm = async () => {
if (!sessionId) {
message.error("扫码会话不存在");
return;
}
const values = await form.validateFields();
setSubmitting(true);
try {
const selectedHotWords = values.hotWordGroupId == null || values.hotWordGroupId === 0
? undefined
: hotwordList
.filter((item) => item.hotWordGroupId === values.hotWordGroupId)
.map((item) => item.word)
.filter((word) => !!word?.trim());
const payload: PublicDeviceMeetingCreateCommand = {
title: values.title,
meetingTime: values.meetingTime.format("YYYY-MM-DD HH:mm:ss"),
participants: values.participants?.join(",") || "",
tags: values.tags?.join(",") || "",
hostUserId: values.hostUserId,
asrModelId: values.asrModelId,
summaryModelId: values.summaryModelId,
promptId: values.promptId,
hotWordGroupId: values.hotWordGroupId,
summaryDetailLevel: values.summaryDetailLevel,
useSpkId: values.useSpkId ? 1 : 0,
enableTextRefine: !!values.enableTextRefine,
userPrompt: values.userPrompt,
hotWords: selectedHotWords,
accessPassword: values.accessPassword?.trim() || undefined,
};
await createPublicDeviceMeetingBySession(sessionId, payload);
message.success("会议已创建,已推送到设备");
form.resetFields();
navigate("/meetings");
await createPublicDeviceMeetingBySession(sessionId);
setConfirmed(true);
message.success("登录确认已发送到设备");
} catch {
message.error("创建设备会议失败");
message.error("登录确认失败");
} finally {
setSubmitting(false);
}
};
return (
<div style={{ minHeight: "100vh", background: "linear-gradient(180deg, #f7fbff 0%, #eef4f8 100%)", padding: "48px 16px" }}>
<div style={{ maxWidth: 980, margin: "0 auto" }}>
<Card style={{ borderRadius: 20, boxShadow: "0 24px 64px rgba(15, 49, 86, 0.08)", border: "1px solid #d9e6f2" }}>
<Space direction="vertical" size={8} style={{ width: "100%", marginBottom: 32 }}>
<Space size={12}>
<div style={{ width: 52, height: 52, borderRadius: 14, background: "#e6f4ff", display: "flex", alignItems: "center", justifyContent: "center", color: "#1677ff", fontSize: 24 }}>
<QrcodeOutlined />
</div>
<div>
<Title level={3} style={{ margin: 0 }}></Title>
<Text type="secondary"></Text>
</div>
</Space>
<Space size={16} wrap>
<Text type="secondary"><AudioOutlined /> </Text>
<Text type="secondary"><CheckCircleOutlined /> </Text>
</Space>
</Space>
{loading ? (
<div
style={{
minHeight: "100vh",
background: "linear-gradient(180deg, #f7fbff 0%, #eef4f8 100%)",
padding: "48px 16px",
}}
>
<div style={{ maxWidth: 720, margin: "0 auto" }}>
<Card
style={{
borderRadius: 20,
boxShadow: "0 24px 64px rgba(15, 49, 86, 0.08)",
border: "1px solid #d9e6f2",
}}
>
{!ready ? (
<div style={{ padding: "64px 0", textAlign: "center" }}>
<Spin />
</div>
) : (
<Form form={form} layout="vertical">
<Row gutter={24}>
<Col xs={24} md={12}>
<Form.Item name="title" label="会议标题" rules={[{ required: true, message: "请输入会议标题" }]}>
<Input size="large" placeholder="请输入会议标题" />
</Form.Item>
</Col>
<Col xs={24} md={12}>
<Form.Item name="meetingTime" label="会议时间" rules={[{ required: true, message: "请选择会议时间" }]}>
<DatePicker showTime style={{ width: "100%" }} size="large" />
</Form.Item>
</Col>
</Row>
<Row gutter={24}>
<Col xs={24} md={12}>
<Form.Item name="participants" label="参会人员">
<Select mode="multiple" placeholder="选择参会人员" showSearch optionFilterProp="children" size="large">
{userList.map((u) => (
<Option key={u.userId} value={u.userId}>{u.displayName || u.username}</Option>
))}
</Select>
</Form.Item>
</Col>
<Col xs={24} md={12}>
<Form.Item name="hostUserId" label="主持人">
<Select allowClear placeholder="默认当前登录人" showSearch optionFilterProp="children" size="large">
{userList.map((u) => (
<Option key={u.userId} value={u.userId}>{u.displayName || u.username}</Option>
))}
</Select>
</Form.Item>
</Col>
</Row>
<Row gutter={24}>
<Col xs={24} md={12}>
<Form.Item name="tags" label="会议标签">
<Select mode="tags" placeholder="输入标签" size="large" />
</Form.Item>
</Col>
<Col xs={24} md={12}>
<Form.Item name="accessPassword" label="访问密码">
<Input size="large" placeholder="可为空" />
</Form.Item>
</Col>
</Row>
<Row gutter={24}>
<Col xs={24} md={12}>
<Form.Item name="asrModelId" label="语音识别模型" rules={[{ required: true, message: "请选择 ASR 模型" }]}>
<Select placeholder="选择 ASR 模型" size="large">
{asrModels.map((m) => (
<Option key={m.id} value={m.id}>{m.modelName}</Option>
))}
</Select>
</Form.Item>
</Col>
<Col xs={24} md={12}>
<Form.Item name="summaryModelId" label="总结模型" rules={[{ required: true, message: "请选择总结模型" }]}>
<Select placeholder="选择总结模型" size="large">
{llmModels.map((m) => (
<Option key={m.id} value={m.id}>{m.modelName}</Option>
))}
</Select>
</Form.Item>
</Col>
</Row>
<Row gutter={24}>
<Col span={24}>
<Form.Item name="promptId" label="总结模板" rules={[{ required: true, message: "请选择总结模板" }]}>
<Select placeholder="请选择总结模板" showSearch optionFilterProp="children" size="large">
{prompts.map((p) => (
<Option key={p.id} value={p.id}>{p.templateName}</Option>
))}
</Select>
</Form.Item>
</Col>
</Row>
<Row gutter={24}>
<Col xs={24} md={12}>
<Form.Item
name="hotWordGroupId"
label="热词组"
extra={watchedHotWordGroupId != null ? "创建会议时优先使用这里选择的热词组" : undefined}
>
<Select
placeholder={selectedPrompt?.hotWordGroupId ? "默认已带出模板热词组,可按需修改" : "请选择热词组"}
size="large"
options={[{ label: "不使用热词组", value: 0 }, ...hotWordGroups.map((item) => ({ label: `${item.groupName} (${item.hotWordCount}/200)`, value: item.id }))]}
) : !sessionId ? (
<Result
status="error"
title="二维码参数无效"
subTitle="请返回设备端重新生成二维码后再扫码。"
extra={
<Button type="primary" onClick={() => navigate("/meetings")}>
</Button>
}
/>
</Form.Item>
</Col>
<Col xs={24} md={12}>
<Form.Item name="summaryDetailLevel" label="总结详细程度" rules={[{ required: true, message: "请选择总结详细程度" }]}>
<Radio.Group>
<Radio value="DETAILED"></Radio>
<Radio value="STANDARD"></Radio>
<Radio value="BRIEF"></Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
) : confirmed ? (
<Result
status="success"
title="登录确认已发送"
subTitle="安卓设备收到确认消息后,会继续按离线发会流程创建会议。"
extra={
<Button type="primary" onClick={() => navigate("/meetings")}>
</Button>
}
/>
) : (
<Space direction="vertical" size={24} style={{ width: "100%" }}>
<Space size={16} align="start">
<div
style={{
width: 56,
height: 56,
borderRadius: 16,
background: "#e6f4ff",
display: "flex",
alignItems: "center",
justifyContent: "center",
color: "#1677ff",
fontSize: 24,
}}
>
<QrcodeOutlined />
</div>
<div>
<Title level={3} style={{ margin: 0 }}>
</Title>
<Text type="secondary">
H5
</Text>
</div>
</Space>
<Row gutter={24}>
<Col span={24}>
<Form.Item name="userPrompt" label="用户提示词">
<Input.TextArea autoSize={{ minRows: 3, maxRows: 6 }} maxLength={1000} showCount placeholder="例如:请重点关注待办事项与负责人" />
</Form.Item>
</Col>
</Row>
<Card
bordered={false}
style={{
background: "#f6fbff",
border: "1px solid #d7e8f6",
borderRadius: 16,
}}
>
<Space direction="vertical" size={12}>
<Text>
<CheckCircleOutlined style={{ color: "#1677ff", marginRight: 8 }} />
线
</Text>
<Text type="secondary">
访
</Text>
</Space>
</Card>
<div style={{ display: "flex", justifyContent: "flex-end", marginTop: 24 }}>
<div style={{ display: "flex", justifyContent: "flex-end" }}>
<Space>
<Button size="large" onClick={() => navigate(-1)}></Button>
<Button type="primary" size="large" loading={submitting} onClick={() => void handleSubmit()}>
<Button size="large" onClick={() => navigate(-1)}>
</Button>
<Button type="primary" size="large" loading={submitting} onClick={() => void handleConfirm()}>
</Button>
</Space>
</div>
</Form>
</Space>
)}
</Card>
</div>

View File

@ -6,7 +6,6 @@ import { menuRoutes,extraRoutes } from "./routes";
const Login = lazy(() => import("@/pages/auth/login"));
const ResetPassword = lazy(() => import("@/pages/auth/reset-password"));
const MeetingPreview = lazy(() => import("@/pages/business/MeetingPreview"));
const PublicDeviceMeetingCreate = lazy(() => import("@/pages/business/PublicDeviceMeetingCreate"));
function RouteFallback() {
@ -71,10 +70,6 @@ export default function AppRoutes() {
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/reset-password" element={<ResetPassword />} />
<Route
path="/meetings/:id/preview"
element={<MeetingPreview />}
/>
<Route
path="/public-device-meetings/:sessionId/create"
element={

2
imeeting-h5/.gitignore vendored 100644
View File

@ -0,0 +1,2 @@
node_modules/
dist/

View File

@ -0,0 +1,12 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<title>iMeeting H5</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

4392
imeeting-h5/package-lock.json generated 100644

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
{
"name": "imeeting-h5",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite --host --port 5175",
"build": "tsc -b && vite build",
"preview": "vite preview --host --port 4175"
},
"dependencies": {
"@ant-design/icons": "^6.1.0",
"antd": "^5.13.2",
"axios": "^1.6.7",
"dayjs": "^1.11.13",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^10.1.0",
"react-router-dom": "^6.22.3"
},
"devDependencies": {
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"typescript": "^5.3.3",
"vite": "^5.0.12"
}
}

View File

@ -0,0 +1,14 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="10" fill="#2D6BFF"/>
<g transform="translate(16 15.6) rotate(35)" stroke="white" fill="none" stroke-width="1.8">
<rect x="-5.2" y="-10.2" width="10.4" height="10.4" rx="5.2"/>
<path d="M-2.2 0.2 H2.2 L1.1 10.4 H-1.1 Z"/>
</g>
<path
d="M12.5 22.6 C14.2 21.6 16 21.6 17.8 22.6 S21.4 23.8 23.2 22.6"
stroke="white"
stroke-width="1.8"
stroke-linecap="round"
fill="none"
/>
</svg>

After

Width:  |  Height:  |  Size: 543 B

View File

@ -0,0 +1,94 @@
import { lazy, Suspense } from "react";
import { Navigate, Route, Routes } from "react-router-dom";
import LoadingScreen from "@/components/LoadingScreen";
import MainLayout from "@/layouts/MainLayout";
import ProtectedRoute from "@/routes/ProtectedRoute";
import { hasAccessToken } from "@/utils/auth";
const LoginPage = lazy(() => import("@/pages/login"));
const MeetingsPage = lazy(() => import("@/pages/meetings"));
const MeetingDetailPage = lazy(() => import("@/pages/meeting-detail"));
const MeetingPreviewPage = lazy(() => import("@/pages/meeting-preview"));
const ProfilePage = lazy(() => import("@/pages/profile"));
const PasswordPage = lazy(() => import("@/pages/password"));
const AboutPage = lazy(() => import("@/pages/about"));
const ScanConfirmPage = lazy(() => import("@/pages/scan-confirm"));
function HomeRedirect() {
return <Navigate to={hasAccessToken() ? "/meetings" : "/login"} replace />;
}
export default function App() {
return (
<Suspense fallback={<LoadingScreen text="页面加载中..." />}>
<Routes>
<Route path="/" element={<HomeRedirect />} />
<Route path="/login" element={<LoginPage />} />
<Route path="/meetings/:id/preview" element={<MeetingPreviewPage />} />
<Route
path="/meetings"
element={
<ProtectedRoute>
<MainLayout activeTab="meetings">
<MeetingsPage />
</MainLayout>
</ProtectedRoute>
}
/>
<Route
path="/meetings/:id"
element={
<ProtectedRoute>
<MainLayout>
<MeetingDetailPage />
</MainLayout>
</ProtectedRoute>
}
/>
<Route
path="/profile"
element={
<ProtectedRoute>
<MainLayout activeTab="profile">
<ProfilePage />
</MainLayout>
</ProtectedRoute>
}
/>
<Route
path="/profile/password"
element={
<ProtectedRoute>
<MainLayout>
<PasswordPage />
</MainLayout>
</ProtectedRoute>
}
/>
<Route
path="/about"
element={
<ProtectedRoute>
<MainLayout>
<AboutPage />
</MainLayout>
</ProtectedRoute>
}
/>
<Route
path="/scan-confirm/:sessionId"
element={
<ProtectedRoute>
<MainLayout>
<ScanConfirmPage />
</MainLayout>
</ProtectedRoute>
}
/>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>
);
}

View File

@ -0,0 +1,19 @@
import http from "@/api/http";
import type { CaptchaResponse, TokenResponse } from "@/types";
export interface LoginPayload {
username: string;
password: string;
captchaId?: string;
captchaCode?: string;
}
export async function fetchCaptcha() {
const resp = await http.get("/sys/auth/captcha");
return resp.data.data as CaptchaResponse;
}
export async function login(payload: LoginPayload) {
const resp = await http.post("/sys/auth/login", payload);
return resp.data.data as TokenResponse;
}

View File

@ -0,0 +1,154 @@
import axios from "axios";
import { message } from "antd";
import { buildLoginRedirect, clearAuth, getAccessToken, getRefreshToken, saveTokens } from "@/utils/auth";
declare module "axios" {
interface AxiosRequestConfig {
suppressErrorToast?: boolean;
}
interface InternalAxiosRequestConfig {
suppressErrorToast?: boolean;
_retry?: boolean;
}
}
const AUTH_WHITELIST = ["/sys/auth/login", "/sys/auth/refresh", "/sys/auth/captcha", "/sys/auth/device-code"];
const SUCCESS_CODE = "200";
const REFRESH_AHEAD_MS = 60 * 1000;
const http = axios.create({
baseURL: "/",
timeout: 15000,
});
const refreshClient = axios.create({
baseURL: "/",
timeout: 15000,
});
let refreshPromise: Promise<string | null> | null = null;
function isSuccessCode(code: unknown) {
return String(code) === SUCCESS_CODE;
}
function isAuthWhitelistRequest(url?: string) {
return AUTH_WHITELIST.some((path) => (url || "").includes(path));
}
function getTokenExpireAt(token: string): number | null {
try {
const payload = token.split(".")[1];
if (!payload) {
return null;
}
const normalized = payload.replace(/-/g, "+").replace(/_/g, "/");
const parsed = JSON.parse(decodeURIComponent(escape(window.atob(normalized))));
return typeof parsed.exp === "number" ? parsed.exp * 1000 : null;
} catch {
return null;
}
}
function isTokenExpiringSoon(token: string) {
const expireAt = getTokenExpireAt(token);
if (!expireAt) {
return false;
}
return expireAt - Date.now() <= REFRESH_AHEAD_MS;
}
async function refreshAccessToken(): Promise<string | null> {
if (refreshPromise) {
return refreshPromise;
}
const refreshToken = getRefreshToken();
if (!refreshToken) {
return null;
}
refreshPromise = refreshClient
.post("/sys/auth/refresh", { refreshToken })
.then((resp) => {
const body = resp.data;
if (!body || !isSuccessCode(body.code) || !body.data?.accessToken || !body.data?.refreshToken) {
throw new Error(body?.msg || "刷新登录态失败");
}
saveTokens(body.data.accessToken, body.data.refreshToken);
return body.data.accessToken as string;
})
.catch(() => {
clearAuth();
return null;
})
.finally(() => {
refreshPromise = null;
});
return refreshPromise;
}
http.interceptors.request.use(async (config) => {
if (!isAuthWhitelistRequest(config.url)) {
const currentToken = getAccessToken();
if (currentToken && isTokenExpiringSoon(currentToken)) {
await refreshAccessToken();
}
}
const token = getAccessToken();
if (token) {
config.headers = config.headers || {};
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
http.interceptors.response.use(
(resp) => {
const body = resp.data;
if (body && !isSuccessCode(body.code)) {
const errorMsg = body.msg || "请求失败";
if (!resp.config?.suppressErrorToast) {
message.error(errorMsg);
}
const err = new Error(errorMsg);
(err as Error & { code?: string }).code = body.code;
return Promise.reject(err);
}
return resp;
},
async (error) => {
const originalRequest = error.config || {};
if (
error.response?.status === 401 &&
!originalRequest._retry &&
!isAuthWhitelistRequest(originalRequest.url)
) {
originalRequest._retry = true;
const newToken = await refreshAccessToken();
if (newToken) {
originalRequest.headers = originalRequest.headers || {};
originalRequest.headers.Authorization = `Bearer ${newToken}`;
return http(originalRequest);
}
}
if (error.response && (error.response.status === 401 || error.response.status === 403)) {
clearAuth();
window.location.href = buildLoginRedirect();
return Promise.reject(error);
}
const errorMsg = error.response?.data?.msg || error.message || "网络异常";
if (!originalRequest.suppressErrorToast) {
message.error(errorMsg);
}
return Promise.reject(error);
},
);
export default http;

View File

@ -0,0 +1,72 @@
import http from "@/api/http";
import type {
MeetingChapterVO,
MeetingPageResult,
MeetingPreviewAccessVO,
MeetingTranscriptVO,
MeetingVO,
PublicMeetingPreviewVO,
UpdateMeetingBasicCommand,
} from "@/types";
const AUDIO_MIME_TYPE_BY_EXTENSION: Record<string, string> = {
mp3: "audio/mpeg",
wav: "audio/wav",
m4a: "audio/mp4",
mp4: "audio/mp4",
aac: "audio/aac",
};
export const resolveAudioMimeType = (audioUrl?: string) => {
if (!audioUrl) {
return undefined;
}
const normalizedUrl = audioUrl.split("#")[0]?.split("?")[0] || "";
const extension = normalizedUrl.match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase();
return extension ? AUDIO_MIME_TYPE_BY_EXTENSION[extension] : undefined;
};
export const resolveMeetingPlaybackAudioUrl = (
meeting?: Pick<MeetingVO, "audioUrl" | "playbackAudioUrl"> | null,
) => {
return meeting?.playbackAudioUrl || meeting?.audioUrl;
};
export const getMeetingPage = (params: {
current: number;
size: number;
title?: string;
viewType?: "all" | "created" | "involved";
}) => {
return http.get<{ code: string; data: MeetingPageResult; msg: string }>("/api/biz/meeting/page", { params });
};
export const getMeetingDetail = (id: number) => {
return http.get<{ code: string; data: MeetingVO; msg: string }>(`/api/biz/meeting/${id}`);
};
export const getMeetingTranscripts = (id: number) => {
return http.get<{ code: string; data: MeetingTranscriptVO[]; msg: string }>(`/api/biz/meeting/${id}/transcripts`);
};
export const getMeetingChapters = (id: number) => {
return http.get<{ code: string; data: MeetingChapterVO[]; msg: string }>(`/api/biz/meeting/${id}/chapters`);
};
export const updateMeetingBasic = (data: UpdateMeetingBasicCommand) => {
return http.put<{ code: string; data: boolean; msg: string }>(`/api/biz/meeting/${data.meetingId}/basic`, data);
};
export const getMeetingPreviewAccess = (id: number) => {
return http.get<{ code: string; data: MeetingPreviewAccessVO; msg: string }>(`/api/public/meetings/${id}/preview/access`);
};
export const getPublicMeetingPreview = (id: number, accessPassword?: string) => {
return http.get<{ code: string; data: PublicMeetingPreviewVO; msg: string }>(`/api/public/meetings/${id}/preview`, {
params: accessPassword ? { accessPassword } : undefined,
});
};
export const createPublicDeviceMeetingBySession = (sessionId: string) => {
return http.post<{ code: string; data: boolean; msg: string }>(`/api/biz/public-device-meetings/sessions/${sessionId}/create`);
};

View File

@ -0,0 +1,12 @@
import http from "@/api/http";
import type { SysPlatformConfig } from "@/types/platform";
export async function getOpenPlatformConfig() {
const resp = await http.get("/sys/api/open/platform/config");
return resp.data.data as SysPlatformConfig;
}
export async function getSystemParamValue(key: string, defaultValue?: string) {
const resp = await http.get("/sys/api/params/value", { params: { key, defaultValue } });
return resp.data.data as string;
}

View File

@ -0,0 +1,18 @@
import http from "@/api/http";
import type { UserProfile } from "@/types";
export interface UpdatePasswordPayload {
oldPassword: string;
newPassword: string;
confirmPassword?: string;
}
export async function getCurrentUser() {
const resp = await http.get("/sys/api/users/me");
return resp.data.data as UserProfile;
}
export async function updateMyPassword(payload: UpdatePasswordPayload) {
const resp = await http.put("/sys/api/users/password", payload);
return resp.data.data as boolean;
}

View File

@ -0,0 +1,28 @@
import { FileTextOutlined, UserOutlined } from "@ant-design/icons";
import { Link } from "react-router-dom";
interface BottomNavProps {
activeTab: "meetings" | "profile";
}
const items = [
{ key: "meetings", label: "我的会议", icon: <FileTextOutlined />, to: "/meetings" },
{ key: "profile", label: "个人中心", icon: <UserOutlined />, to: "/profile" },
] as const;
export default function BottomNav({ activeTab }: BottomNavProps) {
return (
<nav className="h5-bottom-nav">
{items.map((item) => (
<Link
key={item.key}
to={item.to}
className={`h5-bottom-nav__item${activeTab === item.key ? " is-active" : ""}`}
>
<span className="h5-bottom-nav__icon">{item.icon}</span>
<span>{item.label}</span>
</Link>
))}
</nav>
);
}

View File

@ -0,0 +1,10 @@
import { Spin } from "antd";
export default function LoadingScreen({ text = "加载中..." }: { text?: string }) {
return (
<div className="state-panel">
<Spin size="large" />
<div className="state-panel__text">{text}</div>
</div>
);
}

View File

@ -0,0 +1,32 @@
import { ArrowLeftOutlined } from "@ant-design/icons";
import { Button } from "antd";
import type { ReactNode } from "react";
import { useNavigate } from "react-router-dom";
interface PageHeaderProps {
title: string;
extra?: ReactNode;
back?: boolean;
}
export default function PageHeader({ title, extra, back = false }: PageHeaderProps) {
const navigate = useNavigate();
return (
<header className="page-header">
<div className="page-header__left">
{back ? (
<Button
type="text"
shape="circle"
icon={<ArrowLeftOutlined />}
onClick={() => navigate(-1)}
className="page-header__back"
/>
) : null}
<h1 className="page-header__title">{title}</h1>
</div>
{extra ? <div className="page-header__extra">{extra}</div> : null}
</header>
);
}

View File

@ -0,0 +1,76 @@
import { createContext, useContext, useEffect, useMemo, useState, type PropsWithChildren } from "react";
import { getOpenPlatformConfig, getSystemParamValue } from "@/api/platform";
import type { PlatformConfigState } from "@/types/platform";
const DEFAULT_STATE: PlatformConfigState = {
platformConfig: null,
captchaEnabled: true,
loaded: false,
};
const PlatformConfigContext = createContext<PlatformConfigState>(DEFAULT_STATE);
function applyFavicon(iconUrl?: string) {
if (typeof document === "undefined" || !iconUrl) {
return;
}
let link = document.querySelector("link[rel='icon']") as HTMLLinkElement | null;
if (!link) {
link = document.createElement("link");
link.rel = "icon";
document.head.appendChild(link);
}
link.href = iconUrl;
}
export function PlatformConfigProvider({ children }: PropsWithChildren) {
const [state, setState] = useState<PlatformConfigState>(DEFAULT_STATE);
useEffect(() => {
let active = true;
const init = async () => {
try {
const [captchaValue, platformConfig] = await Promise.all([
getSystemParamValue("security.captcha.enabled", "true"),
getOpenPlatformConfig(),
]);
if (!active) {
return;
}
applyFavicon(platformConfig?.iconUrl);
setState({
platformConfig,
captchaEnabled: captchaValue !== "false",
loaded: true,
});
} catch {
if (!active) {
return;
}
setState({
platformConfig: null,
captchaEnabled: true,
loaded: true,
});
}
};
void init();
return () => {
active = false;
};
}, []);
const value = useMemo(() => state, [state]);
return <PlatformConfigContext.Provider value={value}>{children}</PlatformConfigContext.Provider>;
}
export function usePlatformConfig() {
return useContext(PlatformConfigContext);
}

View File

@ -9,22 +9,14 @@
--text-main: #1a1f36;
--text-secondary: #6e7695;
--card-shadow: 0 10px 30px rgba(127, 139, 186, 0.08);
height: 100vh;
min-height: 100vh;
display: flex;
flex-direction: column;
background: var(--bg-app);
color: var(--text-main);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
overflow: hidden;
}
/* Glassmorphism Header - Now redundant but kept for safety if needed */
.meeting-preview-header {
display: none;
}
/* Main Container */
.meeting-preview-container {
flex: 1;
overflow-y: auto;
@ -37,7 +29,6 @@
padding: 48px 24px;
}
/* Hero Section */
.meeting-preview-top-hero {
display: flex;
gap: 24px;
@ -84,17 +75,11 @@
font-size: 13px;
font-weight: 700;
}
.meeting-preview-status-tag.is-complete { background: #e6f4ea; color: #1e8e3e; }
.meeting-preview-status-tag.is-processing { background: #e8f0fe; color: #1a73e8; }
.meeting-preview-status-tag.is-warning { background: #fff4e5; color: #b76e00; }
.meeting-preview-hero-id {
font-size: 13px;
color: var(--text-secondary);
font-family: monospace;
}
/* Collapsible Info */
.meeting-preview-collapsible-section {
background: var(--bg-surface);
border-radius: 20px;
@ -133,7 +118,7 @@
}
.meeting-preview-collapsible-content.is-expanded {
max-height: 400px;
max-height: 420px;
}
.meeting-preview-metrics-grid {
@ -143,18 +128,6 @@
gap: 24px;
}
@media (max-width: 992px) {
.meeting-preview-metrics-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 480px) {
.meeting-preview-metrics-grid {
grid-template-columns: 1fr;
}
}
.metric-item {
display: flex;
flex-direction: column;
@ -194,7 +167,36 @@
font-weight: 600;
}
/* Share Bar */
.meeting-preview-share-settings {
background: #ffffff;
border: 1px solid var(--border-color);
border-radius: 20px;
margin-bottom: 24px;
padding: 20px 24px;
box-shadow: var(--card-shadow);
}
.meeting-preview-share-settings-title {
font-size: 18px;
font-weight: 800;
margin-bottom: 4px;
}
.meeting-preview-share-settings-desc {
color: var(--text-secondary);
margin-bottom: 16px;
}
.meeting-preview-share-settings-row {
display: flex;
gap: 12px;
align-items: center;
}
.meeting-preview-share-settings-row .ant-input-affix-wrapper {
border-radius: 14px;
}
.meeting-preview-share-bar {
display: flex;
gap: 16px;
@ -222,7 +224,6 @@
background: white !important;
}
/* Tabs and Content */
.meeting-preview-content-card {
background: var(--bg-surface);
border-radius: 24px;
@ -297,7 +298,6 @@
font-size: 14px;
}
/* Catalog List & Timeline */
.meeting-preview-catalog-list {
display: flex;
flex-direction: column;
@ -415,12 +415,6 @@
visibility: visible;
}
.meeting-preview-catalog-item-link:hover {
background: rgba(95, 81, 255, 0.15);
transform: translateY(-1px);
}
/* --- Transcription Original Styles Overhaul --- */
.meeting-preview-transcript-list {
display: flex;
flex-direction: column;
@ -510,7 +504,6 @@
word-wrap: break-word;
}
/* --- Floating Audio Player Overhaul --- */
.meeting-preview-audio-player-inline {
position: fixed;
bottom: 24px;
@ -518,7 +511,6 @@
transform: translateX(-50%);
width: calc(100% - 32px);
max-width: 720px;
height: auto;
min-height: 80px;
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(24px) saturate(180%);
@ -528,9 +520,7 @@
padding: 12px 24px;
border-radius: 28px;
z-index: 1000;
box-shadow:
0 25px 50px -12px rgba(95, 81, 255, 0.25),
0 0 0 1px rgba(95, 81, 255, 0.05);
box-shadow: 0 25px 50px -12px rgba(95, 81, 255, 0.25), 0 0 0 1px rgba(95, 81, 255, 0.05);
}
.audio-player-content {
@ -538,7 +528,6 @@
display: flex;
align-items: center;
gap: 16px;
flex-wrap: nowrap;
}
.audio-play-btn {
@ -554,12 +543,6 @@
font-size: 20px;
cursor: pointer;
flex-shrink: 0;
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.audio-play-btn:hover {
transform: scale(1.05);
box-shadow: 0 8px 15px rgba(95, 81, 255, 0.3);
}
.audio-progress-container {
@ -571,7 +554,7 @@
}
.audio-time {
font-family: 'JetBrains Mono', monospace;
font-family: "JetBrains Mono", monospace;
font-size: 11px;
font-weight: 700;
color: var(--text-secondary);
@ -607,253 +590,8 @@
cursor: pointer;
color: var(--primary-blue);
flex-shrink: 0;
transition: all 0.2s;
}
.audio-speed-btn:hover {
background: #eef1ff;
}
/* --- Password Gate Overhaul --- */
.is-password-gate {
justify-content: center;
align-items: center;
overflow: hidden;
position: relative;
}
.password-gate-background {
position: absolute;
inset: 0;
z-index: 0;
overflow: hidden;
}
.bg-blob {
position: absolute;
filter: blur(80px);
opacity: 0.4;
border-radius: 50%;
animation: blob-float 20s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
.bg-blob-1 {
width: 500px;
height: 500px;
background: #5f51ff;
top: -100px;
left: -100px;
}
.bg-blob-2 {
width: 400px;
height: 400px;
background: #6c8cff;
bottom: -50px;
right: -50px;
animation-delay: -5s;
}
.bg-blob-3 {
width: 300px;
height: 300px;
background: #8e84ff;
top: 40%;
left: 30%;
animation-delay: -10s;
}
@keyframes blob-float {
0% { transform: translate(0, 0) scale(1) rotate(0deg); }
33% { transform: translate(30px, 50px) scale(1.1) rotate(10deg); }
66% { transform: translate(-20px, 20px) scale(0.9) rotate(-10deg); }
100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}
.is-password-gate .meeting-preview-shell {
width: 100%;
max-width: 480px;
padding: 24px;
z-index: 10;
margin: 0;
}
.meeting-preview-password-card {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(32px) saturate(200%);
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 32px;
padding: 48px 40px;
box-shadow:
0 40px 100px -20px rgba(95, 81, 255, 0.15),
0 0 0 1px rgba(95, 81, 255, 0.05);
display: flex;
flex-direction: column;
gap: 32px;
}
.password-card-header {
text-align: center;
}
.password-icon-wrapper {
width: 64px;
height: 64px;
background: var(--primary-gradient);
color: white;
font-size: 28px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 20px;
margin: 0 auto 24px;
box-shadow: 0 12px 24px rgba(95, 81, 255, 0.25);
}
.password-card-title {
font-size: 24px;
font-weight: 800;
color: var(--text-main);
margin-bottom: 12px;
letter-spacing: -0.02em;
}
.password-card-subtitle {
font-size: 15px;
color: var(--text-secondary);
line-height: 1.6;
max-width: 320px;
margin: 0 auto;
}
.password-card-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.modern-password-input {
border-radius: 16px !important;
border: 2px solid rgba(228, 232, 245, 0.8) !important;
padding: 12px 16px !important;
transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
background: white !important;
}
.modern-password-input:focus,
.modern-password-input-focused {
border-color: var(--primary-blue) !important;
box-shadow: 0 0 0 4px rgba(95, 81, 255, 0.1) !important;
}
.password-submit-btn {
height: 56px !important;
border-radius: 16px !important;
font-size: 16px !important;
font-weight: 700 !important;
letter-spacing: 0.02em;
background: var(--primary-gradient) !important;
border: none !important;
box-shadow: 0 12px 24px rgba(95, 81, 255, 0.2) !important;
transition: all 0.3s ease !important;
}
.password-submit-btn:hover {
transform: translateY(-2px);
box-shadow: 0 16px 32px rgba(95, 81, 255, 0.3) !important;
}
.password-error-message {
animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
10%, 90% { transform: translate3d(-1px, 0, 0); }
20%, 80% { transform: translate3d(2px, 0, 0); }
30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
40%, 60% { transform: translate3d(4px, 0, 0); }
}
.password-gate-footer {
position: absolute;
bottom: 32px;
z-index: 10;
}
.footer-disclaimer {
display: flex;
align-items: center;
gap: 8px;
color: var(--text-secondary);
font-size: 13px;
font-weight: 600;
opacity: 0.7;
}
@media (max-width: 480px) {
.meeting-preview-password-card {
padding: 40px 24px;
border-radius: 24px;
}
}
/* --- Mobile Optimizations --- */
@media (max-width: 768px) {
.meeting-preview-transcript-list {
gap: 16px;
}
.meeting-preview-transcript-item {
gap: 12px;
padding: 10px;
}
.meeting-preview-transcript-avatar {
width: 36px;
height: 36px;
border-radius: 10px;
font-size: 14px;
}
.meeting-preview-transcript-text {
font-size: 15px;
}
/* Fix audio player deformation on mobile */
.meeting-preview-audio-player-inline {
padding: 10px 16px;
bottom: 16px;
border-radius: 22px;
}
.audio-player-content {
gap: 10px;
}
.audio-play-btn {
width: 40px;
height: 40px;
border-radius: 12px;
font-size: 18px;
}
.audio-time {
display: block;
font-size: 10px;
}
.audio-progress-container {
gap: 0;
}
.audio-speed-btn {
width: 38px;
height: 32px;
font-size: 11px;
}
}
/* Utils */
.meeting-preview-footer {
margin-top: 64px;
padding-bottom: 64px;
@ -872,107 +610,57 @@
border-radius: 99px;
}
.meeting-preview-loading,
.meeting-preview-empty {
padding-top: 32px;
}
.meeting-preview-password-card {
max-width: 480px;
margin: 0 auto;
}
@media (max-width: 992px) {
.meeting-preview-metrics-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.meeting-preview-shell { padding: 32px 16px; }
.meeting-preview-hero-title { font-size: 24px; }
.meeting-preview-metrics-grid { grid-template-columns: 1fr; gap: 16px; }
.meeting-preview-share-bar,
.meeting-preview-share-settings-row {
flex-direction: column;
}
.meeting-preview-share-bar .ant-btn,
.meeting-preview-share-settings-row .ant-btn,
.meeting-preview-share-settings-row .ant-input-affix-wrapper {
width: 100%;
}
.meeting-preview-tabs-container {
padding: 8px 12px 0;
}
.meeting-preview-tabs-container .ant-tabs-nav::before {
inset-inline: 0;
}
.meeting-preview-tabs-container .ant-tabs-nav-list {
width: 100%;
display: grid !important;
grid-template-columns: repeat(3, minmax(0, 1fr));
transform: none !important;
}
.meeting-preview-tabs-container .ant-tabs-tab {
margin: 0 !important;
padding: 14px 8px !important;
justify-content: center;
text-align: center;
min-width: 0;
}
.meeting-preview-tabs-container .ant-tabs-tab .ant-tabs-tab-btn {
width: 100%;
font-size: 14px;
line-height: 1.2;
white-space: nowrap;
overflow: visible;
text-overflow: clip;
}
.meeting-preview-tabs-container .ant-tabs-nav-operations {
display: none !important;
}
.meeting-preview-tab-content { padding: 20px; }
}
.meeting-preview-speaker-card {
background: #f8faff;
border-radius: 16px;
padding: 20px;
margin-bottom: 16px;
border: 1px solid #eef1f9;
}
.meeting-preview-speaker-head {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
}
.meeting-preview-speaker-avatar {
width: 40px;
height: 40px;
border-radius: 12px;
background: var(--primary-gradient);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
}
.meeting-preview-speaker-name {
font-weight: 700;
font-size: 15px;
}
.meeting-preview-speaker-role {
font-size: 12px;
color: var(--text-secondary);
}
.meeting-preview-keypoint {
display: flex;
gap: 16px;
padding: 16px;
border-radius: 16px;
background: #fff;
border: 1px solid var(--border-color);
margin-bottom: 12px;
}
.meeting-preview-keypoint-index {
font-size: 18px;
font-weight: 800;
color: #dee2e6;
}
.meeting-preview-todo {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 0;
}
.meeting-preview-todo-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--primary-blue);
margin-top: 6px;
.meeting-preview-transcript-list { gap: 16px; }
.meeting-preview-transcript-item { gap: 12px; padding: 10px; }
.meeting-preview-transcript-avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 14px; }
.meeting-preview-transcript-text { font-size: 15px; }
.meeting-preview-audio-player-inline { padding: 10px 16px; bottom: 16px; border-radius: 22px; }
.audio-player-content { gap: 10px; }
.audio-play-btn { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.audio-time { font-size: 10px; }
.audio-speed-btn { width: 38px; height: 32px; font-size: 11px; }
}

View File

@ -1,6 +1,5 @@
import { useEffect, useMemo, useRef, useState } from "react";
import { Alert, Button, Empty, Input, Result, Skeleton, Tabs, message } from "antd";
import { useParams, useSearchParams } from "react-router-dom";
import { Alert, Button, Empty, Input, Tabs, message } from "antd";
import {
AudioOutlined,
CalendarOutlined,
@ -8,115 +7,30 @@ import {
ClockCircleOutlined,
CopyOutlined,
FileTextOutlined,
LinkOutlined,
LockOutlined,
PauseOutlined,
RobotOutlined,
ShareAltOutlined,
TeamOutlined,
UpOutlined,
UserOutlined,
DownOutlined,
UpOutlined,
LinkOutlined,
} from "@ant-design/icons";
import dayjs from "dayjs";
import ReactMarkdown from "react-markdown";
import {
getMeetingPreviewAccess,
getPublicMeetingPreview,
resolveAudioMimeType,
resolveMeetingPlaybackAudioUrl,
type MeetingChapterVO,
type MeetingTranscriptVO,
type MeetingVO,
} from "../../api/business/meeting";
import { buildMeetingAnalysis } from "./meetingAnalysis";
import "./MeetingPreview.css";
} from "@/api/meeting";
import { buildMeetingAnalysis } from "@/components/preview/meetingAnalysis";
import type { MeetingChapterVO, MeetingTranscriptVO, MeetingVO } from "@/types";
import "./MeetingPreviewView.css";
type AnalysisTab = "chapters" | "speakers" | "actions" | "todos";
type PreviewPageTab = "summary" | "catalog" | "transcript";
const TEXT = {
statusTranscribing: "转写中",
statusSummarizing: "总结中",
statusCompleted: "已完成",
statusPending: "待处理",
hintTranscribing: "会议内容仍在整理中,预览会持续补全。",
hintSummarizing: "AI 正在生成会议总结,已完成内容会优先展示。",
hintCompleted: "会议纪要、分析和转录内容已生成完成。",
hintPending: "当前会议尚未生成完整内容,请稍后重试。",
missingMeetingId: "未提供会议编号",
loadFailed: "会议预览加载失败",
noMeetingData: "未找到会议数据",
previewLabel: "会议预览",
untitledMeeting: "未命名会议",
meetingTime: "会议时间",
hostCreator: "主持/创建",
participantsCount: "参会人数",
tagsCount: "标签数量",
notSet: "未设置",
notFilled: "未填写",
pageSummary: "AI 纪要",
pageCatalog: "AI 目录",
pageTranscript: "转录原文",
copyLink: "复制链接",
shareNow: "立即分享",
shareCopied: "预览链接已复制",
shareFallbackCopied: "当前设备不支持系统分享,已为你复制链接",
shareFailed: "分享失败,请先复制链接",
accessCheck: "访问校验",
passwordRequired: "该会议需要访问密码",
passwordHint: "请输入会议的 访问密码 后继续访问预览内容。",
passwordPlaceholder: "请输入 访问密码",
openPreview: "进入预览",
invalidPassword: "访问密码错误",
basicInfo: "基本信息",
meetingOverview: "会议概况",
creator: "创建人",
host: "主持人",
createdAt: "创建时间",
audioStatus: "音频状态",
participants: "人",
tags: "会议标签",
aiAnalysis: "AI 目录",
analysis: "会议分析",
previewExtra: "预览页仅读展示",
audioPlaybackWarning: "音频保存失败,可能影响回放。",
summaryOverview: "全文概要",
summaryEmpty: "暂无概要内容",
analysisChapters: "章节",
analysisSpeakers: "发言人",
analysisKeyPoints: "关键要点",
analysisTodos: "待办事项",
noChapterAnalysis: "暂无章节分析",
noSpeakerAnalysis: "暂无发言人分析",
noKeyPoints: "暂无关键要点",
noTodos: "暂无待办事项",
chapterFallback: "章节",
speakerFallback: "发言人",
speakerSummary: "发言概述",
keyPointFallback: "要点",
noChapterSummary: "暂无章节描述",
noSpeakerSummary: "暂无发言总结",
noKeyPointSummary: "暂无要点说明",
summarySection: "会议纪要",
fullSummary: "完整纪要",
noSummary: "暂无会议纪要",
transcriptSection: "会议转录",
transcriptTitle: "逐段转录",
noDuration: "暂无时长",
audioUnavailable: "音频文件不可用,仅展示转录内容。",
noTranscript: "暂无转录内容",
unknownSpeaker: "未知发言人",
disclaimer: "智能内容由用户会议内容 + AI 模型生成,我们不对内容准确性和完整性做任何保证,亦不代表我们的观点或态度",
shareText: "我向你分享了一个会议预览链接",
audioSaved: "已保存",
audioSaveFailed: "保存失败",
audioUploaded: "已上传",
audioNotSaved: "未保存",
linkToTranscript: "关联原文",
noCatalog: "暂无 AI 目录",
};
type ChapterTranscriptLink = {
key: string;
title: string;
@ -126,6 +40,58 @@ type ChapterTranscriptLink = {
firstTranscriptStartTime: number | null;
};
interface MeetingPreviewViewProps {
meeting: MeetingVO;
transcripts: MeetingTranscriptVO[];
meetingChapters: MeetingChapterVO[];
shareUrl: string;
editableShare?: boolean;
sharePasswordDraft?: string;
shareSaving?: boolean;
onSharePasswordDraftChange?: (value: string) => void;
onSaveSharePassword?: () => void;
onCopyShareLink?: () => void;
}
const TEXT = {
statusTranscribing: "转写中",
statusSummarizing: "总结中",
statusCompleted: "已完成",
statusPending: "待处理",
pageSummary: "AI 纪要",
pageCatalog: "AI 目录",
pageTranscript: "转录原文",
copyLink: "复制链接",
shareNow: "立即分享",
shareCopied: "预览链接已复制",
shareFallbackCopied: "当前设备不支持系统分享,已为你复制链接",
shareFailed: "分享失败,请先复制链接",
basicInfo: "基本信息",
meetingTime: "会议时间",
hostCreator: "主持/创建",
participantsCount: "参会人数",
tags: "会议标签",
noSummary: "暂无会议纪要",
noCatalog: "暂无 AI 目录",
noTranscript: "暂无转录内容",
noDuration: "暂无时长",
audioUnavailable: "音频文件不可用,仅展示转录内容。",
transcriptTitle: "逐段转录",
keywordSection: "关键词",
linkToTranscript: "关联原文",
shareSettings: "分享访问设置",
shareSettingsHint: "当前登录用户可直接查看,访问密码仅对分享出去的 H5 预览链接生效。",
saveSharePassword: "保存访问密码",
passwordPlaceholder: "为空表示取消访问密码",
disclaimer: "智能内容由用户会议内容与 AI 模型生成,我们不对内容准确性和完整性做任何保证。",
};
const STATUS_META: Record<number, { label: string; className: string }> = {
1: { label: TEXT.statusTranscribing, className: "is-processing" },
2: { label: TEXT.statusSummarizing, className: "is-processing" },
3: { label: TEXT.statusCompleted, className: "is-complete" },
};
function parseChapterTimeToMs(value?: string) {
const raw = String(value || "").trim();
if (!raw) return null;
@ -144,24 +110,6 @@ function parseChapterTimeToMs(value?: string) {
return totalSeconds * 1000;
}
const STATUS_META: Record<number, { label: string; className: string; hint: string }> = {
1: { label: TEXT.statusTranscribing, className: "is-processing", hint: TEXT.hintTranscribing },
2: { label: TEXT.statusSummarizing, className: "is-processing", hint: TEXT.hintSummarizing },
3: { label: TEXT.statusCompleted, className: "is-complete", hint: TEXT.hintCompleted },
};
function formatDurationRange(startTime?: number, endTime?: number) {
const format = (milliseconds?: number) => {
const safeMs = Math.max(0, milliseconds || 0);
const totalSeconds = Math.floor(safeMs / 1000);
const minutes = Math.floor(totalSeconds / 60);
const seconds = totalSeconds % 60;
return `${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
};
return `${format(startTime)} - ${format(endTime)}`;
}
function splitDisplayItems(value?: string) {
return (value || "")
.split(",")
@ -192,24 +140,35 @@ async function copyText(text: string) {
document.body.removeChild(textarea);
}
export default function MeetingPreview() {
const { id } = useParams();
const [searchParams] = useSearchParams();
function formatDurationRange(startTime?: number, endTime?: number) {
const format = (milliseconds?: number) => {
const safeMs = Math.max(0, milliseconds || 0);
const totalSeconds = Math.floor(safeMs / 1000);
const minutes = Math.floor(totalSeconds / 60);
const seconds = totalSeconds % 60;
return `${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
};
return `${format(startTime)} - ${format(endTime)}`;
}
export default function MeetingPreviewView({
meeting,
transcripts,
meetingChapters,
shareUrl,
editableShare = false,
sharePasswordDraft = "",
shareSaving = false,
onSharePasswordDraftChange,
onSaveSharePassword,
onCopyShareLink,
}: MeetingPreviewViewProps) {
const audioRef = useRef<HTMLAudioElement | null>(null);
const audioPlaybackErrorShownRef = useRef<string | null>(null);
const transcriptItemRefs = useRef<Record<number, HTMLDivElement | null>>({});
const [meeting, setMeeting] = useState<MeetingVO | null>(null);
const [transcripts, setTranscripts] = useState<MeetingTranscriptVO[]>([]);
const [meetingChapters, setMeetingChapters] = useState<MeetingChapterVO[]>([]);
const [loading, setLoading] = useState(true);
const [error, setError] = useState("");
const [analysisTab, setAnalysisTab] = useState<AnalysisTab>("speakers");
const audioPlaybackErrorShownRef = useRef<string | null>(null);
const [pageTab, setPageTab] = useState<PreviewPageTab>("summary");
const [activeTranscriptId, setActiveTranscriptId] = useState<number | null>(null);
const [passwordRequired, setPasswordRequired] = useState(false);
const [passwordVerified, setPasswordVerified] = useState(false);
const [accessPassword, setAccessPassword] = useState("");
const [passwordError, setPasswordError] = useState("");
const [audioPlaying, setAudioPlaying] = useState(false);
const [audioCurrentTime, setAudioCurrentTime] = useState(0);
const [audioDuration, setAudioDuration] = useState(0);
@ -217,117 +176,23 @@ export default function MeetingPreview() {
const [isMetricsExpanded, setIsMetricsExpanded] = useState(false);
const [linkedTranscriptIds, setLinkedTranscriptIds] = useState<number[]>([]);
const [linkedChapterKey, setLinkedChapterKey] = useState<string | null>(null);
const [isMobile, setIsMobile] = useState(() =>
const [isMobile, setIsMobile] = useState(
typeof window !== "undefined" ? window.matchMedia("(max-width: 767px)").matches : false,
);
const presetAccessPassword = useMemo(() => (searchParams.get("accessPassword") || "").trim(), [searchParams]);
useEffect(() => {
let mounted = true;
const load = async () => {
if (!id) {
setError(TEXT.missingMeetingId);
setLoading(false);
return;
}
setLoading(true);
setError("");
setMeeting(null);
setTranscripts([]);
setMeetingChapters([]);
setPasswordRequired(false);
setPasswordVerified(false);
setAccessPassword(presetAccessPassword);
setPasswordError("");
try {
const meetingId = Number(id);
const accessRes = await getMeetingPreviewAccess(meetingId);
if (!mounted) {
return;
}
const requiresPassword = !!accessRes.data.data.passwordRequired;
setPasswordRequired(requiresPassword);
if (requiresPassword) {
if (!presetAccessPassword) {
setLoading(false);
return;
}
try {
const previewRes = await getPublicMeetingPreview(meetingId, presetAccessPassword);
if (!mounted) {
return;
}
setMeeting(previewRes.data.data.meeting);
setTranscripts(previewRes.data.data.transcripts || []);
setMeetingChapters(previewRes.data.data.chapters || []);
setPasswordVerified(true);
return;
} catch (requestError: any) {
if (!mounted) {
return;
}
setPasswordError(requestError?.response?.data?.msg || requestError?.msg || TEXT.invalidPassword);
setPasswordVerified(false);
setLoading(false);
return;
}
}
const previewRes = await getPublicMeetingPreview(meetingId);
if (!mounted) {
return;
}
setMeeting(previewRes.data.data.meeting);
setTranscripts(previewRes.data.data.transcripts || []);
setMeetingChapters(previewRes.data.data.chapters || []);
setPasswordVerified(true);
} catch (requestError: any) {
if (!mounted) {
return;
}
setError(requestError?.response?.data?.msg || requestError?.msg || TEXT.loadFailed);
} finally {
if (mounted) {
setLoading(false);
}
}
};
load();
return () => {
mounted = false;
};
}, [id, presetAccessPassword]);
useEffect(() => {
if (typeof window === "undefined") {
return;
}
if (typeof window === "undefined") return;
const mediaQuery = window.matchMedia("(max-width: 767px)");
const handleChange = (event: MediaQueryListEvent) => {
setIsMobile(event.matches);
};
const handleChange = (event: MediaQueryListEvent) => setIsMobile(event.matches);
setIsMobile(mediaQuery.matches);
mediaQuery.addEventListener("change", handleChange);
return () => {
mediaQuery.removeEventListener("change", handleChange);
};
return () => mediaQuery.removeEventListener("change", handleChange);
}, []);
const analysis = useMemo(
() => buildMeetingAnalysis(meeting?.analysis, meeting?.summaryContent, meeting?.tags || ""),
[meeting?.analysis, meeting?.summaryContent, meeting?.tags],
);
const participants = useMemo(() => splitDisplayItems(meeting?.participants), [meeting?.participants]);
const transcriptSpeakers = useMemo(() => {
const speakers = transcripts
@ -342,9 +207,7 @@ export default function MeetingPreview() {
const statusMeta = STATUS_META[meeting?.status || 0] || {
label: TEXT.statusPending,
className: "is-warning",
hint: TEXT.hintPending,
};
const shareUrl = typeof window !== "undefined" ? window.location.href : "";
const participantCountValue =
isMobile && transcriptSpeakers.length > 0 ? transcriptSpeakers.length : participants.length;
@ -353,11 +216,11 @@ export default function MeetingPreview() {
const last = transcripts[transcripts.length - 1];
return last.endTime || 0;
}
return 0;
}, [transcripts]);
return meeting.duration || 0;
}, [meeting.duration, transcripts]);
const catalogChapterLinks = useMemo<ChapterTranscriptLink[]>(() => {
const transcriptIdToIndex = new Map(transcripts.map((item, index) => [item.id, index]));
const transcriptIdToIndex = new Map(transcripts.map((item) => [item.id, transcripts.indexOf(item)]));
const sourceChapters: MeetingChapterVO[] = meetingChapters.length
? meetingChapters
: analysis.chapters.map((item) => ({
@ -369,13 +232,13 @@ export default function MeetingPreview() {
let matchedTranscripts: MeetingTranscriptVO[] = [];
const sourceTranscriptIds = Array.isArray(chapter.sourceTranscriptIds)
? chapter.sourceTranscriptIds
.map((item) => Number(item))
.filter((item) => Number.isFinite(item) && transcriptIdToIndex.has(item))
.map((item: number) => Number(item))
.filter((item: number) => Number.isFinite(item) && transcriptIdToIndex.has(item))
: [];
if (sourceTranscriptIds.length) {
matchedTranscripts = sourceTranscriptIds
.map((item) => transcripts[transcriptIdToIndex.get(item)!])
.map((item: number) => transcripts[transcriptIdToIndex.get(item)!])
.filter(Boolean);
} else if (chapter.startTranscriptId && chapter.endTranscriptId) {
const startIndex = transcriptIdToIndex.get(Number(chapter.startTranscriptId));
@ -391,12 +254,12 @@ export default function MeetingPreview() {
.find((item): item is number => item !== null && startMs !== null && item > startMs);
if (startMs !== null) {
const firstTranscriptIndex = transcripts.findIndex((item) => item.endTime > startMs);
const firstTranscriptIndex = transcripts.findIndex((item) => (item.endTime || 0) > startMs);
if (firstTranscriptIndex >= 0) {
const lastTranscriptIndex =
nextChapterStartMs === undefined
? transcripts.length
: transcripts.findIndex((item) => item.startTime >= nextChapterStartMs);
: transcripts.findIndex((item) => (item.startTime || 0) >= nextChapterStartMs);
matchedTranscripts = transcripts.slice(
firstTranscriptIndex,
lastTranscriptIndex >= 0 ? lastTranscriptIndex : transcripts.length,
@ -417,24 +280,14 @@ export default function MeetingPreview() {
}, [analysis.chapters, meetingChapters, transcripts]);
useEffect(() => {
if (!activeTranscriptId) {
return;
}
if (!activeTranscriptId) return;
const target = transcriptItemRefs.current[activeTranscriptId];
if (!target) {
return;
}
// 使用 center 模式确保当前说话段落始终位于视口中央,避免被底部的浮动控件遮挡
if (!target) return;
target.scrollIntoView({ behavior: "smooth", block: "center" });
}, [activeTranscriptId]);
const handleTranscriptSeek = (item: MeetingTranscriptVO) => {
if (!audioRef.current) {
return;
}
if (!audioRef.current) return;
audioRef.current.currentTime = Math.max(0, (item.startTime || 0) / 1000);
audioRef.current.play().catch(() => {});
};
@ -447,13 +300,9 @@ export default function MeetingPreview() {
setLinkedChapterKey(link.key);
setActiveTranscriptId(link.firstTranscriptId);
// 自动跳转并播放音频
if (audioRef.current && link.firstTranscriptStartTime !== null) {
audioRef.current.currentTime = Math.max(0, link.firstTranscriptStartTime / 1000);
audioRef.current.play().catch(() => {
// 部分浏览器(尤其是移动端)可能会拦截非直接交互触发的播放
// 但由于这是由用户点击目录项触发的,通常会被允许
});
audioRef.current.play().catch(() => {});
}
}
};
@ -482,10 +331,10 @@ export default function MeetingPreview() {
};
const formatPlayerTime = (seconds: number) => {
if (!seconds || isNaN(seconds)) return '00:00';
if (!seconds || Number.isNaN(seconds)) return "00:00";
const m = Math.floor(seconds / 60);
const s = Math.floor(seconds % 60);
return `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`;
return `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
};
const handleAudioTimeUpdate = () => {
@ -493,7 +342,6 @@ export default function MeetingPreview() {
const currentSeconds = audioRef.current.currentTime;
setAudioCurrentTime(currentSeconds);
// Also update duration if it's available now
if (audioRef.current.duration && audioDuration !== audioRef.current.duration) {
setAudioDuration(audioRef.current.duration);
}
@ -508,55 +356,44 @@ export default function MeetingPreview() {
setActiveTranscriptId(currentItem?.id || null);
};
const handleAudioEnded = () => {
setAudioPlaying(false);
const handleAudioLoadedMetadata = () => {
if (!audioRef.current) return;
setAudioDuration(audioRef.current.duration || 0);
};
const handleAudioPlay = () => setAudioPlaying(true);
const handleAudioPause = () => setAudioPlaying(false);
const handleAudioLoadedMetadata = () => {
if (audioRef.current) {
setAudioDuration(audioRef.current.duration);
}
};
const handleAudioEnded = () => setAudioPlaying(false);
const handleAudioError = () => {
const handleAudioError = async () => {
const currentAudioUrl = playbackAudioUrl || "";
if (!currentAudioUrl || audioPlaybackErrorShownRef.current === currentAudioUrl) {
return;
}
const normalizedUrl = currentAudioUrl.split("#")[0]?.split("?")[0]?.toLowerCase() || "";
const isM4a = normalizedUrl.endsWith(".m4a");
message.warning(
isM4a
? "当前 m4a 文件在本机浏览器中无法直接播放。已确认文件与服务端响应基本正常,更可能是浏览器对该录音参数或容器实现的兼容性问题。建议优先使用 mp3、wav或下载到本地播放。"
: TEXT.audioUnavailable,
);
audioPlaybackErrorShownRef.current = currentAudioUrl;
try {
const retryResp = await getPublicMeetingPreview(meeting.id);
const retryUrl = resolveMeetingPlaybackAudioUrl(retryResp.data.data.meeting);
if (retryUrl && retryUrl !== currentAudioUrl && audioRef.current) {
audioRef.current.src = retryUrl;
audioRef.current.load();
audioPlaybackErrorShownRef.current = null;
return;
}
} catch {
// ignore retry failure
}
message.warning(meeting.audioSaveMessage || TEXT.audioUnavailable);
setAudioPlaying(false);
};
const handlePasswordSubmit = async () => {
if (!id) {
const handleCopyLink = async () => {
if (onCopyShareLink) {
await onCopyShareLink();
return;
}
setLoading(true);
setPasswordError("");
try {
const previewRes = await getPublicMeetingPreview(Number(id), accessPassword.trim());
setMeeting(previewRes.data.data.meeting);
setTranscripts(previewRes.data.data.transcripts || []);
setMeetingChapters(previewRes.data.data.chapters || []);
setPasswordVerified(true);
} catch (requestError: any) {
setPasswordError(requestError?.response?.data?.msg || requestError?.msg || TEXT.invalidPassword);
} finally {
setLoading(false);
}
};
const handleCopyLink = async () => {
try {
await copyText(shareUrl);
message.success(TEXT.shareCopied);
@ -569,8 +406,8 @@ export default function MeetingPreview() {
try {
if (navigator.share) {
await navigator.share({
title: meeting?.title || TEXT.previewLabel,
text: TEXT.shareText,
title: meeting?.title || "会议预览",
text: "我向你分享了一个会议预览链接",
url: shareUrl,
});
return;
@ -583,116 +420,11 @@ export default function MeetingPreview() {
}
};
if (loading && (!passwordRequired || passwordVerified)) {
return (
<div className="meeting-preview-page">
<div className="meeting-preview-shell meeting-preview-loading">
<div className="meeting-preview-card meeting-preview-hero">
<Skeleton active paragraph={{ rows: 4 }} />
</div>
<div className="meeting-preview-card meeting-preview-section">
<Skeleton active paragraph={{ rows: 8 }} />
</div>
<div className="meeting-preview-card meeting-preview-section">
<Skeleton active paragraph={{ rows: 10 }} />
</div>
</div>
</div>
);
}
if (passwordRequired && !passwordVerified) {
return (
<div className="meeting-preview-page is-password-gate">
<div className="password-gate-background">
<div className="bg-blob bg-blob-1" />
<div className="bg-blob bg-blob-2" />
<div className="bg-blob bg-blob-3" />
</div>
<div className="meeting-preview-shell">
<div className="meeting-preview-password-card">
<div className="password-card-header">
<div className="password-icon-wrapper">
<LockOutlined />
</div>
<h1 className="password-card-title">{TEXT.passwordRequired}</h1>
<p className="password-card-subtitle">{TEXT.passwordHint}</p>
</div>
<div className="password-card-form">
<div className="password-input-wrapper">
<Input.Password
size="large"
value={accessPassword}
placeholder={TEXT.passwordPlaceholder}
onChange={(event) => setAccessPassword(event.target.value)}
onPressEnter={handlePasswordSubmit}
prefix={<LockOutlined style={{ color: "var(--text-secondary)" }} />}
className="modern-password-input"
/>
</div>
<Button
type="primary"
size="large"
onClick={handlePasswordSubmit}
loading={loading}
disabled={!accessPassword.trim()}
className="password-submit-btn"
block
>
{TEXT.openPreview}
</Button>
</div>
{passwordError && (
<div className="password-error-message">
<Alert type="error" showIcon message={passwordError} />
</div>
)}
</div>
</div>
<div className="password-gate-footer">
<div className="footer-disclaimer">
<RobotOutlined />
<span>Secure Access Powered by iMeeting AI</span>
</div>
</div>
</div>
);
}
if (error) {
return (
<div className="meeting-preview-page">
<div className="meeting-preview-shell meeting-preview-empty">
<div className="meeting-preview-card meeting-preview-section">
<Result status="error" title={TEXT.loadFailed} subTitle={error} />
</div>
</div>
</div>
);
}
if (!meeting) {
return (
<div className="meeting-preview-page">
<div className="meeting-preview-shell meeting-preview-empty">
<div className="meeting-preview-card meeting-preview-section">
<Empty description={TEXT.noMeetingData} />
</div>
</div>
</div>
);
}
const summaryTabContent = (
<div className="meeting-preview-tab-panel">
<section className="meeting-preview-card meeting-preview-section">
<section className="meeting-preview-section">
<div className="meeting-preview-summary-box">
<div className="meeting-preview-summary-section">
<div className="meeting-preview-summary-section-title"></div>
<div className="meeting-preview-summary-section-title">{TEXT.keywordSection}</div>
<div className="meeting-preview-record-tags">
{keywords.length ? (
keywords.map((item) => (
@ -705,14 +437,9 @@ export default function MeetingPreview() {
)}
</div>
</div>
</div>
<div className="meeting-preview-markdown">
{meeting.summaryContent ? (
<ReactMarkdown>{meeting.summaryContent}</ReactMarkdown>
) : (
<Empty description={TEXT.noSummary} />
)}
{meeting.summaryContent ? <ReactMarkdown>{meeting.summaryContent}</ReactMarkdown> : <Empty description={TEXT.noSummary} />}
</div>
</section>
</div>
@ -720,32 +447,19 @@ export default function MeetingPreview() {
const catalogTabContent = (
<div className="meeting-preview-tab-panel">
<section className="meeting-preview-card meeting-preview-section">
<div className="meeting-preview-section-header">
<div>
{/*<div className="meeting-preview-section-kicker">*/}
{/* <RobotOutlined />*/}
{/* {TEXT.aiAnalysis}*/}
{/*</div>*/}
<h2 className="meeting-preview-section-title">{TEXT.pageCatalog}</h2>
</div>
</div>
<section className="meeting-preview-section">
<div className="meeting-preview-catalog-list">
{catalogChapterLinks.length ? (
catalogChapterLinks.map((chapter, index) => (
<div
key={chapter.key}
className={`meeting-preview-catalog-item-container ${linkedChapterKey === chapter.key ? 'active' : ''}`}
className={`meeting-preview-catalog-item-container ${linkedChapterKey === chapter.key ? "active" : ""}`}
>
<div className="meeting-preview-catalog-timeline-axis">
<div className="meeting-preview-catalog-timeline-dot" />
<div className="meeting-preview-catalog-timeline-line" />
</div>
<div
className="meeting-preview-catalog-item-card"
onClick={() => handleLocateChapterTranscript(index)}
>
<div className="meeting-preview-catalog-item-card" onClick={() => handleLocateChapterTranscript(index)}>
<div className="meeting-preview-catalog-item-time">{chapter.timeLabel}</div>
<div className="meeting-preview-catalog-item-title-row">
<div className="meeting-preview-catalog-item-title">{chapter.title}</div>
@ -773,13 +487,9 @@ export default function MeetingPreview() {
const transcriptTabContent = (
<div className="meeting-preview-tab-panel">
<section className="meeting-preview-card meeting-preview-section">
<section className="meeting-preview-section">
<div className="meeting-preview-section-header">
<div>
{/*<div className="meeting-preview-section-kicker">*/}
{/* <AudioOutlined />*/}
{/* {TEXT.transcriptSection}*/}
{/*</div>*/}
<h2 className="meeting-preview-section-title">{TEXT.transcriptTitle}</h2>
</div>
<div className="meeting-preview-section-extra">
@ -789,12 +499,7 @@ export default function MeetingPreview() {
</div>
{meeting.audioSaveStatus === "FAILED" ? (
<Alert
className="meeting-preview-alert"
type="warning"
showIcon
message={meeting.audioSaveMessage || TEXT.audioUnavailable}
/>
<Alert className="meeting-preview-alert" type="warning" showIcon message={meeting.audioSaveMessage || TEXT.audioUnavailable} />
) : null}
<div className="meeting-preview-transcript-list">
@ -803,7 +508,6 @@ export default function MeetingPreview() {
const speakerKey = item.speakerName || item.speakerLabel || item.speakerId || "speaker";
const isLinked = linkedTranscriptIds.includes(item.id);
const isActive = activeTranscriptId === item.id;
return (
<div
key={item.id}
@ -813,7 +517,7 @@ export default function MeetingPreview() {
className={`meeting-preview-transcript-item ${isActive ? "is-active" : ""} ${isLinked ? "is-linked" : ""}`}
onClick={() => {
handleTranscriptSeek(item);
setLinkedTranscriptIds([]); // Clear linked highlight on manual seek
setLinkedTranscriptIds([]);
setLinkedChapterKey(null);
}}
>
@ -830,9 +534,7 @@ export default function MeetingPreview() {
{formatDurationRange(item.startTime, item.endTime)}
</span>
</div>
<div className="meeting-preview-transcript-text">
{item.content || TEXT.noTranscript}
</div>
<div className="meeting-preview-transcript-text">{item.content || TEXT.noTranscript}</div>
</div>
</div>
);
@ -861,104 +563,101 @@ export default function MeetingPreview() {
<div className={`meeting-preview-page ${isMobile ? "is-mobile" : "is-desktop"}`}>
<div className="meeting-preview-container">
<div className="meeting-preview-shell">
{/* Header Title Section */}
<div className="meeting-preview-top-hero">
<div className="meeting-preview-hero-logo">
<RobotOutlined />
</div>
<div className="meeting-preview-hero-content">
<h1 className="meeting-preview-hero-title">{meeting.title || TEXT.untitledMeeting}</h1>
<h1 className="meeting-preview-hero-title">{meeting.title || "未命名会议"}</h1>
<div className="meeting-preview-hero-meta">
<span className={`meeting-preview-status-tag ${statusMeta.className}`}>
{statusMeta.label}
</span>
{/*<span className="meeting-preview-hero-id">ID: {meeting.id}</span>*/}
<span className={`meeting-preview-status-tag ${statusMeta.className}`}>{statusMeta.label}</span>
</div>
</div>
</div>
{/* Collapsible Basic Info Section */}
<div className="meeting-preview-collapsible-section">
<div
className="meeting-preview-collapsible-trigger"
onClick={() => setIsMetricsExpanded(!isMetricsExpanded)}
>
<div className="meeting-preview-collapsible-trigger" onClick={() => setIsMetricsExpanded(!isMetricsExpanded)}>
<div className="trigger-left">
<FileTextOutlined />
<span>{TEXT.basicInfo}</span>
</div>
<div className="trigger-right">
{isMetricsExpanded ? <UpOutlined /> : <DownOutlined />}
</div>
<div className="trigger-right">{isMetricsExpanded ? <UpOutlined /> : <DownOutlined />}</div>
</div>
<div className={`meeting-preview-collapsible-content ${isMetricsExpanded ? 'is-expanded' : ''}`}>
<div className={`meeting-preview-collapsible-content ${isMetricsExpanded ? "is-expanded" : ""}`}>
<div className="meeting-preview-metrics-grid">
<div className="metric-item">
<div className="metric-label">{TEXT.meetingTime}</div>
<div className="metric-value">
<CalendarOutlined style={{ marginRight: 8, color: 'var(--primary-blue)' }} />
{meeting.meetingTime ? dayjs(meeting.meetingTime).format("YYYY-MM-DD HH:mm") : TEXT.notSet}
<CalendarOutlined style={{ marginRight: 8, color: "var(--primary-blue)" }} />
{meeting.meetingTime ? dayjs(meeting.meetingTime).format("YYYY-MM-DD HH:mm") : "未设置"}
</div>
</div>
<div className="metric-item">
<div className="metric-label">{TEXT.hostCreator}</div>
<div className="metric-value">
<UserOutlined style={{ marginRight: 8, color: 'var(--primary-blue)' }} />
{meeting.creatorName || TEXT.notSet}
<UserOutlined style={{ marginRight: 8, color: "var(--primary-blue)" }} />
{meeting.creatorName || "未设置"}
</div>
</div>
<div className="metric-item">
<div className="metric-label">{TEXT.participantsCount}</div>
<div className="metric-value">
<TeamOutlined style={{ marginRight: 8, color: 'var(--primary-blue)' }} />
{participantCountValue} {TEXT.participants}
<TeamOutlined style={{ marginRight: 8, color: "var(--primary-blue)" }} />
{participantCountValue}
</div>
</div>
<div className="metric-item">
<div className="metric-label"></div>
<div className="metric-value">
<ClockCircleOutlined style={{ marginRight: 8, color: 'var(--primary-blue)' }} />
{meetingDuration > 0 ? formatTotalDuration(meetingDuration) : TEXT.notSet}
<ClockCircleOutlined style={{ marginRight: 8, color: "var(--primary-blue)" }} />
{meetingDuration > 0 ? formatTotalDuration(meetingDuration) : "未设置"}
</div>
</div>
{tags.length > 0 && (
{tags.length > 0 ? (
<div className="metric-item metric-item-full">
<div className="metric-label">{TEXT.tags}</div>
<div className="metric-tags">
{tags.map(tag => (
<span key={tag} className="metric-tag">#{tag}</span>
{tags.map((tag) => (
<span key={tag} className="metric-tag">
#{tag}
</span>
))}
</div>
</div>
)}
) : null}
</div>
</div>
</div>
{/* Sharing Buttons Bar */}
{editableShare ? (
<div className="meeting-preview-share-settings">
<div className="meeting-preview-share-settings-title">{TEXT.shareSettings}</div>
<div className="meeting-preview-share-settings-desc">{TEXT.shareSettingsHint}</div>
<div className="meeting-preview-share-settings-row">
<Input.Password
value={sharePasswordDraft}
placeholder={TEXT.passwordPlaceholder}
prefix={<LockOutlined />}
onChange={(event) => onSharePasswordDraftChange?.(event.target.value)}
/>
<Button type="primary" loading={shareSaving} onClick={onSaveSharePassword}>
{TEXT.saveSharePassword}
</Button>
</div>
</div>
) : null}
<div className="meeting-preview-share-bar">
<Button
type="primary"
size="large"
icon={<ShareAltOutlined />}
onClick={handleShareNow}
className="share-btn-primary"
>
<Button type="primary" size="large" icon={<ShareAltOutlined />} onClick={handleShareNow} className="share-btn-primary">
{TEXT.shareNow}
</Button>
<Button
size="large"
icon={<CopyOutlined />}
onClick={handleCopyLink}
className="share-btn-ghost"
>
<Button size="large" icon={<CopyOutlined />} onClick={handleCopyLink} className="share-btn-ghost">
{TEXT.copyLink}
</Button>
</div>
<div className="meeting-preview-layout-full">
{/* Main Content Area */}
<main className="meeting-preview-main">
<div className="meeting-preview-content-card">
<div className="meeting-preview-tabs-container">
@ -991,12 +690,8 @@ export default function MeetingPreview() {
</div>
</div>
{/* Floating Audio Player - Permanent mount, visibility controlled */}
{playbackAudioUrl && (
<div
className="meeting-preview-audio-player-inline"
style={{ display: pageTab === "transcript" ? "flex" : "none" }}
>
{playbackAudioUrl ? (
<div className="meeting-preview-audio-player-inline" style={{ display: pageTab === "transcript" ? "flex" : "none" }}>
<audio
ref={audioRef}
onTimeUpdate={handleAudioTimeUpdate}
@ -1034,7 +729,7 @@ export default function MeetingPreview() {
</button>
</div>
</div>
)}
) : null}
</div>
);
}

View File

@ -0,0 +1,190 @@
import type { MeetingVO } from "@/types";
export type AnalysisChapter = {
time?: string;
title: string;
summary: string;
};
export type AnalysisSpeakerSummary = {
speaker: string;
summary: string;
};
export type AnalysisKeyPoint = {
title: string;
summary: string;
speaker?: string;
time?: string;
};
export type MeetingAnalysis = {
overview: string;
keywords: string[];
chapters: AnalysisChapter[];
speakerSummaries: AnalysisSpeakerSummary[];
keyPoints: AnalysisKeyPoint[];
todos: string[];
};
export const ANALYSIS_EMPTY: MeetingAnalysis = {
overview: "",
keywords: [],
chapters: [],
speakerSummaries: [],
keyPoints: [],
todos: [],
};
const splitLines = (value?: string | null) =>
(value || "")
.split(/\r?\n/)
.map((line) => line.trim())
.filter(Boolean);
const parseLooseJson = (raw?: string | null) => {
const input = (raw || "").trim();
if (!input) return null;
const tryParse = (text: string) => {
try {
return JSON.parse(text);
} catch {
return null;
}
};
const direct = tryParse(input);
if (direct && typeof direct === "object") return direct;
const fenced = input.match(/```(?:json)?\s*([\s\S]*?)```/i)?.[1]?.trim();
if (fenced) {
const fencedParsed = tryParse(fenced);
if (fencedParsed && typeof fencedParsed === "object") return fencedParsed;
}
const start = input.indexOf("{");
const end = input.lastIndexOf("}");
if (start >= 0 && end > start) {
const wrapped = tryParse(input.slice(start, end + 1));
if (wrapped && typeof wrapped === "object") return wrapped;
}
return null;
};
const extractSection = (markdown: string, aliases: string[]) => {
const lines = markdown.split(/\r?\n/);
const lowerAliases = aliases.map((item) => item.toLowerCase());
const cleanHeading = (line: string) => line.replace(/^#{1,6}\s*/, "").trim().toLowerCase();
let start = -1;
for (let index = 0; index < lines.length; index += 1) {
const line = lines[index].trim();
if (!line.startsWith("#")) continue;
const heading = cleanHeading(line);
if (lowerAliases.some((alias) => heading.includes(alias))) {
start = index + 1;
break;
}
}
if (start < 0) return "";
const buffer: string[] = [];
for (let index = start; index < lines.length; index += 1) {
const line = lines[index];
if (line.trim().startsWith("#")) break;
buffer.push(line);
}
return buffer.join("\n").trim();
};
const parseBulletList = (content?: string | null) =>
splitLines(content)
.map((line) => line.replace(/^[-*•\s]+/, "").replace(/^\d+[.)]\s*/, "").trim())
.filter(Boolean);
const parseOverviewSection = (markdown: string) =>
extractSection(markdown, ["全文概要", "概要", "摘要", "概览"]) || markdown.replace(/^---[\s\S]*?---/, "").trim();
const parseKeywordsSection = (markdown: string, tags: string) => {
const section = extractSection(markdown, ["关键词", "关键字", "标签"]);
const fromSection = parseBulletList(section)
.flatMap((line) => line.split(/[,、]/))
.map((item) => item.trim())
.filter(Boolean);
if (fromSection.length) {
return Array.from(new Set(fromSection)).slice(0, 12);
}
return Array.from(new Set((tags || "").split(",").map((item) => item.trim()).filter(Boolean))).slice(0, 12);
};
export const buildMeetingAnalysis = (
sourceAnalysis: MeetingVO["analysis"] | undefined,
summaryContent: string | undefined,
tags: string,
): MeetingAnalysis => {
const parseStructured = (parsed: Record<string, unknown>): MeetingAnalysis => {
const chapters = Array.isArray(parsed.chapters) ? parsed.chapters : [];
const speakerSummaries = Array.isArray(parsed.speakerSummaries) ? parsed.speakerSummaries : [];
const keyPoints = Array.isArray(parsed.keyPoints) ? parsed.keyPoints : [];
const todos = Array.isArray(parsed.todos)
? parsed.todos
: Array.isArray(parsed.actionItems)
? parsed.actionItems
: [];
return {
overview: String(parsed.overview || "").trim(),
keywords: Array.from(
new Set((Array.isArray(parsed.keywords) ? parsed.keywords : []).map((item) => String(item).trim()).filter(Boolean)),
).slice(0, 12),
chapters: chapters
.map((item: Record<string, unknown>) => ({
time: item?.time ? String(item.time).trim() : undefined,
title: String(item?.title || "").trim(),
summary: String(item?.summary || "").trim(),
}))
.filter((item: AnalysisChapter) => item.title || item.summary),
speakerSummaries: speakerSummaries
.map((item: Record<string, unknown>) => ({
speaker: String(item?.speaker || "").trim(),
summary: String(item?.summary || "").trim(),
}))
.filter((item: AnalysisSpeakerSummary) => item.speaker || item.summary),
keyPoints: keyPoints
.map((item: Record<string, unknown>) => ({
title: String(item?.title || "").trim(),
summary: String(item?.summary || "").trim(),
speaker: item?.speaker ? String(item.speaker).trim() : undefined,
time: item?.time ? String(item.time).trim() : undefined,
}))
.filter((item: AnalysisKeyPoint) => item.title || item.summary),
todos: todos.map((item) => String(item).trim()).filter(Boolean).slice(0, 10),
};
};
if (sourceAnalysis) {
return parseStructured(sourceAnalysis as Record<string, unknown>);
}
const raw = (summaryContent || "").trim();
if (!raw && !tags) return ANALYSIS_EMPTY;
const loose = parseLooseJson(raw);
if (loose) {
return parseStructured(loose);
}
return {
overview: parseOverviewSection(raw),
keywords: parseKeywordsSection(raw, tags),
chapters: [],
speakerSummaries: [],
keyPoints: [],
todos: [],
};
};

View File

@ -0,0 +1,12 @@
import { useEffect } from "react";
import { usePlatformConfig } from "@/components/PlatformConfigProvider";
export default function usePageTitle(pageTitle?: string) {
const { platformConfig } = usePlatformConfig();
useEffect(() => {
const appName = platformConfig?.projectName?.trim() || "iMeeting";
document.title = pageTitle ? `${pageTitle} - ${appName}` : appName;
}, [pageTitle, platformConfig?.projectName]);
}

View File

@ -0,0 +1,17 @@
import type { PropsWithChildren } from "react";
import BottomNav from "@/components/BottomNav";
interface MainLayoutProps extends PropsWithChildren {
activeTab?: "meetings" | "profile";
}
export default function MainLayout({ children, activeTab }: MainLayoutProps) {
return (
<div className="h5-app-shell">
<div className="h5-app-shell__bg" />
<main className="h5-app-shell__content">{children}</main>
{activeTab ? <BottomNav activeTab={activeTab} /> : null}
</div>
);
}

View File

@ -0,0 +1,34 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { App as AntdApp, ConfigProvider } from "antd";
import zhCN from "antd/locale/zh_CN";
import { BrowserRouter } from "react-router-dom";
import App from "./App";
import { PlatformConfigProvider } from "./components/PlatformConfigProvider";
import "./styles/global.css";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<ConfigProvider
locale={zhCN}
theme={{
token: {
colorPrimary: "#1f6bff",
borderRadius: 16,
colorBgLayout: "#f4f7fb",
colorText: "#162033",
fontFamily: '"HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',
},
}}
>
<AntdApp>
<PlatformConfigProvider>
<BrowserRouter>
<App />
</BrowserRouter>
</PlatformConfigProvider>
</AntdApp>
</ConfigProvider>
</React.StrictMode>,
);

View File

@ -0,0 +1,31 @@
import { Card, Typography } from "antd";
import { usePlatformConfig } from "@/components/PlatformConfigProvider";
import usePageTitle from "@/hooks/usePageTitle";
import PageHeader from "@/components/PageHeader";
const { Paragraph, Title } = Typography;
export default function AboutPage() {
const { platformConfig } = usePlatformConfig();
usePageTitle("关于我们");
return (
<div className="page-stack">
<PageHeader title="关于我们" back />
<Card className="surface-card">
<Title level={4}>{platformConfig?.projectName || "iMeeting H5"}</Title>
<Paragraph>
iMeeting H5
</Paragraph>
<Paragraph>
访
</Paragraph>
<Paragraph>
support@imeeting.example.com
</Paragraph>
<Paragraph type="secondary">{platformConfig?.copyrightInfo || "Copyright © iMeeting"}</Paragraph>
</Card>
</div>
);
}

View File

@ -0,0 +1,160 @@
import { LockOutlined, ReloadOutlined, UserOutlined } from "@ant-design/icons";
import { App, Button, Card, Form, Input, Typography } from "antd";
import { useEffect, useState } from "react";
import { useNavigate, useSearchParams } from "react-router-dom";
import { fetchCaptcha, login } from "@/api/auth";
import { getCurrentUser } from "@/api/user";
import { usePlatformConfig } from "@/components/PlatformConfigProvider";
import usePageTitle from "@/hooks/usePageTitle";
import type { CaptchaResponse } from "@/types";
import { saveProfile, saveTokens } from "@/utils/auth";
const { Paragraph, Title } = Typography;
type LoginFormValues = {
username: string;
password: string;
captchaCode?: string;
captchaId?: string;
};
export default function LoginPage() {
const { message } = App.useApp();
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const { platformConfig, captchaEnabled, loaded } = usePlatformConfig();
const [form] = Form.useForm<LoginFormValues>();
const [submitting, setSubmitting] = useState(false);
const [captcha, setCaptcha] = useState<CaptchaResponse | null>(null);
const redirect = searchParams.get("redirect") || "/meetings";
usePageTitle("登录");
const loadCaptcha = async () => {
try {
if (!captchaEnabled) {
setCaptcha(null);
form.setFieldValue("captchaCode", undefined);
form.setFieldValue("captchaId", undefined);
return;
}
const data = await fetchCaptcha();
setCaptcha(data);
form.setFieldValue("captchaId", data.captchaId);
form.setFieldValue("captchaCode", "");
} catch {
setCaptcha(null);
}
};
useEffect(() => {
if (!loaded) {
return;
}
void loadCaptcha();
}, [loaded, captchaEnabled]);
const handleFinish = async (values: LoginFormValues) => {
setSubmitting(true);
try {
const token = await login({
username: values.username,
password: values.password,
captchaId: captchaEnabled ? values.captchaId : undefined,
captchaCode: captchaEnabled ? values.captchaCode : undefined,
});
saveTokens(token.accessToken, token.refreshToken);
const profile = await getCurrentUser();
saveProfile(profile);
message.success("登录成功");
navigate(redirect, { replace: true });
} catch {
void loadCaptcha();
} finally {
setSubmitting(false);
}
};
return (
<div
className="login-page"
style={
platformConfig?.loginBgUrl
? {
backgroundImage: `linear-gradient(rgba(251,253,255,0.78), rgba(242,246,251,0.9)), url(${platformConfig.loginBgUrl})`,
backgroundSize: "cover",
backgroundPosition: "center",
}
: undefined
}
>
<div className="login-page__hero">
<span className="login-page__badge">{platformConfig?.projectName || "iMeeting"}</span>
<Title level={2} style={{ marginBottom: 12 }}>
</Title>
<Paragraph type="secondary">
{platformConfig?.systemDescription || "登录后查看你的会议、会议详情、分享预览与扫码确认信息。"}
</Paragraph>
</div>
<Card className="surface-card login-card">
<div className="login-card__brand">
<img src={platformConfig?.logoUrl || "/logo.svg"} alt="Logo" className="login-card__logo" />
<div className="login-card__brand-text">
<div className="login-card__brand-name">{platformConfig?.projectName || "iMeeting"}</div>
<div className="login-card__brand-desc"></div>
</div>
</div>
<Form form={form} layout="vertical" onFinish={handleFinish}>
<Form.Item name="username" label="账号" rules={[{ required: true, message: "请输入账号" }]}>
<Input size="large" prefix={<UserOutlined />} placeholder="请输入用户名或手机号" />
</Form.Item>
<Form.Item name="password" label="密码" rules={[{ required: true, message: "请输入密码" }]}>
<Input.Password size="large" prefix={<LockOutlined />} placeholder="请输入密码" />
</Form.Item>
{captchaEnabled ? (
<>
<Form.Item name="captchaId" hidden>
<Input />
</Form.Item>
<Form.Item name="captchaCode" label="验证码" rules={[{ required: true, message: "请输入验证码" }]}>
<Input
size="large"
placeholder="请输入验证码"
addonAfter={
<Button type="text" icon={<ReloadOutlined />} onClick={() => void loadCaptcha()}>
</Button>
}
/>
</Form.Item>
{captcha?.imageBase64 ? (
<div className="captcha-preview">
<img src={captcha.imageBase64} alt="验证码" />
</div>
) : null}
</>
) : null}
<Button type="primary" htmlType="submit" size="large" block loading={submitting}>
</Button>
</Form>
{platformConfig?.icpInfo || platformConfig?.copyrightInfo ? (
<div className="login-card__footer">
{platformConfig?.icpInfo ? <div>{platformConfig.icpInfo}</div> : null}
{platformConfig?.copyrightInfo ? <div>{platformConfig.copyrightInfo}</div> : null}
</div>
) : null}
</Card>
</div>
);
}

View File

@ -0,0 +1,104 @@
import { App } from "antd";
import { useEffect, useMemo, useState } from "react";
import { useParams } from "react-router-dom";
import { getMeetingChapters, getMeetingDetail, getMeetingTranscripts, updateMeetingBasic } from "@/api/meeting";
import LoadingScreen from "@/components/LoadingScreen";
import PageHeader from "@/components/PageHeader";
import MeetingPreviewView from "@/components/preview/MeetingPreviewView";
import usePageTitle from "@/hooks/usePageTitle";
import type { MeetingChapterVO, MeetingTranscriptVO, MeetingVO } from "@/types";
import { buildMeetingPreviewUrl } from "@/utils/meeting";
export default function MeetingDetailPage() {
const { message } = App.useApp();
const { id } = useParams<{ id: string }>();
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [meeting, setMeeting] = useState<MeetingVO | null>(null);
const [transcripts, setTranscripts] = useState<MeetingTranscriptVO[]>([]);
const [chapters, setChapters] = useState<MeetingChapterVO[]>([]);
const [sharePasswordDraft, setSharePasswordDraft] = useState("");
const meetingId = useMemo(() => Number(id), [id]);
usePageTitle(meeting?.title || "会议详情");
const loadDetail = async () => {
if (!meetingId || Number.isNaN(meetingId)) {
message.error("会议编号无效");
return;
}
setLoading(true);
try {
const [detailResp, transcriptResp, chapterResp] = await Promise.all([
getMeetingDetail(meetingId),
getMeetingTranscripts(meetingId),
getMeetingChapters(meetingId),
]);
const detail = detailResp.data.data;
setMeeting(detail);
setTranscripts(transcriptResp.data.data || []);
setChapters(chapterResp.data.data || []);
setSharePasswordDraft((detail.accessPassword || "").trim());
} finally {
setLoading(false);
}
};
useEffect(() => {
void loadDetail();
}, [meetingId]);
const handleSaveSharePassword = async () => {
if (!meeting) {
return;
}
setSaving(true);
try {
await updateMeetingBasic({
meetingId: meeting.id,
accessPassword: sharePasswordDraft.trim(),
});
setMeeting({ ...meeting, accessPassword: sharePasswordDraft.trim() });
message.success(sharePasswordDraft.trim() ? "访问密码已更新" : "访问密码已取消");
} finally {
setSaving(false);
}
};
const handleCopyShareLink = async () => {
if (!meeting) {
return;
}
const url = buildMeetingPreviewUrl(meeting.id);
try {
await navigator.clipboard.writeText(url);
message.success("分享链接已复制");
} catch {
message.error("复制分享链接失败");
}
};
return (
<div className="page-stack">
<PageHeader title="会议详情" back />
{loading || !meeting ? (
<LoadingScreen text="正在加载会议详情..." />
) : (
<MeetingPreviewView
meeting={meeting}
transcripts={transcripts}
meetingChapters={chapters}
shareUrl={buildMeetingPreviewUrl(meeting.id)}
editableShare
sharePasswordDraft={sharePasswordDraft}
shareSaving={saving}
onSharePasswordDraftChange={setSharePasswordDraft}
onSaveSharePassword={handleSaveSharePassword}
onCopyShareLink={handleCopyShareLink}
/>
)}
</div>
);
}

View File

@ -0,0 +1,134 @@
import { App, Button, Card, Input, Space, Typography } from "antd";
import { useEffect, useMemo, useState } from "react";
import { useParams, useSearchParams } from "react-router-dom";
import { getMeetingPreviewAccess, getPublicMeetingPreview } from "@/api/meeting";
import LoadingScreen from "@/components/LoadingScreen";
import MeetingPreviewView from "@/components/preview/MeetingPreviewView";
import usePageTitle from "@/hooks/usePageTitle";
import type { MeetingChapterVO, MeetingTranscriptVO, MeetingVO } from "@/types";
import { buildMeetingPreviewUrl } from "@/utils/meeting";
const { Paragraph, Title } = Typography;
export default function MeetingPreviewPage() {
const { message } = App.useApp();
const { id } = useParams<{ id: string }>();
const [searchParams] = useSearchParams();
const [loading, setLoading] = useState(true);
const [meeting, setMeeting] = useState<MeetingVO | null>(null);
const [transcripts, setTranscripts] = useState<MeetingTranscriptVO[]>([]);
const [chapters, setChapters] = useState<MeetingChapterVO[]>([]);
const [passwordRequired, setPasswordRequired] = useState(false);
const [passwordVerified, setPasswordVerified] = useState(false);
const [accessPassword, setAccessPassword] = useState("");
const meetingId = useMemo(() => Number(id), [id]);
const presetAccessPassword = useMemo(() => (searchParams.get("accessPassword") || "").trim(), [searchParams]);
usePageTitle(meeting?.title || "会议预览");
const loadPreview = async (password?: string) => {
const previewResp = await getPublicMeetingPreview(meetingId, password);
setMeeting(previewResp.data.data.meeting);
setTranscripts(previewResp.data.data.transcripts || []);
setChapters(previewResp.data.data.chapters || []);
setPasswordVerified(true);
};
useEffect(() => {
const run = async () => {
if (!meetingId || Number.isNaN(meetingId)) {
message.error("会议编号无效");
setLoading(false);
return;
}
setLoading(true);
try {
const accessResp = await getMeetingPreviewAccess(meetingId);
const required = !!accessResp.data.data.passwordRequired;
setPasswordRequired(required);
if (!required) {
await loadPreview();
return;
}
if (presetAccessPassword) {
try {
await loadPreview(presetAccessPassword);
setAccessPassword(presetAccessPassword);
return;
} catch {
setPasswordVerified(false);
}
}
} finally {
setLoading(false);
}
};
void run();
}, [meetingId, presetAccessPassword]);
const handleSubmitPassword = async () => {
if (!accessPassword.trim()) {
return;
}
setLoading(true);
try {
await loadPreview(accessPassword.trim());
message.success("访问校验通过");
} catch {
message.error("访问密码错误");
} finally {
setLoading(false);
}
};
if (loading && !meeting && !passwordRequired) {
return <LoadingScreen text="正在加载会议预览..." />;
}
if (passwordRequired && !passwordVerified) {
return (
<div className="preview-page">
<Card className="surface-card preview-password-card">
<Title level={3}></Title>
<Paragraph type="secondary">访访</Paragraph>
<Space direction="vertical" size={16} style={{ width: "100%" }}>
<Input.Password
value={accessPassword}
placeholder="请输入访问密码"
onChange={(event) => setAccessPassword(event.target.value)}
onPressEnter={() => void handleSubmitPassword()}
/>
<Button type="primary" block loading={loading} onClick={() => void handleSubmitPassword()}>
</Button>
</Space>
</Card>
</div>
);
}
if (!meeting) {
return <LoadingScreen text="未找到会议内容" />;
}
return (
<div className="preview-page">
<div className="preview-page__inner">
<div className="preview-page__header">
<span className="login-page__badge">iMeeting </span>
</div>
<MeetingPreviewView
meeting={meeting}
transcripts={transcripts}
meetingChapters={chapters}
shareUrl={buildMeetingPreviewUrl(meeting.id)}
/>
</div>
</div>
);
}

View File

@ -0,0 +1,102 @@
import { ReloadOutlined } from "@ant-design/icons";
import { App, Button, Card, Empty, Pagination, Space, Typography } from "antd";
import { useEffect, useState } from "react";
import { useNavigate } from "react-router-dom";
import { getMeetingPage } from "@/api/meeting";
import LoadingScreen from "@/components/LoadingScreen";
import PageHeader from "@/components/PageHeader";
import usePageTitle from "@/hooks/usePageTitle";
import type { MeetingVO } from "@/types";
import { formatMeetingDate, formatMeetingTimeRange, getSummarySnippet, splitParticipants } from "@/utils/meeting";
const { Paragraph, Text } = Typography;
export default function MeetingsPage() {
const { message } = App.useApp();
const navigate = useNavigate();
usePageTitle("我的会议");
const [loading, setLoading] = useState(true);
const [current, setCurrent] = useState(1);
const [size, setSize] = useState(10);
const [total, setTotal] = useState(0);
const [meetings, setMeetings] = useState<MeetingVO[]>([]);
const loadData = async (page = current, pageSize = size) => {
setLoading(true);
try {
const resp = await getMeetingPage({
current: page,
size: pageSize,
viewType: "all",
});
setMeetings(resp.data.data.records || []);
setTotal(resp.data.data.total || 0);
setCurrent(page);
setSize(pageSize);
} catch {
message.error("会议列表加载失败");
} finally {
setLoading(false);
}
};
useEffect(() => {
void loadData(1, size);
}, []);
return (
<div className="page-stack">
<PageHeader
title="我的会议"
extra={
<Button type="text" shape="circle" icon={<ReloadOutlined />} onClick={() => void loadData(current, size)} />
}
/>
<Card className="surface-card">
{loading ? (
<LoadingScreen text="正在加载会议列表..." />
) : meetings.length ? (
<div className="meeting-card-list">
{meetings.map((meeting) => {
const participantCount = splitParticipants(meeting).length;
return (
<button
key={meeting.id}
type="button"
className="meeting-list-card"
onClick={() => navigate(`/meetings/${meeting.id}`)}
>
<div className="meeting-list-card__title">{meeting.title || "未命名会议"}</div>
<div className="meeting-list-card__meta-grid">
<div>{formatMeetingDate(meeting.meetingTime)}</div>
<div>{formatMeetingTimeRange(meeting.meetingTime)}</div>
<div>{meeting.creatorName || "未设置创建人"}</div>
<div>{participantCount} </div>
</div>
<Paragraph className="meeting-list-card__summary" ellipsis={{ rows: 2 }}>
{getSummarySnippet(meeting)}
</Paragraph>
</button>
);
})}
<div className="meeting-pagination">
<Pagination
size="small"
current={current}
pageSize={size}
total={total}
showSizeChanger={false}
onChange={(page, pageSize) => void loadData(page, pageSize)}
/>
</div>
</div>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无会议记录" />
)}
</Card>
</div>
);
}

View File

@ -0,0 +1,63 @@
import { App, Button, Card, Form, Input } from "antd";
import { useState } from "react";
import { updateMyPassword } from "@/api/user";
import PageHeader from "@/components/PageHeader";
import usePageTitle from "@/hooks/usePageTitle";
export default function PasswordPage() {
const { message } = App.useApp();
const [form] = Form.useForm();
const [saving, setSaving] = useState(false);
usePageTitle("修改密码");
const handleFinish = async (values: { oldPassword: string; newPassword: string; confirmPassword: string }) => {
setSaving(true);
try {
await updateMyPassword(values);
message.success("密码修改成功");
form.resetFields();
} catch {
return;
} finally {
setSaving(false);
}
};
return (
<div className="page-stack">
<PageHeader title="修改密码" back />
<Card className="surface-card">
<Form form={form} layout="vertical" onFinish={handleFinish}>
<Form.Item label="当前密码" name="oldPassword" rules={[{ required: true, message: "请输入当前密码" }]}>
<Input.Password placeholder="请输入当前密码" />
</Form.Item>
<Form.Item label="新密码" name="newPassword" rules={[{ required: true, message: "请输入新密码" }, { min: 6, message: "新密码至少 6 位" }]}>
<Input.Password placeholder="请输入新密码" />
</Form.Item>
<Form.Item
label="确认新密码"
name="confirmPassword"
dependencies={["newPassword"]}
rules={[
{ required: true, message: "请再次输入新密码" },
({ getFieldValue }) => ({
validator(_, value) {
if (!value || getFieldValue("newPassword") === value) {
return Promise.resolve();
}
return Promise.reject(new Error("两次输入的新密码不一致"));
},
}),
]}
>
<Input.Password placeholder="请再次输入新密码" />
</Form.Item>
<Button type="primary" htmlType="submit" block loading={saving}>
</Button>
</Form>
</Card>
</div>
);
}

View File

@ -0,0 +1,108 @@
import { App, Avatar, Button, Card, Space, Typography } from "antd";
import { InfoCircleOutlined, LockOutlined, LogoutOutlined, RightOutlined } from "@ant-design/icons";
import { useEffect, useState, type ReactNode } from "react";
import { useNavigate } from "react-router-dom";
import { getCurrentUser } from "@/api/user";
import LoadingScreen from "@/components/LoadingScreen";
import PageHeader from "@/components/PageHeader";
import usePageTitle from "@/hooks/usePageTitle";
import type { UserProfile } from "@/types";
import { clearAuth, saveProfile } from "@/utils/auth";
import { getDisplayName, getProfileOrgLabel } from "@/utils/meeting";
const { Paragraph, Text, Title } = Typography;
function ProfileAction({
icon,
label,
onClick,
danger = false,
}: {
icon: ReactNode;
label: string;
onClick: () => void;
danger?: boolean;
}) {
return (
<button type="button" className={`profile-action${danger ? " is-danger" : ""}`} onClick={onClick}>
<span className="profile-action__left">
<span className="profile-action__icon">{icon}</span>
<span>{label}</span>
</span>
{!danger ? <RightOutlined /> : null}
</button>
);
}
export default function ProfilePage() {
const { message } = App.useApp();
const navigate = useNavigate();
usePageTitle("个人中心");
const [loading, setLoading] = useState(true);
const [profile, setProfile] = useState<UserProfile | null>(null);
useEffect(() => {
const loadProfile = async () => {
setLoading(true);
try {
const data = await getCurrentUser();
setProfile(data);
saveProfile(data);
} finally {
setLoading(false);
}
};
void loadProfile();
}, []);
const handleLogout = () => {
clearAuth();
message.success("已退出当前账号");
navigate("/login", { replace: true });
};
if (loading || !profile) {
return (
<div className="page-stack">
<PageHeader title="个人中心" />
<LoadingScreen text="正在加载个人信息..." />
</div>
);
}
const displayName = getDisplayName(profile.displayName, profile.username);
return (
<div className="page-stack">
<PageHeader title="个人中心" />
<div className="profile-hero">
<Avatar size={96} src={profile.avatarUrl} className="profile-hero__avatar">
{displayName.slice(0, 1)}
</Avatar>
<Title level={3} style={{ margin: "14px 0 6px" }}>
{displayName}
</Title>
<Text type="secondary">{profile.email || "未设置邮箱"}</Text>
<div className="profile-hero__meta">
<div>{getProfileOrgLabel(profile)}</div>
<div>{profile.phone || "未设置手机号"}</div>
</div>
</div>
<Card className="surface-card">
<Space direction="vertical" size={12} style={{ width: "100%" }}>
<ProfileAction icon={<LockOutlined />} label="个人设置" onClick={() => navigate("/profile/password")} />
<ProfileAction icon={<InfoCircleOutlined />} label="关于我们" onClick={() => navigate("/about")} />
<ProfileAction icon={<LogoutOutlined />} label="退出当前账号" onClick={handleLogout} danger />
</Space>
</Card>
<Paragraph type="secondary" className="profile-footer">
访访
</Paragraph>
</div>
);
}

View File

@ -0,0 +1,101 @@
import { App, Button, Card, Result, Space, Typography } from "antd";
import { CheckCircleOutlined, QrcodeOutlined } from "@ant-design/icons";
import { useState } from "react";
import { useNavigate, useParams } from "react-router-dom";
import { createPublicDeviceMeetingBySession } from "@/api/meeting";
import PageHeader from "@/components/PageHeader";
import usePageTitle from "@/hooks/usePageTitle";
const { Paragraph, Title } = Typography;
export default function ScanConfirmPage() {
const { message } = App.useApp();
const navigate = useNavigate();
const { sessionId } = useParams<{ sessionId: string }>();
const [submitting, setSubmitting] = useState(false);
const [confirmed, setConfirmed] = useState(false);
usePageTitle("扫码确认");
const handleConfirm = async () => {
if (!sessionId) {
message.error("扫码会话不存在");
return;
}
setSubmitting(true);
try {
await createPublicDeviceMeetingBySession(sessionId);
setConfirmed(true);
message.success("登录确认已发送到安卓设备");
} finally {
setSubmitting(false);
}
};
return (
<div className="page-stack">
<PageHeader title="扫码确认" back />
<Card className="surface-card">
{!sessionId ? (
<Result
status="error"
title="二维码参数无效"
subTitle="请返回设备端重新生成二维码后再次扫码。"
extra={
<Button type="primary" onClick={() => navigate("/meetings")}>
</Button>
}
/>
) : confirmed ? (
<Result
status="success"
title="登录确认已发送"
subTitle="安卓设备收到确认消息后,会继续按离线发会流程处理后续动作。"
extra={
<Button type="primary" onClick={() => navigate("/meetings")}>
</Button>
}
/>
) : (
<Space direction="vertical" size={20} style={{ width: "100%" }}>
<div className="scan-confirm__hero">
<div className="scan-confirm__icon">
<QrcodeOutlined />
</div>
<div>
<Title level={4} style={{ margin: 0 }}>
</Title>
<Paragraph type="secondary" style={{ margin: "8px 0 0" }}>
H5
</Paragraph>
</div>
</div>
<Card bordered={false} className="scan-confirm__tip-card">
<Space direction="vertical" size={10}>
<div className="scan-confirm__tip-line">
<CheckCircleOutlined />
<span>线</span>
</div>
<div className="scan-confirm__tip-line is-muted">
<span>访</span>
</div>
</Space>
</Card>
<div className="inline-actions inline-actions--right">
<Button onClick={() => navigate(-1)}></Button>
<Button type="primary" loading={submitting} onClick={() => void handleConfirm()}>
</Button>
</div>
</Space>
)}
</Card>
</div>
);
}

View File

@ -0,0 +1,15 @@
import type { PropsWithChildren } from "react";
import { Navigate, useLocation } from "react-router-dom";
import { hasAccessToken } from "@/utils/auth";
export default function ProtectedRoute({ children }: PropsWithChildren) {
const location = useLocation();
if (!hasAccessToken()) {
const redirect = `${location.pathname}${location.search}`;
return <Navigate to={`/login?redirect=${encodeURIComponent(redirect)}`} replace />;
}
return children;
}

View File

@ -0,0 +1,561 @@
:root {
color-scheme: light;
--h5-max-width: 430px;
--h5-page-padding: 18px;
--h5-nav-height: 82px;
--h5-text-main: #162033;
--h5-text-subtle: #6b7a90;
--h5-line: rgba(15, 36, 66, 0.08);
--h5-primary: #1f6bff;
--h5-primary-soft: #e9f1ff;
--h5-surface: rgba(255, 255, 255, 0.94);
--h5-surface-strong: #ffffff;
}
* {
box-sizing: border-box;
}
html,
body,
#root {
min-height: 100%;
margin: 0;
}
body {
background:
radial-gradient(circle at top, rgba(50, 122, 255, 0.12), transparent 34%),
linear-gradient(180deg, #fbfdff 0%, #f2f6fb 100%);
color: var(--h5-text-main);
font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
button {
font: inherit;
}
.h5-app-shell {
position: relative;
min-height: 100vh;
padding: 0 0 calc(env(safe-area-inset-bottom) + 12px);
}
.h5-app-shell__bg {
position: fixed;
inset: 0;
pointer-events: none;
background:
radial-gradient(circle at 20% 10%, rgba(31, 107, 255, 0.08), transparent 25%),
radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.08), transparent 20%);
}
.h5-app-shell__content {
position: relative;
max-width: var(--h5-max-width);
min-height: 100vh;
margin: 0 auto;
padding: 20px var(--h5-page-padding) calc(var(--h5-nav-height) + 18px);
}
.page-stack {
display: flex;
flex-direction: column;
gap: 16px;
}
.surface-card {
border: 1px solid var(--h5-line) !important;
background: var(--h5-surface) !important;
box-shadow: 0 18px 48px rgba(16, 40, 78, 0.08) !important;
}
.surface-card--hero {
overflow: hidden;
}
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
min-height: 44px;
}
.page-header__left {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}
.page-header__title {
margin: 0;
font-size: 28px;
font-weight: 800;
letter-spacing: -0.03em;
}
.page-header__back {
background: rgba(255, 255, 255, 0.8);
}
.h5-bottom-nav {
position: fixed;
left: 50%;
bottom: 0;
z-index: 5;
display: grid;
grid-template-columns: repeat(2, 1fr);
width: min(var(--h5-max-width), 100vw);
transform: translateX(-50%);
padding: 10px 18px calc(env(safe-area-inset-bottom) + 10px);
background: rgba(255, 255, 255, 0.92);
backdrop-filter: blur(14px);
border-top: 1px solid rgba(15, 36, 66, 0.08);
}
.h5-bottom-nav__item {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
color: #8794a8;
font-size: 12px;
font-weight: 600;
}
.h5-bottom-nav__item.is-active {
color: var(--h5-primary);
}
.h5-bottom-nav__icon {
font-size: 20px;
}
.state-panel {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 220px;
gap: 12px;
}
.state-panel__text {
color: var(--h5-text-subtle);
}
.login-page {
max-width: var(--h5-max-width);
margin: 0 auto;
min-height: 100vh;
padding: 32px var(--h5-page-padding);
display: flex;
flex-direction: column;
justify-content: center;
gap: 24px;
}
.login-page__hero {
padding: 8px 4px;
}
.login-page__badge {
display: inline-flex;
align-items: center;
padding: 6px 12px;
border-radius: 999px;
background: var(--h5-primary-soft);
color: var(--h5-primary);
font-size: 12px;
font-weight: 700;
}
.login-card .ant-card-body {
padding: 24px;
}
.login-card__brand {
display: flex;
align-items: center;
gap: 14px;
margin-bottom: 20px;
}
.login-card__logo {
width: 48px;
height: 48px;
border-radius: 14px;
object-fit: cover;
background: #f1f5fb;
}
.login-card__brand-text {
display: flex;
flex-direction: column;
gap: 2px;
}
.login-card__brand-name {
font-size: 18px;
font-weight: 800;
}
.login-card__brand-desc {
color: var(--h5-text-subtle);
font-size: 12px;
}
.captcha-preview {
margin: -4px 0 16px;
padding: 10px 14px;
border-radius: 14px;
background: #f7faff;
text-align: center;
}
.captcha-preview img {
max-width: 100%;
}
.login-card__footer {
margin-top: 18px;
padding-top: 14px;
border-top: 1px solid rgba(15, 36, 66, 0.08);
color: var(--h5-text-subtle);
font-size: 12px;
line-height: 1.8;
}
.meeting-card-list {
display: flex;
flex-direction: column;
gap: 14px;
}
.meeting-list-card {
width: 100%;
border: 0;
border-radius: 18px;
background: #fff;
padding: 18px 16px;
text-align: left;
box-shadow: inset 0 0 0 1px rgba(15, 36, 66, 0.06);
}
.meeting-list-card__title {
font-size: 18px;
font-weight: 800;
line-height: 1.4;
}
.meeting-list-card__meta-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 14px;
margin-top: 12px;
color: var(--h5-primary);
font-size: 13px;
}
.meeting-list-card__summary {
margin: 14px 0 0 !important;
color: var(--h5-text-subtle) !important;
}
.meeting-pagination {
display: flex;
justify-content: center;
padding-top: 4px;
}
.meeting-hero {
display: flex;
flex-direction: column;
gap: 16px;
}
.meeting-hero__chips {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.meeting-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 7px 12px;
border-radius: 999px;
background: var(--h5-primary-soft);
color: var(--h5-primary);
font-size: 13px;
font-weight: 700;
}
.info-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 14px;
}
.info-item {
display: flex;
flex-direction: column;
gap: 6px;
}
.info-item__label {
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--h5-text-subtle);
font-size: 12px;
}
.tag-list {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.participant-tag {
margin: 0 !important;
padding: 6px 12px !important;
border-radius: 999px !important;
border: 0 !important;
background: #f3f7fc !important;
}
.inline-actions {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.inline-actions--right {
justify-content: flex-end;
}
.meeting-audio {
width: 100%;
}
.markdown-body {
color: var(--h5-text-main);
line-height: 1.8;
}
.markdown-body p:first-child {
margin-top: 0;
}
.chapter-list,
.transcript-list {
display: flex;
flex-direction: column;
gap: 14px;
}
.chapter-item,
.transcript-item {
display: flex;
gap: 12px;
padding: 14px;
border-radius: 16px;
background: #f8fbff;
border: 1px solid rgba(15, 36, 66, 0.06);
}
.chapter-item__index {
flex-shrink: 0;
width: 30px;
height: 30px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background: var(--h5-primary);
color: #fff;
font-size: 12px;
font-weight: 700;
}
.chapter-item__body,
.transcript-item__content {
flex: 1;
min-width: 0;
}
.chapter-item__title {
display: flex;
flex-direction: column;
gap: 6px;
font-weight: 700;
}
.chapter-item__time,
.transcript-item__meta {
color: var(--h5-text-subtle);
font-size: 12px;
}
.chapter-item__summary {
margin-top: 8px;
color: var(--h5-text-subtle);
line-height: 1.7;
}
.transcript-item {
flex-direction: column;
}
.transcript-item__meta {
display: flex;
justify-content: space-between;
gap: 12px;
}
.preview-page {
min-height: 100vh;
padding: 20px 16px 32px;
}
.preview-page__inner {
max-width: 860px;
margin: 0 auto;
display: flex;
flex-direction: column;
gap: 16px;
}
.preview-page__header {
display: flex;
justify-content: center;
padding-top: 6px;
}
.preview-password-card {
max-width: 420px;
margin: 80px auto 0;
}
.profile-hero {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 0 8px;
text-align: center;
}
.profile-hero__avatar {
border: 4px solid rgba(31, 107, 255, 0.12);
background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
color: var(--h5-primary);
font-size: 28px;
font-weight: 800;
}
.profile-hero__meta {
margin-top: 14px;
color: var(--h5-text-subtle);
display: grid;
gap: 6px;
}
.profile-action {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 14px;
border: 1px solid rgba(15, 36, 66, 0.08);
border-radius: 16px;
background: #fff;
color: var(--h5-text-main);
}
.profile-action.is-danger {
justify-content: center;
color: #ff4d4f;
}
.profile-action__left {
display: inline-flex;
align-items: center;
gap: 12px;
font-weight: 700;
}
.profile-action__icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: 10px;
background: #edf4ff;
color: var(--h5-primary);
}
.profile-footer {
text-align: center;
padding: 0 8px;
}
.scan-confirm__hero {
display: flex;
align-items: flex-start;
gap: 16px;
}
.scan-confirm__icon {
width: 52px;
height: 52px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
background: var(--h5-primary-soft);
color: var(--h5-primary);
font-size: 22px;
}
.scan-confirm__tip-card {
background: #f7fbff !important;
}
.scan-confirm__tip-line {
display: flex;
gap: 8px;
color: var(--h5-text-main);
}
.scan-confirm__tip-line.is-muted {
color: var(--h5-text-subtle);
}
@media (max-width: 520px) {
.page-header__title {
font-size: 24px;
}
.info-grid,
.meeting-list-card__meta-grid {
grid-template-columns: 1fr 1fr;
}
.inline-actions {
flex-direction: column;
}
.inline-actions .ant-btn {
width: 100%;
}
}

View File

@ -0,0 +1,111 @@
export interface UserProfile {
userId: number;
username?: string;
displayName?: string;
email?: string;
phone?: string;
deptName?: string;
orgName?: string;
companyName?: string;
avatarUrl?: string;
isPlatformAdmin?: boolean;
isTenantAdmin?: boolean;
pwdResetRequired?: number;
}
export interface CaptchaResponse {
captchaId: string;
imageBase64: string;
}
export interface TokenResponse {
accessToken: string;
refreshToken: string;
accessExpiresInMinutes: number;
refreshExpiresInDays: number;
}
export interface MeetingVO {
id: number;
tenantId: number;
creatorId: number;
creatorName?: string;
hostUserId?: number;
hostName?: string;
title: string;
meetingTime: string;
participants: string;
participantIds?: number[];
tags: string;
audioUrl: string;
playbackAudioUrl?: string;
duration?: number;
meetingType?: "OFFLINE" | "REALTIME";
meetingSource?: "WEB" | "ANDROID";
sourceDeviceCode?: string;
sourceDeviceMode?: "PUBLIC" | "PRIVATE";
audioSaveStatus?: "NONE" | "SUCCESS" | "FAILED";
audioSaveMessage?: string;
accessPassword?: string | null;
summaryContent: string;
analysis?: {
overview?: string;
keywords?: string[];
chapters?: Array<{ time?: string; title?: string; summary?: string }>;
speakerSummaries?: Array<{ speaker?: string; summary?: string }>;
keyPoints?: Array<{ title?: string; summary?: string; speaker?: string; time?: string }>;
todos?: string[];
};
status: number;
createdAt: string;
}
export interface MeetingTranscriptVO {
id: number;
speakerId: string;
speakerName: string;
speakerLabel?: string;
content: string;
startTime?: number;
endTime?: number;
startTimeText?: string;
endTimeText?: string;
createdAt?: string;
}
export interface MeetingChapterVO {
chapterNo?: number;
time?: string;
title?: string;
summary?: string;
startTime?: number;
endTime?: number;
startTimeText?: string;
endTimeText?: string;
startTranscriptId?: number;
endTranscriptId?: number;
sourceTranscriptIds?: number[];
}
export interface PublicMeetingPreviewVO {
meeting: MeetingVO;
transcripts: MeetingTranscriptVO[];
chapters?: MeetingChapterVO[];
}
export interface MeetingPreviewAccessVO {
passwordRequired: boolean;
}
export interface UpdateMeetingBasicCommand {
meetingId: number;
title?: string;
meetingTime?: string;
tags?: string;
accessPassword?: string | null;
}
export interface MeetingPageResult {
records: MeetingVO[];
total: number;
}

View File

@ -0,0 +1,15 @@
export interface SysPlatformConfig {
projectName: string;
logoUrl?: string;
iconUrl?: string;
loginBgUrl?: string;
icpInfo?: string;
copyrightInfo?: string;
systemDescription?: string;
}
export interface PlatformConfigState {
platformConfig: SysPlatformConfig | null;
captchaEnabled: boolean;
loaded: boolean;
}

View File

@ -0,0 +1,47 @@
const ACCESS_TOKEN_KEY = "accessToken";
const REFRESH_TOKEN_KEY = "refreshToken";
const PROFILE_KEY = "userProfile";
export function hasAccessToken() {
return !!localStorage.getItem(ACCESS_TOKEN_KEY);
}
export function getAccessToken() {
return localStorage.getItem(ACCESS_TOKEN_KEY);
}
export function getRefreshToken() {
return localStorage.getItem(REFRESH_TOKEN_KEY);
}
export function saveTokens(accessToken: string, refreshToken: string) {
localStorage.setItem(ACCESS_TOKEN_KEY, accessToken);
localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken);
}
export function clearAuth() {
localStorage.removeItem(ACCESS_TOKEN_KEY);
localStorage.removeItem(REFRESH_TOKEN_KEY);
sessionStorage.removeItem(PROFILE_KEY);
}
export function saveProfile(profile: unknown) {
sessionStorage.setItem(PROFILE_KEY, JSON.stringify(profile));
}
export function getStoredProfile<T>() {
const raw = sessionStorage.getItem(PROFILE_KEY);
if (!raw) {
return null;
}
try {
return JSON.parse(raw) as T;
} catch {
return null;
}
}
export function buildLoginRedirect(pathname?: string) {
const target = pathname || `${window.location.pathname}${window.location.search}`;
return `/login?redirect=${encodeURIComponent(target)}`;
}

View File

@ -0,0 +1,56 @@
import dayjs from "dayjs";
import type { MeetingVO } from "@/types";
export function getDisplayName(name?: string, username?: string) {
return name || username || "未命名用户";
}
export function getProfileOrgLabel(profile: { companyName?: string; orgName?: string; deptName?: string }) {
return profile.companyName || profile.orgName || profile.deptName || "未设置组织信息";
}
export function formatMeetingDate(value?: string) {
if (!value) {
return "--";
}
return dayjs(value).format("YYYY/MM/DD");
}
export function formatMeetingTimeRange(value?: string) {
if (!value) {
return "--";
}
const start = dayjs(value);
return `${start.format("HH:mm")} - ${start.add(90, "minute").format("HH:mm")}`;
}
export function splitParticipants(meeting?: Pick<MeetingVO, "participants" | "participantIds"> | null) {
if (!meeting) {
return [];
}
if (Array.isArray(meeting.participantIds) && meeting.participantIds.length > 0) {
return meeting.participantIds.map((id) => String(id));
}
return (meeting.participants || "")
.split(/[,\n;]/)
.map((item) => item.trim())
.filter(Boolean);
}
export function getSummarySnippet(meeting: Pick<MeetingVO, "summaryContent" | "analysis">) {
return (
meeting.analysis?.overview?.trim() ||
meeting.summaryContent?.replace(/[#>*`-]/g, " ").replace(/\s+/g, " ").trim() ||
"暂无会议摘要"
);
}
export function buildMeetingPreviewUrl(meetingId: number, accessPassword?: string) {
const url = new URL(`/meetings/${meetingId}/preview`, window.location.origin);
const normalizedPassword = (accessPassword || "").trim();
if (normalizedPassword) {
url.searchParams.set("accessPassword", normalizedPassword);
}
return url.toString();
}

View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "ES2020",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "react-jsx",
"strict": true,
"skipLibCheck": true,
"noEmit": true,
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src"]
}

View File

@ -0,0 +1 @@
{"root":["./src/app.tsx","./src/main.tsx","./src/api/auth.ts","./src/api/http.ts","./src/api/meeting.ts","./src/api/platform.ts","./src/api/user.ts","./src/components/bottomnav.tsx","./src/components/loadingscreen.tsx","./src/components/meetingcontent.tsx","./src/components/pageheader.tsx","./src/components/platformconfigprovider.tsx","./src/components/preview/meetingpreviewview.tsx","./src/components/preview/meetinganalysis.ts","./src/hooks/usepagetitle.ts","./src/layouts/mainlayout.tsx","./src/pages/about/index.tsx","./src/pages/login/index.tsx","./src/pages/meeting-detail/index.tsx","./src/pages/meeting-preview/index.tsx","./src/pages/meetings/index.tsx","./src/pages/password/index.tsx","./src/pages/profile/index.tsx","./src/pages/scan-confirm/index.tsx","./src/routes/protectedroute.tsx","./src/types/index.ts","./src/types/platform.ts","./src/utils/auth.ts","./src/utils/meeting.ts"],"version":"5.9.3"}

View File

@ -0,0 +1,23 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { fileURLToPath, URL } from "node:url";
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
server: {
proxy: {
"/auth": "http://localhost:8080",
"/sys": "http://localhost:8080",
"/api": "http://localhost:8080",
"/ws": {
target: "ws://localhost:8080",
ws: true,
},
},
},
});