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); const loading = ref(false);
function onClick() { async function onClick() {
loading.value = true; loading.value = true;
try { try {
if (props.click) { if (props.click) {
props.click(); await props.click();
} }
} finally { } finally {
loading.value = false; loading.value = false;

View File

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

View File

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