解析blob响应是否登录失效

This commit is contained in:
RuoYi
2021-10-25 09:49:13 +08:00
parent d0a5c25b5d
commit 3901695a6f
3 changed files with 35 additions and 9 deletions

View File

@@ -214,3 +214,14 @@ export function tansParams(params) {
}
return result
}
// 验证是否为blob格式
export async function blobValidate(data) {
try {
const text = await data.text();
JSON.parse(text);
return false;
} catch (error) {
return true;
}
}