diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 843e9494..3abdb4a3 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -701,7 +701,10 @@ "Bash(ssh ceshi@103.39.231.231 \"docker ps | grep -i kong\")", "Bash(ssh ceshi@103.39.231.231 \"curl -s http://localhost:8000/api/v2/mining-admin/auth/login -X POST -H ''Content-Type: application/json'' -d ''{\"\"username\"\":\"\"admin\"\",\"\"password\"\":\"\"admin123\"\"}''\")", "Bash(ssh ceshi@103.39.231.231 \"curl -s http://localhost:8000/api/v2/mining-admin/auth/profile -H ''Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3ODRlNTA0MS1hYTM2LTQ0ZTctYTM1NS0yY2I2ZjYwYmY1YmIiLCJ1c2VybmFtZSI6ImFkbWluIiwicm9sZSI6IlNVUEVSX0FETUlOIiwiaWF0IjoxNzY4MTIyMjc3LCJleHAiOjE3NjgyMDg2Nzd9.XL0i0_tQlybkT9ktLIP90WQZDujPbbARL20h6fLmeRE''\")", - "Bash(user \")" + "Bash(user \")", + "mcp__UIPro__getCodeFromUIProPlugin", + "Bash(flutter create:*)", + "Bash(DATABASE_URL=\"postgresql://postgres:postgres@localhost:5432/rwa_auth?schema=public\" npx prisma migrate dev:*)" ], "deny": [], "ask": [] diff --git a/backend/services/auth-service/prisma/migrations/20260111083500_allow_nullable_phone_password/migration.sql b/backend/services/auth-service/prisma/migrations/20260111083500_allow_nullable_phone_password/migration.sql new file mode 100644 index 00000000..83238cd0 --- /dev/null +++ b/backend/services/auth-service/prisma/migrations/20260111083500_allow_nullable_phone_password/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable: 允许 phone 和 password_hash 为空(支持系统账户同步) +ALTER TABLE "synced_legacy_users" ALTER COLUMN "phone" DROP NOT NULL; +ALTER TABLE "synced_legacy_users" ALTER COLUMN "password_hash" DROP NOT NULL; diff --git a/backend/services/auth-service/prisma/schema.prisma b/backend/services/auth-service/prisma/schema.prisma index 3fe72f47..0a194f5f 100644 --- a/backend/services/auth-service/prisma/schema.prisma +++ b/backend/services/auth-service/prisma/schema.prisma @@ -84,8 +84,8 @@ model SyncedLegacyUser { // 1.0 用户数据 legacyId BigInt @unique @map("legacy_id") // 1.0 的 user.id accountSequence String @unique @map("account_sequence") - phone String - passwordHash String @map("password_hash") + phone String? // 系统账户可能没有手机号 + passwordHash String? @map("password_hash") // 系统账户可能没有密码 status String legacyCreatedAt DateTime @map("legacy_created_at") diff --git a/backend/services/auth-service/src/infrastructure/messaging/cdc/legacy-user-cdc.consumer.ts b/backend/services/auth-service/src/infrastructure/messaging/cdc/legacy-user-cdc.consumer.ts index 53b33bf3..eeed68c7 100644 --- a/backend/services/auth-service/src/infrastructure/messaging/cdc/legacy-user-cdc.consumer.ts +++ b/backend/services/auth-service/src/infrastructure/messaging/cdc/legacy-user-cdc.consumer.ts @@ -124,24 +124,12 @@ export class LegacyUserCdcConsumer implements OnModuleInit, OnModuleDestroy { } private async upsertLegacyUser(user: UnwrappedCdcUser, sequenceNum: bigint) { - // 跳过没有手机号的系统账户(user_id 1-5 通常是系统/测试账户) - if (!user.phone_number) { - this.logger.debug(`Skipped user ${user.user_id} (no phone number)`); - return; - } - - // 跳过没有密码的账户 - if (!user.password_hash) { - this.logger.debug(`Skipped user ${user.user_id} (no password)`); - return; - } - try { await this.prisma.syncedLegacyUser.upsert({ where: { legacyId: BigInt(user.user_id) }, update: { - phone: user.phone_number, - passwordHash: user.password_hash, + phone: user.phone_number || null, + passwordHash: user.password_hash || null, accountSequence: user.account_sequence, status: user.status, sourceSequenceNum: sequenceNum, @@ -149,8 +137,8 @@ export class LegacyUserCdcConsumer implements OnModuleInit, OnModuleDestroy { }, create: { legacyId: BigInt(user.user_id), - phone: user.phone_number, - passwordHash: user.password_hash, + phone: user.phone_number || null, + passwordHash: user.password_hash || null, accountSequence: user.account_sequence, status: user.status, legacyCreatedAt: new Date(user.registered_at), diff --git a/frontend/admin-web/public/drawable-xhdpi/background_1.png b/frontend/admin-web/public/drawable-xhdpi/background_1.png new file mode 100644 index 00000000..bc62067f Binary files /dev/null and b/frontend/admin-web/public/drawable-xhdpi/background_1.png differ diff --git a/frontend/admin-web/public/drawable-xhdpi/button1.png b/frontend/admin-web/public/drawable-xhdpi/button1.png new file mode 100644 index 00000000..ba005ed2 Binary files /dev/null and b/frontend/admin-web/public/drawable-xhdpi/button1.png differ diff --git a/frontend/admin-web/public/drawable-xxhdpi/background_1.png b/frontend/admin-web/public/drawable-xxhdpi/background_1.png new file mode 100644 index 00000000..700469d4 Binary files /dev/null and b/frontend/admin-web/public/drawable-xxhdpi/background_1.png differ diff --git a/frontend/admin-web/public/drawable-xxhdpi/button1.png b/frontend/admin-web/public/drawable-xxhdpi/button1.png new file mode 100644 index 00000000..5a0f73fb Binary files /dev/null and b/frontend/admin-web/public/drawable-xxhdpi/button1.png differ diff --git a/frontend/admin-web/public/drawable-xxxhdpi/background_1.png b/frontend/admin-web/public/drawable-xxxhdpi/background_1.png new file mode 100644 index 00000000..3d79ac6b Binary files /dev/null and b/frontend/admin-web/public/drawable-xxxhdpi/background_1.png differ diff --git a/frontend/admin-web/public/drawable-xxxhdpi/button1.png b/frontend/admin-web/public/drawable-xxxhdpi/button1.png new file mode 100644 index 00000000..b6328fde Binary files /dev/null and b/frontend/admin-web/public/drawable-xxxhdpi/button1.png differ diff --git a/frontend/admin-web/public/drawable/background.xml b/frontend/admin-web/public/drawable/background.xml new file mode 100644 index 00000000..3b2f9cb3 --- /dev/null +++ b/frontend/admin-web/public/drawable/background.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/frontend/admin-web/public/drawable/button.xml b/frontend/admin-web/public/drawable/button.xml new file mode 100644 index 00000000..05df329a --- /dev/null +++ b/frontend/admin-web/public/drawable/button.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container.xml b/frontend/admin-web/public/drawable/container.xml new file mode 100644 index 00000000..58818132 --- /dev/null +++ b/frontend/admin-web/public/drawable/container.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_1.xml b/frontend/admin-web/public/drawable/container_1.xml new file mode 100644 index 00000000..d7a14353 --- /dev/null +++ b/frontend/admin-web/public/drawable/container_1.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_2.xml b/frontend/admin-web/public/drawable/container_2.xml new file mode 100644 index 00000000..2e61b46e --- /dev/null +++ b/frontend/admin-web/public/drawable/container_2.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_3.xml b/frontend/admin-web/public/drawable/container_3.xml new file mode 100644 index 00000000..8506b426 --- /dev/null +++ b/frontend/admin-web/public/drawable/container_3.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_4.xml b/frontend/admin-web/public/drawable/container_4.xml new file mode 100644 index 00000000..81588103 --- /dev/null +++ b/frontend/admin-web/public/drawable/container_4.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_5.xml b/frontend/admin-web/public/drawable/container_5.xml new file mode 100644 index 00000000..98773d7f --- /dev/null +++ b/frontend/admin-web/public/drawable/container_5.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_6.xml b/frontend/admin-web/public/drawable/container_6.xml new file mode 100644 index 00000000..89f51a10 --- /dev/null +++ b/frontend/admin-web/public/drawable/container_6.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/container_7.xml b/frontend/admin-web/public/drawable/container_7.xml new file mode 100644 index 00000000..feee424c --- /dev/null +++ b/frontend/admin-web/public/drawable/container_7.xml @@ -0,0 +1,10 @@ + + + + diff --git a/frontend/admin-web/public/drawable/overlay.xml b/frontend/admin-web/public/drawable/overlay.xml new file mode 100644 index 00000000..40ead997 --- /dev/null +++ b/frontend/admin-web/public/drawable/overlay.xml @@ -0,0 +1,13 @@ + + + + +