Skip to content

Commit

Permalink
fix: add route base close #404
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 23, 2021
1 parent 8fb0396 commit 8ad127c
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 51 deletions.
17 changes: 0 additions & 17 deletions build/tsconfig.json

This file was deleted.

6 changes: 0 additions & 6 deletions build/typeing.d.ts

This file was deleted.

15 changes: 0 additions & 15 deletions build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@ export function isReportMode(): boolean {
return process.env.REPORT === 'true';
}

export interface ViteEnv {
VITE_PORT: number;
VITE_USE_MOCK: boolean;
VITE_USE_PWA: boolean;
VITE_PUBLIC_PATH: string;
VITE_PROXY: [string, string][];
VITE_GLOB_APP_TITLE: string;
VITE_GLOB_APP_SHORT_NAME: string;
VITE_USE_CDN: boolean;
VITE_DROP_CONSOLE: boolean;
VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
VITE_LEGACY: boolean;
VITE_USE_IMAGEMIN: boolean;
}

// Read all environment variable configuration files to process.env
export function wrapperEnv(envConf: Recordable): ViteEnv {
const ret: any = {};
Expand Down
1 change: 0 additions & 1 deletion build/vite/plugin/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* https://github.com/anncwb/vite-plugin-html
*/
import type { Plugin } from 'vite';
import type { ViteEnv } from '../../utils';

import html from 'vite-plugin-html';

Expand Down
1 change: 0 additions & 1 deletion build/vite/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Plugin } from 'vite';
import type { ViteEnv } from '../../utils';

import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
Expand Down
1 change: 0 additions & 1 deletion build/vite/plugin/pwa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Zero-config PWA for Vite
* https://github.com/antfu/vite-plugin-pwa
*/
import type { ViteEnv } from '../../utils';

import { VitePWA } from 'vite-plugin-pwa';

Expand Down
2 changes: 1 addition & 1 deletion mock/_util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Interface data format used to return a unified format

export function resultSuccess<T = any>(result: T, { message = 'ok' } = {}) {
export function resultSuccess<T = Recordable>(result: T, { message = 'ok' } = {}) {
return {
code: 0,
result,
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const WHITE_NAME_LIST = [LoginRoute.name, REDIRECT_NAME];

// app router
const router = createRouter({
history: createWebHashHistory(),
history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH),
routes: (basicRoutes as unknown) as RouteRecordRaw[],
strict: true,
scrollBehavior: () => ({ left: 0, top: 0 }),
Expand Down
2 changes: 1 addition & 1 deletion src/settings/projectSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const setting: ProjectConfig = {
settingButtonPosition: SettingButtonPositionEnum.AUTO,

// Permission mode
permissionMode: PermissionModeEnum.BACK,
permissionMode: PermissionModeEnum.ROLE,

// Permission-related cache is stored in sessionStorage or localStorage
permissionCacheType: CacheTypeEnum.LOCAL,
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"src/**/*.vue",
"types/**/*.d.ts",
"types/**/*.ts",
"build/**/*.ts",
"build/**/*.d.ts",
"mock/**/*.ts"
],
"exclude": ["node_modules", "dist", "**/*.js"]
Expand Down
7 changes: 0 additions & 7 deletions types/event.d.ts

This file was deleted.

25 changes: 25 additions & 0 deletions types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,28 @@ declare type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElR
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;

type IsSame<A, B> = A | B extends A & B ? true : false;

declare interface ChangeEvent extends Event {
target: HTMLInputElement;
}

declare interface WheelEvent {
path?: EventTarget[];
}

type ImportMetaEnv = ViteEnv;

declare interface ViteEnv {
VITE_PORT: number;
VITE_USE_MOCK: boolean;
VITE_USE_PWA: boolean;
VITE_PUBLIC_PATH: string;
VITE_PROXY: [string, string][];
VITE_GLOB_APP_TITLE: string;
VITE_GLOB_APP_SHORT_NAME: string;
VITE_USE_CDN: boolean;
VITE_DROP_CONSOLE: boolean;
VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
VITE_LEGACY: boolean;
VITE_USE_IMAGEMIN: boolean;
}

0 comments on commit 8ad127c

Please sign in to comment.