mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 14:47:28 +08:00
chore: add some notes
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { userStore } from '/@/store/modules/user';
|
||||
// import { permissionStore } from '@/store/modules/permission';
|
||||
// import { RoleEnum } from '@/enums/roleEnum';
|
||||
|
||||
/**
|
||||
* @description: 获取token
|
||||
* @description: Get token
|
||||
* @return jwt token
|
||||
*/
|
||||
export function getToken(): string {
|
||||
return userStore.getTokenState;
|
||||
|
@@ -4,6 +4,6 @@
|
||||
export function triggerWindowResize() {
|
||||
const event = document.createEvent('HTMLEvents');
|
||||
event.initEvent('resize', true, true);
|
||||
(event as any).eventType = 'message';
|
||||
(event as ChangeEvent).eventType = 'message';
|
||||
window.dispatchEvent(event);
|
||||
}
|
||||
|
@@ -50,10 +50,6 @@ export function isArray(val: unknown): val is Array<any> {
|
||||
return val && Array.isArray(val);
|
||||
}
|
||||
|
||||
export const isClient = () => {
|
||||
return typeof window !== 'undefined';
|
||||
};
|
||||
|
||||
export const isWindow = (val: any): val is Window => {
|
||||
return typeof window !== 'undefined' && is(val, 'Window');
|
||||
};
|
||||
@@ -64,6 +60,8 @@ export const isElement = (val: unknown): val is Element => {
|
||||
|
||||
export const isServer = typeof window === 'undefined';
|
||||
|
||||
export const isClient = typeof window !== 'undefined';
|
||||
|
||||
export function isImageDom(o: Element) {
|
||||
return o && ['IMAGE', 'IMG'].includes(o.tagName);
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
const projectName = import.meta.env.VITE_GLOB_APP_TITLE;
|
||||
|
||||
export function warn(message: string) {
|
||||
console.warn(`[${projectName} warn]:${message}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user