Commit cb0401d7 by 杨北旺

上传图片格式处理

1 parent 9dfeb43f
...@@ -105,7 +105,8 @@ export default { ...@@ -105,7 +105,8 @@ export default {
// 上传图片 // 上传图片
uploadImage(file) { uploadImage(file) {
const imgFile = file.content const imgFile = file.content
console.log(file.file.name); //两种写法
// 1.substring字符串截取 2.split方法截取 比如:let temp = file.name.split('.');temp = temp[temp.length-1]
let fileName = file.file.name let fileName = file.file.name
let index = fileName.lastIndexOf(".") let index = fileName.lastIndexOf(".")
fileName = fileName.substring(index+1,fileName.length); fileName = fileName.substring(index+1,fileName.length);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!