เปลี่ยนรหัสผ่าน
This commit is contained in:
parent
b04417039e
commit
3272fae13b
2 changed files with 35 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import env from './index'
|
||||
const leave = `${env.API_URI}/leave`
|
||||
const urlFile = `${env.API_URI}/salary`
|
||||
const orgKeycloak = `${env.API_URI}/org/keycloak`
|
||||
|
||||
export default {
|
||||
checkin: () => `${leave}/check-in`,
|
||||
|
|
@ -11,4 +12,6 @@ export default {
|
|||
keycloakPosition: () => `${env.API_URI}/org/profile/keycloak/position`,
|
||||
fileByFile: (name: string, group: string, id: string, fileName: string) =>
|
||||
`${urlFile}/file/${name}/${group}/${id}/${fileName}`,
|
||||
|
||||
resetPassword:`${orgKeycloak}/user/change-password`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,14 @@ import type { Noti } from '@/interface/response/Main'
|
|||
import DialogHeader from '@/components/DialogHeader.vue'
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
const { date2Thai, hideLoader, messageError, dialogRemove, success } = mixin
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
dialogRemove,
|
||||
success,
|
||||
showLoader,
|
||||
} = mixin
|
||||
const router = useRouter()
|
||||
const $q = useQuasar()
|
||||
|
||||
|
|
@ -203,9 +210,30 @@ function onreset() {
|
|||
function closeDialog() {
|
||||
modalReset.value = false
|
||||
oldPassWord.value = ''
|
||||
newPassword.value = ''
|
||||
reNewPassWord.value = ''
|
||||
isPwdOld.value = true
|
||||
isPwdNewOld.value = true
|
||||
isPwdReNewOld.value = true
|
||||
}
|
||||
|
||||
function onSubmit() {}
|
||||
async function onSubmit() {
|
||||
showLoader()
|
||||
await http
|
||||
.post(config.API.resetPassword, {
|
||||
password: newPassword.value,
|
||||
})
|
||||
.then(async (res) => {
|
||||
closeDialog()
|
||||
success($q, `เปลี่ยนรหัสใหม่สำเร็จ`)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e)
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
|
||||
function ruleNewPassWord(val: string) {
|
||||
return new Promise((resolve) => {
|
||||
|
|
@ -505,7 +533,7 @@ onMounted(async () => {
|
|||
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<!-- <div class="col-12">
|
||||
<q-input
|
||||
v-model="oldPassWord"
|
||||
outlined
|
||||
|
|
@ -523,7 +551,7 @@ onMounted(async () => {
|
|||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
v-model="newPassword"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue