|
@@ -1,6 +1,7 @@
|
|
|
import { GLOBAL } from '@/static/Global.js';
|
|
|
import JsFn from '@/utils/js-fn.js';
|
|
|
import API from '@/api/index.js';
|
|
|
+const blobPath = ['audio', 'doc', 'exam','image', 'item', 'notice', 'other', 'paper', 'res', 'student', 'survey', 'temp', 'thum', 'video', 'vote']
|
|
|
const { BlobServiceClient, BlobClient } = require("@azure/storage-blob")
|
|
|
//获取文件后缀和类型
|
|
|
function getExAndType(fileName) {
|
|
@@ -193,6 +194,10 @@ export default class BlobTool {
|
|
|
* @returns {object} {url, name,size,createTime,extension,type}
|
|
|
*/
|
|
|
upload(file, path, option, checkSize = true, handleSize = true) {
|
|
|
+ console.log(blobPath.includes(path))
|
|
|
+ if (!blobPath.includes(path)) {
|
|
|
+ throw new Error('上传路径不合法,请检查上传路径:' + path)
|
|
|
+ }
|
|
|
return new Promise(async (r, j) => {
|
|
|
//检查容器空间大小
|
|
|
if (checkSize) {
|