用户在线状态处理

This commit is contained in:
2025-10-19 13:40:20 +08:00
parent 39fa0b2d04
commit 118ec38550
7 changed files with 283 additions and 157 deletions

View File

@@ -255,9 +255,10 @@ class UserService {
/**
* 用户签到
* @param initialLocation 初始位置数据(必须)
* @returns 签到结果和更新后的用户信息
*/
async signIn(): Promise<{ success: boolean; employeeInfo: EmployeeInfo; message?: string }> {
async signIn(initialLocation: { latitude: number; longitude: number; timestamp: number }): Promise<{ success: boolean; employeeInfo: EmployeeInfo; message?: string }> {
const userInfo = this.getGlobalUserInfo();
if (!userInfo || !userInfo.id) {
throw new Error('用户未登录,无法签到');
@@ -269,7 +270,7 @@ class UserService {
throw new Error('用户认证信息缺失,请重新登录');
}
return apiService.userSignIn(userInfo.id);
return apiService.userSignIn(userInfo.id, initialLocation);
}
/**