From c19f1f7e21c93d1f13b4f44a8a615f65af577559 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期日, 16 八月 2026 15:10:24 +0800
Subject: [PATCH] 添加 android 端接口
---
src/modules/user/service/login.ts | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/modules/user/service/login.ts b/src/modules/user/service/login.ts
index 18d5cb3..283706d 100644
--- a/src/modules/user/service/login.ts
+++ b/src/modules/user/service/login.ts
@@ -287,18 +287,24 @@
const user = await this.basicdataSorterEntity.findOneBy({ phone });
if (user && user.password == md5(password)) {
-
+ if (user.status !== 0) {
+ throw new CoolCommException('鍒嗘嫞鍛樿处鍙蜂笉鍙敤');
+ }
const info = {
id: user.businessId,
- }
+ };
const { expire, refreshExpire } = this.jwtConfig;
return {
expire,
token: await this.generateSorterToken(info),
refreshExpire,
refreshToken: await this.generateSorterToken(info, true),
+ sorterId: user.businessId,
+ businessName: user.businessName,
+ phone: user.phone,
+ departmentId: user.departmentId,
+ workSiteId: user.workSiteId,
};
-
} else {
throw new CoolCommException('璐﹀彿鎴栧瘑鐮侀敊璇�');
}
@@ -346,7 +352,9 @@
*/
async generateSorterToken(info, isRefresh = false) {
const { expire, refreshExpire, secret } = this.jwtConfig;
- const user = await this.basicdataSorterEntity.findOneBy({ businessId: Equal(info.unionid) });
+ const user = await this.basicdataSorterEntity.findOneBy({
+ businessId: Equal(info.id),
+ });
const tokenInfo = {
isRefresh,
...info,
--
Gitblit v1.9.1