mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
style: optimize styles for change password page
This commit is contained in:
parent
c008f33bc3
commit
e7fd29b9cb
@ -91,7 +91,7 @@ onMounted(() => {
|
|||||||
httpGet('/api/user/profile').then(res => {
|
httpGet('/api/user/profile').then(res => {
|
||||||
form.value = res.data
|
form.value = res.data
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
ElMessage.error('获取用户信息失败')
|
ElMessage.error({message:'获取用户信息失败', appendTo: '#user-info'})
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ const save = function () {
|
|||||||
httpPost('/api/user/profile/update', form.value).then(() => {
|
httpPost('/api/user/profile/update', form.value).then(() => {
|
||||||
ElMessage.success({
|
ElMessage.success({
|
||||||
message: '更新成功',
|
message: '更新成功',
|
||||||
appendTo: document.getElementById('user-info'),
|
appendTo: '#user-info',
|
||||||
onClose: () => emits('hide', false)
|
onClose: () => emits('hide', false)
|
||||||
})
|
})
|
||||||
// 更新用户数据
|
// 更新用户数据
|
||||||
|
@ -32,12 +32,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
|
|
||||||
import {defineEmits, defineProps, onMounted, ref} from "vue"
|
import {defineEmits, defineProps, onMounted, ref} from "vue"
|
||||||
import {httpGet, httpPost} from "@/utils/http";
|
import {httpPost} from "@/utils/http";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
});
|
});
|
||||||
@ -48,24 +47,24 @@ onMounted(() => {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emits = defineEmits(['hide']);
|
const emits = defineEmits(['hide','logout']);
|
||||||
const save = function () {
|
const save = function () {
|
||||||
if (form.value['password'].length < 8) {
|
if (!form.value['password'] || form.value['password'].length < 8) {
|
||||||
return ElMessage.error('密码的长度为8-16个字符');
|
return ElMessage.error({message:"密码的长度为8-16个字符", appendTo:"#password-form"});
|
||||||
}
|
}
|
||||||
if (form.value['repass'] !== form.value['password']) {
|
if (form.value['repass'] !== form.value['password']) {
|
||||||
return ElMessage.error('两次输入密码不一致');
|
return ElMessage.error({message:'两次输入密码不一致', appendTo:'#password-form'});
|
||||||
}
|
}
|
||||||
httpPost('/api/user/password', form.value).then(() => {
|
httpPost('/api/user/password', form.value).then(() => {
|
||||||
ElMessage.success({
|
ElMessage.success({
|
||||||
message: '更新成功',
|
message: '更新成功',
|
||||||
appendTo: document.getElementById('password-form'),
|
appendTo: '#password-form',
|
||||||
onClose: () => emits('logout', false)
|
onClose: () => emits('logout', false)
|
||||||
})
|
})
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
ElMessage.error({
|
ElMessage.error({
|
||||||
message: '更新失败,'+e.message,
|
message: '更新失败,'+e.message,
|
||||||
appendTo: document.getElementById('password-form')
|
appendTo: '#password-form'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -77,7 +76,7 @@ const close = function () {
|
|||||||
<style lang="stylus">
|
<style lang="stylus">
|
||||||
.el-dialog {
|
.el-dialog {
|
||||||
--el-dialog-width 90%;
|
--el-dialog-width 90%;
|
||||||
max-width 500px;
|
max-width 650px;
|
||||||
|
|
||||||
.el-dialog__body {
|
.el-dialog__body {
|
||||||
padding-top 10px;
|
padding-top 10px;
|
||||||
|
Loading…
Reference in New Issue
Block a user