mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-07-08 17:01:55 +08:00
feat: add ANNOUNCEMENT (#357)
This commit is contained in:
@@ -4,7 +4,7 @@ import axios from 'axios'
|
||||
const API_BASE = import.meta.env.VITE_API_BASE || "";
|
||||
const {
|
||||
loading, auth, jwt, settings, openSettings,
|
||||
userOpenSettings, userSettings,
|
||||
userOpenSettings, userSettings, announcement,
|
||||
showAuth, adminAuth, showAdminAuth, userJwt
|
||||
} = useGlobalState();
|
||||
|
||||
@@ -56,6 +56,7 @@ const getOpenSettings = async (message) => {
|
||||
const res = await api.fetch("/open_api/settings");
|
||||
const domainLabels = res["domainLabels"] || [];
|
||||
Object.assign(openSettings.value, {
|
||||
...res,
|
||||
title: res["title"] || "",
|
||||
prefix: res["prefix"] || "",
|
||||
minAddressLen: res["minAddressLen"] || 1,
|
||||
@@ -81,6 +82,14 @@ const getOpenSettings = async (message) => {
|
||||
if (openSettings.value.needAuth) {
|
||||
showAuth.value = true;
|
||||
}
|
||||
if (openSettings.value.announcement && openSettings.value.announcement != announcement.value) {
|
||||
announcement.value = openSettings.value.announcement;
|
||||
message.info(announcement.value, {
|
||||
showIcon: false,
|
||||
duration: 0,
|
||||
closable: true
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
message.error(error.message || "error");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user