diff --git a/src/pages/EmailVerify.vue b/src/pages/EmailVerify.vue
new file mode 100644
index 0000000..906356a
--- /dev/null
+++ b/src/pages/EmailVerify.vue
@@ -0,0 +1,61 @@
+
+
+
邮箱验证
+
{{ textDisplay }}
+
返回登录
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/Login.vue b/src/pages/Login.vue
index 18e369c..3cc6f57 100644
--- a/src/pages/Login.vue
+++ b/src/pages/Login.vue
@@ -134,7 +134,7 @@ const handleRegister = async () => {
return;
}
store.commit('stopLoading');
- swal.window('info', '邮箱验证链接发送成功!', '请前往邮箱查看', '好的', 'ok');
+ swal.window('info', '邮箱验证链接发送成功!', '请前往邮箱查看', '好的');
}
onMounted(() => {
diff --git a/src/router/index.js b/src/router/index.js
index e5210bb..99bc434 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -36,9 +36,11 @@ import SubmitBlog_page from "../pages/blogPages/submitBlogPages/SubmitBlog_page.
import swal from "../utils/sweetalert.js";
import GunGame_page from "../pages/demoPages/gunGame/gunGame_page.vue";
import api from "../utils/axios.js";
+import EmailVerify from "../pages/EmailVerify.vue";
const routes = [
- {path: '/404',
+ {
+ path: '/404',
name: '404',
component: NotFound,
meta: {title: '404'}
@@ -52,6 +54,11 @@ const routes = [
name: 'Login',
component: Login,
meta: {title: '登录'}
+ }, {
+ path: '/verify',
+ name: 'EmailVerify',
+ component: EmailVerify,
+ meta: {title: '注册成功'}
}, {
path: '/blog',
name: 'Blog',
diff --git a/src/utils/sweetalert.js b/src/utils/sweetalert.js
index 18c26de..bb15ac3 100644
--- a/src/utils/sweetalert.js
+++ b/src/utils/sweetalert.js
@@ -19,9 +19,8 @@ const swalInstantiations = {
title: '确认?',
text: '您确定吗?',
icon: 'warning',
- showCancelButton: true,
- confirmButtonText: '删除',
- cancelButtonText: '取消',
+ showCancelButton: false,
+ showConfirmButton: false,
didOpen: (toast) => {
Swal.getPopup().style.marginTop = '0';
toast.addEventListener('mouseenter', Swal.stopTimer);
@@ -34,7 +33,23 @@ const swal = {
swalInstantiations.tip.fire({icon: icon, title: title, text: text})
},
window: (icon, title, text, confirm, cancel) => {
- return swalInstantiations.window.fire({icon: icon, title: title, text: text, confirmButtonText: confirm, cancelButtonText: cancel})
+ const obj = {
+ icon: icon,
+ title: title,
+ text: text
+ };
+ if (confirm?.length > 0) {
+ obj.confirmButtonText = confirm;
+ obj.showConfirmButton = true;
+ }
+ if (cancel?.length > 0) {
+ obj.cancelButtonText = cancel;
+ obj.showCancelButton = true;
+ }
+ if (!cancel?.length > 0 && !confirm?.length > 0 && !text) {
+ obj.text = ' ';
+ }
+ return swalInstantiations.window.fire(obj)
}
}