feat: 新增 upload hook
This commit is contained in:
@@ -12,6 +12,8 @@ import { bootstrapI18n } from '/admin/i18n'
|
||||
import guard from '/admin/router/guard'
|
||||
import { bootstrapDirectives } from '/admin/directives'
|
||||
import { Language } from 'element-plus/es/locale'
|
||||
import { bootstrapCatchForm } from '/admin/components/catchForm'
|
||||
import http from '/admin/support/http'
|
||||
|
||||
/**
|
||||
* catchadmin
|
||||
@@ -35,7 +37,7 @@ export default class CatchAdmin {
|
||||
* admin boot
|
||||
*/
|
||||
bootstrap(): void {
|
||||
this.useElementPlus().usePinia().useI18n().installDirectives().useRouter().mount()
|
||||
this.useElementPlus().usePinia().useI18n().installDirectives().bootstrapCatchForm().useRouter().mount()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,4 +107,10 @@ export default class CatchAdmin {
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
protected bootstrapCatchForm(): CatchAdmin {
|
||||
bootstrapCatchForm(this.app, {http: http})
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
@@ -100,3 +100,29 @@ export function _window(key: string) {
|
||||
export function getBaseUrl() {
|
||||
return _window('BASE_URL') ? _window('BASE_URL') : env('VITE_BASE_URL')
|
||||
}
|
||||
|
||||
/**
|
||||
* is boolean
|
||||
* @param value
|
||||
* @returns
|
||||
*/
|
||||
export function isBoolean(value: any): boolean {
|
||||
return typeof value === 'boolean'
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param value
|
||||
* @returns
|
||||
*/
|
||||
export function isNumber(value: any): boolean {
|
||||
return typeof value === 'number'
|
||||
}
|
||||
export const getFileExt = (filename: string): string => {
|
||||
return filename.substring(filename.lastIndexOf('.')).toLowerCase()
|
||||
}
|
||||
|
||||
// 获取文件名
|
||||
export const getFilename = (filename: string): string => {
|
||||
return filename.substring(filename.lastIndexOf('/') + 1)
|
||||
}
|
||||
|
Reference in New Issue
Block a user