consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题

This commit is contained in:
cyh666666
2026-02-24 17:17:49 +08:00
parent e2f1dfb097
commit e606c597ca
174 changed files with 37917 additions and 4444 deletions

View File

@@ -28,16 +28,18 @@ export async function ensureUserProfile(sessionUser: UTSJSONObject): Promise<Use
console.log('ensureUserProfile check ak_users:', {
status: checkRes.status,
hasData: checkRes.data != null,
hasError: (checkRes as any).error != null,
error: (checkRes as any).error
hasData: checkRes.data != null
})
if (checkRes.status >= 200 && checkRes.status < 300 && checkRes.data != null) {
// 用户已存在返回现有资料H5 下 checkRes.data 可能是 plain object不一定是 UTSJSONObject
const existingUser = (typeof (checkRes.data as any).getString === 'function')
? (checkRes.data as UTSJSONObject)
: new UTSJSONObject(checkRes.data as any)
const data = checkRes.data
let existingUser: UTSJSONObject
if (data instanceof UTSJSONObject) {
existingUser = data
} else {
existingUser = new UTSJSONObject(data)
}
return {
id: existingUser.getString('id') ?? '',
username: existingUser.getString('username') ?? '',
@@ -67,17 +69,13 @@ export async function ensureUserProfile(sessionUser: UTSJSONObject): Promise<Use
.single()
.execute()
console.log('ensureUserProfile insert ak_users:', {
status: insertRes.status,
hasData: insertRes.data != null,
hasError: (insertRes as any).error != null,
error: (insertRes as any).error
})
console.log('ensureUserProfile insert ak_users status:', insertRes.status)
if (insertRes.status >= 200 && insertRes.status < 300 && insertRes.data != null) {
const newUser = (typeof (insertRes.data as any).getString === 'function')
? (insertRes.data as UTSJSONObject)
: new UTSJSONObject(insertRes.data as any)
const rawData = insertRes.data
const newUser = (rawData instanceof UTSJSONObject)
? (rawData as UTSJSONObject)
: new UTSJSONObject(rawData)
return {
id: newUser.getString('id') ?? '',
username: newUser.getString('username') ?? '',