Skip to content

Commit

Permalink
fix: fixed account logout
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Sep 6, 2023
1 parent c979b8e commit 3a16d1c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/AccountLoginModal.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const rules: FormRules = {
async function addAccount() {
await formRef.value?.validate()
if (accountStore.accounts.some(a => a.username === form.username)) {
if (accountStore.accounts?.some(a => a.username === form.username)) {
ms.warning('账号已存在,无需添加')
return
}
Expand Down
2 changes: 1 addition & 1 deletion server/api/cx/courses/index.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineEventHandler(async (event) => {
},
})

const toCreate = courses.filter(c => !exists.some(e => e.id === `${c.courseId}_${c.classId}`))
const toCreate = courses.filter(c => !exists?.some(e => e.id === `${c.courseId}_${c.classId}`))

if (toCreate.length > 0) {
await event.context.prisma.course.createMany({
Expand Down
2 changes: 1 addition & 1 deletion server/api/cx/logout.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CXMap } from '~~/server/protocol/cx'
import { IMConnectionMap } from '~~/server/protocol/easemob'

export default defineEventHandler(async (event) => {
const uid = event.context.cx.user?.uid
const uid = event.context.cx?.user?.uid

await event.context.cx?.logout()

Expand Down
2 changes: 1 addition & 1 deletion server/middleware/2.cx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare module 'h3' {
}
}

const exclude = ['/api/cx/login', '/api/cx/logout', '/api/cx/accounts']
const exclude = ['/api/cx/login', '/api/cx/accounts']

export default eventHandler(async (event) => {
const { context, node: { req } } = event
Expand Down

1 comment on commit 3a16d1c

@vercel
Copy link

@vercel vercel bot commented on 3a16d1c Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chaoxing-sign – ./

cx-sign.vercel.app
chaoxing-sign-git-main-kuizuo1.vercel.app
chaoxing-sign-kuizuo1.vercel.app

Please sign in to comment.