fixing response error dialog
This commit is contained in:
parent
87f9c6c068
commit
bc5bae34aa
1 changed files with 12 additions and 2 deletions
|
|
@ -6,12 +6,13 @@ import { useRouter } from 'vue-router'
|
|||
import { useQuasar } from 'quasar'
|
||||
import { useCounterMixin } from '@/stores/mixin'
|
||||
import { setAuthen, authenticated } from '@/plugins/auth'
|
||||
import CustomComponent from '@/components/CustomDialog.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const mixin = useCounterMixin()
|
||||
const $q = useQuasar() //ใช้ noti quasar
|
||||
|
||||
const { showLoader, hideLoader, messageError } = mixin
|
||||
const { showLoader, hideLoader } = mixin
|
||||
|
||||
const username = ref<string>('')
|
||||
const password = ref<string>('')
|
||||
|
|
@ -31,7 +32,16 @@ async function onSubmit() {
|
|||
setAuthen(res.data.result)
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err, 'ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง')
|
||||
$q.dialog({
|
||||
component: CustomComponent,
|
||||
componentProps: {
|
||||
title: `ข้อความแจ้งเตือน`,
|
||||
message: `${err.response.data.message}`,
|
||||
icon: 'warning',
|
||||
color: 'red',
|
||||
onlycancel: true,
|
||||
},
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue