feat:添加日志
This commit is contained in:
@ -22,22 +22,35 @@ export class InvitationService {
|
||||
*/
|
||||
static async verifyCode(code: string): Promise<{ success: boolean; message: string }> {
|
||||
try {
|
||||
console.log('[InvitationService] 验证邀请码:', code);
|
||||
console.log('[InvitationService] ========== 开始验证邀请码 ==========');
|
||||
console.log('[InvitationService] 邀请码:', code);
|
||||
console.log('[InvitationService] 邀请码长度:', code.length);
|
||||
|
||||
const response = await verifyInvitationCode(code);
|
||||
|
||||
console.log('[InvitationService] 收到响应:', JSON.stringify(response, null, 2));
|
||||
console.log('[InvitationService] 响应代码:', response.code);
|
||||
console.log('[InvitationService] 响应消息:', response.msg);
|
||||
console.log('[InvitationService] 验证结果:', response.data?.verified);
|
||||
|
||||
if (response.code === 200 && response.data?.verified) {
|
||||
console.log('[InvitationService] ✓ 验证成功');
|
||||
return {
|
||||
success: true,
|
||||
message: response.msg || '验证成功'
|
||||
};
|
||||
} else {
|
||||
console.log('[InvitationService] ✗ 验证失败');
|
||||
return {
|
||||
success: false,
|
||||
message: response.msg || '验证失败'
|
||||
};
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('[InvitationService] 验证邀请码失败:', error);
|
||||
console.error('[InvitationService] ========== 验证邀请码异常 ==========');
|
||||
console.error('[InvitationService] 错误类型:', error.constructor.name);
|
||||
console.error('[InvitationService] 错误消息:', error.message);
|
||||
console.error('[InvitationService] 错误堆栈:', error.stack);
|
||||
return {
|
||||
success: false,
|
||||
message: error.message || '网络连接失败,请检查网络后重试'
|
||||
|
||||
Reference in New Issue
Block a user