This commit is contained in:
ktianc 2022-10-09 21:44:32 +08:00
parent 5f8dc3c361
commit 5ffcbf84a3

View File

@ -3,8 +3,7 @@ import { reactive, unref, ref, watch } from 'vue'
import { Form } from '@/components/Form' import { Form } from '@/components/Form'
import { ElButton, ElCheckbox, ElLink } from 'element-plus' import { ElButton, ElCheckbox, ElLink } from 'element-plus'
import { useForm } from '@/hooks/web/useForm' import { useForm } from '@/hooks/web/useForm'
import { getRoleMenusApi } from '@/api/login' import { postCurrentUserResetPassword } from '@/api/vadmin/auth/user'
import { useAuthStoreWithOut } from '@/store/modules/auth'
import { usePermissionStore } from '@/store/modules/permission' import { usePermissionStore } from '@/store/modules/permission'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import type { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router' import type { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router'
@ -26,7 +25,7 @@ const permissionStore = usePermissionStore()
const { addRoute, push, currentRoute } = useRouter() const { addRoute, push, currentRoute } = useRouter()
const rules = { const rules = {
password_one: [required()], password: [required()],
password_two: [required()] password_two: [required()]
} }
@ -38,7 +37,7 @@ const schema = reactive<FormSchema[]>([
} }
}, },
{ {
field: 'password_one', field: 'password',
label: '新密码', label: '新密码',
component: 'InputPassword', component: 'InputPassword',
colProps: { colProps: {
@ -96,10 +95,8 @@ const save = async () => {
loading.value = true loading.value = true
const { getFormData } = methods const { getFormData } = methods
const formData = await getFormData<UserLoginType>() const formData = await getFormData<UserLoginType>()
try { try {
const authStore = useAuthStoreWithOut() const res = postCurrentUserResetPassword(formData)
const res = await authStore.login(formData)
if (res) { if (res) {
// 使 // 使
getMenu() getMenu()