|
@@ -26,14 +26,14 @@
|
|
placeholder="请输入内容"
|
|
placeholder="请输入内容"
|
|
></el-input>
|
|
></el-input>
|
|
</div>
|
|
</div>
|
|
- <el-upload
|
|
|
|
|
|
+ <!-- <el-upload
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
action="https://jsonplaceholder.typicode.com/posts/"
|
|
action="https://jsonplaceholder.typicode.com/posts/"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:before-upload="beforeAvatarUpload"
|
|
:before-upload="beforeAvatarUpload"
|
|
>
|
|
>
|
|
<i class="el-icon-link"></i>
|
|
<i class="el-icon-link"></i>
|
|
- </el-upload>
|
|
|
|
|
|
+ </el-upload> -->
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
<li>
|
|
<li>
|
|
@@ -184,7 +184,7 @@ export default {
|
|
if (val.length > 0 && !isNaN(Number(val))) {
|
|
if (val.length > 0 && !isNaN(Number(val))) {
|
|
if (val > 360) {
|
|
if (val > 360) {
|
|
val = 360;
|
|
val = 360;
|
|
- }
|
|
|
|
|
|
+ }
|
|
if (val < -360) {
|
|
if (val < -360) {
|
|
val = -360;
|
|
val = -360;
|
|
}
|
|
}
|
|
@@ -197,7 +197,7 @@ export default {
|
|
fileReader.readAsDataURL(file); //读取图片
|
|
fileReader.readAsDataURL(file); //读取图片
|
|
const ftype = file.type;
|
|
const ftype = file.type;
|
|
const fname = file.name;
|
|
const fname = file.name;
|
|
- const uploadKey = file.uid;
|
|
|
|
|
|
+ const uploadKey = fname;
|
|
const imgType = ftype.split(".")[ftype.length - 1];
|
|
const imgType = ftype.split(".")[ftype.length - 1];
|
|
fileReader.addEventListener("load", function () {
|
|
fileReader.addEventListener("load", function () {
|
|
// 读取完成
|
|
// 读取完成
|
|
@@ -225,14 +225,14 @@ export default {
|
|
/* method */
|
|
/* method */
|
|
"POST",
|
|
"POST",
|
|
/* target url */
|
|
/* target url */
|
|
- imgServeUpload + uploadKey + "." + imgType
|
|
|
|
|
|
+ imgServeUpload + uploadKey
|
|
);
|
|
);
|
|
xhr.send(reader.result);
|
|
xhr.send(reader.result);
|
|
xhr.onreadystatechange = function () {
|
|
xhr.onreadystatechange = function () {
|
|
if (xhr.readyState == 4) {
|
|
if (xhr.readyState == 4) {
|
|
if (xhr.status == 200) {
|
|
if (xhr.status == 200) {
|
|
- that.url = uploadKey + "." + imgType;
|
|
|
|
- bus.$emit("updateStyle", "url", uploadKey + "." + imgType);
|
|
|
|
|
|
+ that.url = uploadKey
|
|
|
|
+ bus.$emit("updateStyle", "url", uploadKey );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|