chore: add some notes

This commit is contained in:
vben
2020-11-18 22:41:59 +08:00
parent 815250ed34
commit 46e0875374
87 changed files with 926 additions and 728 deletions

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -1,4 +1,5 @@
const projectName = import.meta.env.VITE_GLOB_APP_TITLE;
export function warn(message: string) {
console.warn(`[${projectName} warn]:${message}`);
}