From 474196e587b89201c4612f9f9c4ce5cb34570783 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Fri, 26 Nov 2021 23:42:56 +0800 Subject: [PATCH] chore: change max size of image --- src/api/fetch.js | 2 +- src/assets/scripts/util.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/fetch.js b/src/api/fetch.js index 0616e94..c7312d4 100644 --- a/src/api/fetch.js +++ b/src/api/fetch.js @@ -3,7 +3,7 @@ import axios from "axios"; // 创建axios实例 const service = axios.create({ baseURL: "", - timeout: 10 * 1000, // 请求超时时间 + timeout: 30 * 1000, // 请求超时时间 }); service.interceptors.request.use( diff --git a/src/assets/scripts/util.js b/src/assets/scripts/util.js index 7d5340d..4cadbdf 100644 --- a/src/assets/scripts/util.js +++ b/src/assets/scripts/util.js @@ -350,9 +350,9 @@ export function checkImage(file) { } // check file size - const maxSize = 5; - const isLt5M = file.size / 1024 / 1024 <= maxSize; - if (!isLt5M) { + const maxSize = 10; + const valid = file.size / 1024 / 1024 <= maxSize; + if (!valid) { return { ok: false, msg: `由于公众号限制,图片大小不能超过 ${maxSize}M`, @@ -377,8 +377,8 @@ function getElementStyles(element, excludes = ["width", "height"]) { /** * 移除左边多余空格 - * @param {*} str - * @returns + * @param {*} str + * @returns */ export function removeLeft(str) { const lines = str.split('\n') @@ -391,4 +391,4 @@ export function removeLeft(str) { .map(item => item.slice(minSpaceNum)) .join('\n') return newStr -} \ No newline at end of file +}