xbx #134

Merged
theluyuan merged 34 commits from xbx into master 2020-11-18 06:56:15 +00:00
2 changed files with 14 additions and 2 deletions
Showing only changes of commit 6e19aa583d - Show all commits

View File

@ -1,3 +1,4 @@
/** /**
* Base64 * Base64
*/ */
@ -79,10 +80,21 @@ export function provenimg(file: any): boolean | void{
* @param name * @param name
*/ */
export function provenvideo(file: any): boolean{ export function provenvideo(file: any, isvideo?: boolean): boolean{
const type = ['flv', 'mp4', 'wmv', 'mov', 'avi']; const type = ['flv', 'mp4', 'wmv', 'mov', 'avi'];
const ntypearr = file.name.split('.'); const ntypearr = file.name.split('.');
const ntype = ntypearr[ntypearr.length - 1]; const ntype = ntypearr[ntypearr.length - 1];
if(isvideo){
const size = 500 * 1024 * 1024;
if(file.size > size){
return false;
}
}else{
const size = 100 * 1024 * 1024;
if(file.size > size){
return false;
}
}
for(const i in type){ for(const i in type){
if(type[i] == ntype){ if(type[i] == ntype){
return true; return true;

View File

@ -330,7 +330,7 @@ export default defineComponent({
} }
} }
function video(file: any){ function video(file: any){
return provenvideo(file) return provenvideo(file, true)
} }
function imgs(file: any){ function imgs(file: any){
return provenimg(file) return provenimg(file)