pull/265/head
xiaojunnuo 2024-12-01 03:09:29 +08:00
parent 2bc3456400
commit 15740a6d8a
3 changed files with 8 additions and 5 deletions

View File

@ -11,11 +11,11 @@ const props = defineProps<{
}>();
const loading = ref(false);
function onClick() {
async function onClick() {
loading.value = true;
try {
if (props.click) {
props.click();
await props.click();
}
} finally {
loading.value = false;

View File

@ -79,16 +79,19 @@ defineOptions({
});
const testMobile = ref("");
function testSendSms() {
async function testSendSms() {
if (!testMobile.value) {
notification.error({
message: "请输入测试手机号"
});
return;
}
api.TestSms({
await api.TestSms({
mobile: testMobile.value
});
notification.success({
message: "发送成功"
});
}
const formState = reactive<Partial<SysSettings>>({
public: {

View File

@ -56,7 +56,7 @@ export class CodeService {
/**
*/
async sendSmsCode(phoneCode = '86', mobile: string, randomStr: string) {
if (mobile != null) {
if (!mobile) {
throw new Error('手机号不能为空');
}
if (!randomStr) {