Skip to content

Commit

Permalink
feat: improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Sep 21, 2023
1 parent 45c7753 commit 9441027
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"rules": {
"no-console": "off",
"new-cap": "off",
"n/prefer-global/process": "off"
"n/prefer-global/process": "off",
"no-restricted-globals": "off"
}
}
2 changes: 1 addition & 1 deletion server/api/cx/accounts/[uid]/monitor.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineEventHandler(async (event) => {
data: {
isOpened: true,
},
}, '已监听')
}, '已处于监听状态')
}

const account = await event.context.prisma.cxAccount.findUnique({
Expand Down
4 changes: 2 additions & 2 deletions server/api/cx/accounts/[uid]/update_setting.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

interface Body {
uid: string
setting: Setting
setting: CX.Setting
}

export default defineEventHandler(async (event) => {
Expand Down Expand Up @@ -48,5 +48,5 @@ export default defineEventHandler(async (event) => {
// }
// }

return ResOp.success(result.setting as unknown as Setting)
return ResOp.success(result.setting as unknown as CX.Setting)
})
2 changes: 1 addition & 1 deletion server/api/cx/accounts/index.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default defineEventHandler(async (event) => {
uid: cx.user.uid,
},
data: {
cookies: cx.getCookie('', 'json'),
cookies: cx.getCookie('', 'json') as any,
info: cx.user as any,
lastLoginTime: new Date(),
},
Expand Down
1 change: 1 addition & 0 deletions server/utils/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export async function handleListen(client: EasemobChat.Connection, cx: Cx, accou
await new Promise((resolve, reject) => {
client.listen({
onOpened: async () => {
console.log(cx.user.username, account.setting)
await prisma.cxAccount.update({
where: {
uid: cx.user.uid,
Expand Down

0 comments on commit 9441027

Please sign in to comment.