Skip to content

Commit

Permalink
chore: change max size of image
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Nov 26, 2021
1 parent 9af9319 commit 474196e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/api/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from "axios";
// 创建axios实例
const service = axios.create({
baseURL: "",
timeout: 10 * 1000, // 请求超时时间
timeout: 30 * 1000, // 请求超时时间
});

service.interceptors.request.use(
Expand Down
12 changes: 6 additions & 6 deletions src/assets/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -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')
Expand All @@ -391,4 +391,4 @@ export function removeLeft(str) {
.map(item => item.slice(minSpaceNum))
.join('\n')
return newStr
}
}

0 comments on commit 474196e

Please sign in to comment.