mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-06 07:31:48 +01:00
🚨
This commit is contained in:
parent
a18e3a585c
commit
8c19d17946
7 changed files with 15 additions and 16 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue