ใช้ axios
This commit is contained in:
parent
bdd055b8ae
commit
b5e182e0e2
1 changed files with 14 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import { useQuasar } from 'quasar'
|
|||
import { useCounterMixin } from '@/stores/mixin'
|
||||
import { setAuthen, authenticated, setAuthenCheckin } from '@/plugins/auth'
|
||||
import CustomComponent from '@/components/CustomDialog.vue'
|
||||
|
||||
import env from '@/api/index'
|
||||
|
||||
const router = useRouter()
|
||||
|
|
@ -22,8 +23,8 @@ const { showLoader, hideLoader, messageError } = mixin
|
|||
const username = ref<string>('')
|
||||
async function onSubmit() {
|
||||
showLoader()
|
||||
http
|
||||
.post(config.API.resetPassword, {
|
||||
await axios
|
||||
.post(`${env.API_URI}/org/keycloak/user/reset-password`, {
|
||||
username: username.value,
|
||||
})
|
||||
.then((res) => {
|
||||
|
|
@ -34,8 +35,17 @@ async function onSubmit() {
|
|||
isFalse.value = true
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
.catch((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