|
@@ -9,7 +9,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="UpdateUserPwd">
|
|
|
-import { reactive } from 'vue'
|
|
|
+import { reactive, watch } from 'vue'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
|
import useVModel from '@/hooks/useVModel'
|
|
@@ -33,11 +33,18 @@ const mainStore = useMainStore()
|
|
|
const { formRef, elFormRef } = useForm()
|
|
|
|
|
|
const userModel = reactive<{ name: string; password: string; rePassword?: string }>({
|
|
|
- name: mainStore?.myUserInfo?.name || '',
|
|
|
+ name: '',
|
|
|
password: '',
|
|
|
rePassword: '',
|
|
|
})
|
|
|
|
|
|
+watch(
|
|
|
+ () => mainStore.myUserInfo,
|
|
|
+ () => {
|
|
|
+ userModel.name = mainStore?.myUserInfo?.name || ''
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
const rules: EpFormRules = {
|
|
|
password: [{ required: true, message: '请填写登录密码' }],
|
|
|
rePassword: [
|