This commit is contained in:
Iruka 2025-01-20 10:06:06 +08:00
parent 81838da6f0
commit 0ded1e3660

View File

@ -67,6 +67,8 @@
</template>
<script setup>
import { getCurrentInstance } from 'vue';
const { proxy } = getCurrentInstance();
import {
ref,
watch,
@ -179,7 +181,7 @@
//
function forgotPassword() {
this.$toast("忘记密码,请联系管理员");
proxy.$toast("忘记密码,请联系管理员");
}
const codeBtnText = ref('获取验证码');
@ -192,7 +194,7 @@
}
//
if (!checkTelephone(loginForm.value.phone)) {
this.$toast("请输入正确手机号!");
proxy.$toast("请输入正确手机号!");
return
}
codeBtnDisabled.value = true;
@ -203,7 +205,7 @@
getCodePhone(loginForm.value.phone).then(res => {
uni.hideLoading()
if (res.smsResponse) {
this.$toast("短信已发送");
proxy.$toast("短信已发送");
loginForm.value.uuid = res.uuid
codeBtnTimer.value = 60
setCodeTimer();
@ -288,7 +290,7 @@
loginSuccess()
})
.catch(error => {
this.$toast(error);
proxy.$toast(error);
})
.finally(() => {})
}
@ -303,7 +305,7 @@
if (result.code == 200) {
toIndex(result.user.userId);
} else {
this.$toast(result.msg);
proxy.$toast(result.msg);
}
})
//
@ -311,7 +313,7 @@
.dispatch("getUserRoles")
.then(res => {})
.catch(error => {
this.$toast("获取用户权限失败");
proxy.$toast("获取用户权限失败");
})
.finally(() => {})
}