更新
This commit is contained in:
parent
5f8dc3c361
commit
5ffcbf84a3
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user