This commit is contained in:
Vanessa 2023-04-19 11:28:26 +08:00
parent a18e3a585c
commit 8c19d17946
7 changed files with 15 additions and 16 deletions

View file

@ -10,19 +10,19 @@ import {showMessage} from "../dialog/message";
export const isSYProtocol = (url: string) => {
return /^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(url);
}
};
export const getIdFromSYProtocol = (url: string) => {
return url.substring(16, 16 + 22);
}
};
/* redirect to auth page */
export const redirectToCheckAuth = (to: string = window.location.href) => {
const url = new URL(window.location.origin);
url.pathname = '/check-auth';
url.searchParams.set('to', to);
url.pathname = "/check-auth";
url.searchParams.set("to", to);
window.location.href = url.href;
}
};
export const addBaseURL = () => {
let baseURLElement = document.getElementById("baseURL");