上传文件
This commit is contained in:
@@ -59,16 +59,19 @@ export function getValue(key: string): any{
|
||||
* @param name 图片名字
|
||||
*/
|
||||
|
||||
export function provenimg(name: string): boolean{
|
||||
export function provenimg(file: any): boolean | void{
|
||||
const type = ['png', 'jpg'];
|
||||
const ntypearr = name.split('.');
|
||||
const ntypearr = file.name.split('.');
|
||||
const ntype = ntypearr[ntypearr.length - 1];
|
||||
console.log(ntype)
|
||||
let istype = false
|
||||
for(const i in type){
|
||||
if(type[i] == ntype){
|
||||
return true;
|
||||
istype = true
|
||||
}
|
||||
}
|
||||
return false;
|
||||
console.log(istype)
|
||||
return istype;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,9 +79,9 @@ export function provenimg(name: string): boolean{
|
||||
* @param name 图片名字
|
||||
*/
|
||||
|
||||
export function provenvideo(name: string): boolean{
|
||||
export function provenvideo(file: any): boolean{
|
||||
const type = ['flv', 'mp4', 'wmv', 'mov', 'avi'];
|
||||
const ntypearr = name.split('.');
|
||||
const ntypearr = file.name.split('.');
|
||||
const ntype = ntypearr[ntypearr.length - 1];
|
||||
for(const i in type){
|
||||
if(type[i] == ntype){
|
||||
|
||||
Reference in New Issue
Block a user