1
李凌
2026-01-20 9a9d832dbd364557e070abcd9a7779a2c6c07ffb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
    <div class="changePassword">
        <fx-header>
            <template #title>
                {{ $t('changeLoginPassword') }}
            </template>
        </fx-header>
        <div class="content">
            <ExInput :label="$t('oldPassword')" :placeholderText="$t('entryPassword')" v-model="oldPassword"
                typeText="password" />
            <ExInput :label="$t('newPassword')" :placeholderText="$t('entryPassword')" :tips="$t('setPasswordTips')"
                v-model="newPassword" typeText="password" />
            <ExInput :label="$t('sureNewPassword')" :placeholderText="$t('entryPassword')" :tips="$t('setPasswordTips')"
                v-model="rePassword" typeText="password" />
            <van-button class="w-full" style="margin-top:10px;" type="primary" @click="submit">{{ $t('sure') }}
            </van-button>
        </div>
    </div>
</template>
 
<script setup>
import ExInput from "@/components/ex-input/index.vue";
import { _changePassword } from '@/service/user.api.js'
import { ref } from "vue";
import { showToast } from "vant";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
const { t } = useI18n()
const router = useRouter()
 
const oldPassword = ref('')
const newPassword = ref('')
const rePassword = ref('')
 
const submit = () => {
    _changePassword({
        old_password: oldPassword.value,
        password: newPassword.value,
        re_password: rePassword.value,
    }).then((res) => {
        showToast(t('changeSuccess'))
        setTimeout(() => {
            router.push('/my/index')
        }, 1000);
    })
}
</script>
 
<style lang="scss" scoped>
.changePassword {
    width: 100%;
    box-sizing: border-box;
}
 
.line {
    width: 100%;
    height: 2px;
    background: $light-grey;
}
 
.content {
    padding: 16px;
    font-size: 13px;
}
 
.hightLight {
    background: $btn_main;
    color: $text_color;
}
</style>