mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
chore: change max size of image
This commit is contained in:
parent
9af9319d39
commit
474196e587
@ -3,7 +3,7 @@ import axios from "axios";
|
|||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: "",
|
baseURL: "",
|
||||||
timeout: 10 * 1000, // 请求超时时间
|
timeout: 30 * 1000, // 请求超时时间
|
||||||
});
|
});
|
||||||
|
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
|
@ -350,9 +350,9 @@ export function checkImage(file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check file size
|
// check file size
|
||||||
const maxSize = 5;
|
const maxSize = 10;
|
||||||
const isLt5M = file.size / 1024 / 1024 <= maxSize;
|
const valid = file.size / 1024 / 1024 <= maxSize;
|
||||||
if (!isLt5M) {
|
if (!valid) {
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
msg: `由于公众号限制,图片大小不能超过 ${maxSize}M`,
|
msg: `由于公众号限制,图片大小不能超过 ${maxSize}M`,
|
||||||
@ -377,8 +377,8 @@ function getElementStyles(element, excludes = ["width", "height"]) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 移除左边多余空格
|
* 移除左边多余空格
|
||||||
* @param {*} str
|
* @param {*} str
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function removeLeft(str) {
|
export function removeLeft(str) {
|
||||||
const lines = str.split('\n')
|
const lines = str.split('\n')
|
||||||
@ -391,4 +391,4 @@ export function removeLeft(str) {
|
|||||||
.map(item => item.slice(minSpaceNum))
|
.map(item => item.slice(minSpaceNum))
|
||||||
.join('\n')
|
.join('\n')
|
||||||
return newStr
|
return newStr
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user