This commit is contained in:
GaoHao
2025-01-07 10:42:53 +08:00
parent f7037c0643
commit 0041cc0e15
7 changed files with 192 additions and 45 deletions

View File

@@ -35,8 +35,7 @@
<script setup>
import { reactive } from 'vue';
import { onLoad} from '@dcloudio/uni-app'
import http from '@/http/http.js';
import {setSendMsg,registerCode} from '@/api/login/login.js';
import {setSendMsg,forgetPwd} from '@/api/login/login.js';
let data = reactive({
code: '',
mobile: '',
@@ -116,7 +115,7 @@
/**
* 注册
*/
function reset() {
async function reset() {
if (!data.mobile) {
uni.showToast({
@@ -141,33 +140,31 @@
uni.showLoading({
title: '正在修改密码中...'
})
http.request({
url: 'app/Login/forgetPwd?pwd=' + data.password + '&phone=' + data.mobile + '&msg=' + data.code,
method: 'post'
}).then(
res => {
uni.hideLoading();
if (res.code === 0) {
uni.showToast({
title: '密码找回成功',
icon: 'none'
});
setTimeout(function() {
uni.navigateTo({
url: '/pages/login/login'
});
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
let res = await forgetPwd({
pwd: data.password,
phone: data.mobile,
msg: data.code,
})
uni.hideLoading();
if (res.code === 0) {
uni.showToast({
title: '密码找回成功',
icon: 'none'
});
setTimeout(function() {
uni.navigateTo({
url: '/pages/login/login'
});
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
}
}