Browse Source

上传插件图片格式修改

min
song 3 years ago
parent
commit
d0a2de9d07
  1. 14
      src/views/index-list/add-plugin.vue

14
src/views/index-list/add-plugin.vue

@ -7,7 +7,7 @@
{{ form.id }} {{ form.id }}
<i class="el-icon-document-copy cursor-pointer ml-2" @click="copy(form.id)"></i> <i class="el-icon-document-copy cursor-pointer ml-2" @click="copy(form.id)"></i>
</div> </div>
<el-button type="success" plain size="mini" v-else>点击生成插件id</el-button> <el-button type="success" plain size="mini" @click="handelPluginId" v-else>点击生成插件id</el-button>
</el-form-item> </el-form-item>
<el-form-item prop="name"> <el-form-item prop="name">
<template v-slot:label> <template v-slot:label>
@ -175,7 +175,7 @@ async function handelPluginId() {
} }
} }
// handelPluginId() handelPluginId();
// //
async function copy(Msg) { async function copy(Msg) {
@ -228,16 +228,16 @@ function handleAvatarSuccess(res) {
} }
function beforeAvatarUpload(file) { function beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg'; // const isJPG = file.type === 'image/jpeg';
const isLt2M = file.size / 1024 / 1024 < 2; const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) { // if (!isJPG) {
ElMessage.error('上传头像图片只能是 JPG 格式!'); // ElMessage.error(' JPG !');
} // }
if (!isLt2M) { if (!isLt2M) {
ElMessage.error('上传头像图片大小不能超过 2MB!'); ElMessage.error('上传头像图片大小不能超过 2MB!');
} }
return isJPG && isLt2M; return isLt2M;
} }
// //

Loading…
Cancel
Save