update
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
const isDev = process.env.NODE_ENV === "development";
|
||||
const BASE_NAME = isDev ? '' : '/root/perler-beads';
|
||||
export const isDev = process.env.NODE_ENV === "development";
|
||||
|
||||
const BASE_NAME = isDev ? '' : '/root/center';
|
||||
|
||||
export const basename = BASE_NAME;
|
||||
|
||||
export const wrapBasename = (path: string) => {
|
||||
const hasEnd = path.endsWith('/')
|
||||
let _basename = basename;
|
||||
@@ -14,5 +14,13 @@ export const wrapBasename = (path: string) => {
|
||||
if (isDev) {
|
||||
return _basename
|
||||
}
|
||||
return _basename + '.html';
|
||||
return !hasEnd ? _basename + '/' : _basename;
|
||||
}
|
||||
export const openLink = (path: string, target: string = '_self') => {
|
||||
if (path.startsWith('http://') || path.startsWith('https://')) {
|
||||
window.open(path, target);
|
||||
return;
|
||||
}
|
||||
const url = wrapBasename(path);
|
||||
window.open(url, target);
|
||||
}
|
||||
Reference in New Issue
Block a user