mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
feat: 上传文件大小限制
This commit is contained in:
parent
4205b68b8c
commit
d541397594
@ -238,13 +238,14 @@ class File extends AbstractModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
$setting = Base::setting('system');
|
||||||
$path = 'uploads/tmp/' . date("Ym") . '/';
|
$path = 'uploads/tmp/' . date("Ym") . '/';
|
||||||
$data = Base::upload([
|
$data = Base::upload([
|
||||||
"file" => Request::file('files'),
|
"file" => Request::file('files'),
|
||||||
"type" => 'more',
|
"type" => 'more',
|
||||||
"autoThumb" => false,
|
"autoThumb" => false,
|
||||||
"path" => $path,
|
"path" => $path,
|
||||||
"size" => 100 * 1024
|
"size" => ($setting['file_upload_limit'] ?: 0) * 1024
|
||||||
]);
|
]);
|
||||||
if (Base::isError($data)) {
|
if (Base::isError($data)) {
|
||||||
throw new ApiException($data['msg']);
|
throw new ApiException($data['msg']);
|
||||||
|
|||||||
@ -611,12 +611,13 @@ class WebSocketDialog extends AbstractModel
|
|||||||
Base::makeDir(public_path($path));
|
Base::makeDir(public_path($path));
|
||||||
copy($filePath, public_path($path) . basename($filePath));
|
copy($filePath, public_path($path) . basename($filePath));
|
||||||
} else {
|
} else {
|
||||||
|
$setting = Base::setting('system');
|
||||||
$data = Base::upload([
|
$data = Base::upload([
|
||||||
"file" => $files,
|
"file" => $files,
|
||||||
"type" => 'more',
|
"type" => 'more',
|
||||||
"path" => $path,
|
"path" => $path,
|
||||||
"fileName" => $fileName,
|
"fileName" => $fileName,
|
||||||
"size" => 100 * 1024
|
"size" => ($setting['file_upload_limit'] ?: 0) * 1024
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|||||||
@ -1380,10 +1380,13 @@ APP推送
|
|||||||
通义千问
|
通义千问
|
||||||
模型
|
模型
|
||||||
|
|
||||||
未设置时间
|
未计划
|
||||||
检测到所属的任务列表已被删除,该操作将会还原任务列表,你确定要还原归档吗?
|
检测到所属的任务列表已被删除,该操作将会还原任务列表,你确定要还原归档吗?
|
||||||
打包下载
|
打包下载
|
||||||
你确定要打包下载【(*)】文件吗?
|
你确定要打包下载【(*)】文件吗?
|
||||||
你确定要打包下载(*)等(*)个文件吗?
|
你确定要打包下载(*)等(*)个文件吗?
|
||||||
此文件夹内已有共享文件夹,子文件的共享状态将被取消,是否继续?
|
此文件夹内已有共享文件夹,子文件的共享状态将被取消,是否继续?
|
||||||
文件上传限制
|
文件上传限制
|
||||||
|
包含消息发送的文件
|
||||||
|
特殊设置
|
||||||
|
打包列表
|
||||||
@ -189,6 +189,7 @@
|
|||||||
ref="chatUpload"
|
ref="chatUpload"
|
||||||
class="chat-upload"
|
class="chat-upload"
|
||||||
:dialog-id="dialogId"
|
:dialog-id="dialogId"
|
||||||
|
:maxSize="maxSize"
|
||||||
@on-progress="chatFile('progress', $event)"
|
@on-progress="chatFile('progress', $event)"
|
||||||
@on-success="chatFile('success', $event)"
|
@on-success="chatFile('success', $event)"
|
||||||
@on-error="chatFile('error', $event)"/>
|
@on-error="chatFile('error', $event)"/>
|
||||||
@ -677,6 +678,7 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([
|
...mapState([
|
||||||
|
'systemConfig',
|
||||||
'userIsAdmin',
|
'userIsAdmin',
|
||||||
'taskId',
|
'taskId',
|
||||||
'dialogSearchMsgId',
|
'dialogSearchMsgId',
|
||||||
@ -980,6 +982,13 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return list
|
return list
|
||||||
|
},
|
||||||
|
|
||||||
|
maxSize() {
|
||||||
|
if(this.systemConfig?.file_upload_limit){
|
||||||
|
return this.systemConfig.file_upload_limit * 1024
|
||||||
|
}
|
||||||
|
return 1024000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -813,7 +813,7 @@ export default {
|
|||||||
}];
|
}];
|
||||||
list.push({
|
list.push({
|
||||||
value: -1,
|
value: -1,
|
||||||
label: `${this.$L('未设置时间')} (${allTask.filter(({start_at}) => {return !start_at}).length})`,
|
label: `${this.$L('未计划')} (${allTask.filter(({start_at}) => {return !start_at}).length})`,
|
||||||
children: []
|
children: []
|
||||||
});
|
});
|
||||||
const flows = flowList.map(item1 => {
|
const flows = flowList.map(item1 => {
|
||||||
|
|||||||
@ -503,7 +503,6 @@ export default {
|
|||||||
uploadList: [],
|
uploadList: [],
|
||||||
uploadFormat: [], // 不限制上传文件类型
|
uploadFormat: [], // 不限制上传文件类型
|
||||||
uploadAccept: '',
|
uploadAccept: '',
|
||||||
maxSize: 1024000,
|
|
||||||
|
|
||||||
contextMenuItem: {},
|
contextMenuItem: {},
|
||||||
contextMenuVisible: false,
|
contextMenuVisible: false,
|
||||||
@ -736,7 +735,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userIsAdmin', 'userInfo', 'fileLists', 'wsOpenNum']),
|
...mapState(['systemConfig', 'userIsAdmin', 'userInfo', 'fileLists', 'wsOpenNum']),
|
||||||
|
|
||||||
pid() {
|
pid() {
|
||||||
const {folderId} = this.$route.params;
|
const {folderId} = this.$route.params;
|
||||||
@ -852,6 +851,13 @@ export default {
|
|||||||
|
|
||||||
compressedSownloadDisabled() {
|
compressedSownloadDisabled() {
|
||||||
return this.fileList?.find((res)=> res._checked && res.permission < 1) ? true : false
|
return this.fileList?.find((res)=> res._checked && res.permission < 1) ? true : false
|
||||||
|
},
|
||||||
|
|
||||||
|
maxSize() {
|
||||||
|
if(this.systemConfig?.file_upload_limit){
|
||||||
|
return this.systemConfig.file_upload_limit * 1024
|
||||||
|
}
|
||||||
|
return 1024000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -158,13 +158,6 @@
|
|||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
<div class="form-tip">{{$L('是否将消息中的网络图片保存到本地服务器。')}}</div>
|
<div class="form-tip">{{$L('是否将消息中的网络图片保存到本地服务器。')}}</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="$A.isDooServer()" :label="$L('是否启动首页')" prop="startHome">
|
|
||||||
<RadioGroup v-model="formDatum.start_home">
|
|
||||||
<Radio label="open">{{$L('开启')}}</Radio>
|
|
||||||
<Radio label="close">{{$L('关闭')}}</Radio>
|
|
||||||
</RadioGroup>
|
|
||||||
<div class="form-tip">{{$L('仅支持网页版。')}}</div>
|
|
||||||
</FormItem>
|
|
||||||
<FormItem v-if="$A.isDooServer()" :label="$L('文件上传限制')" prop="fileUploadLimit">
|
<FormItem v-if="$A.isDooServer()" :label="$L('文件上传限制')" prop="fileUploadLimit">
|
||||||
<div style="width: 192px;">
|
<div style="width: 192px;">
|
||||||
<Input type="number" number v-model="formDatum.file_upload_limit" :placeholder="$L('默认不限制')">
|
<Input type="number" number v-model="formDatum.file_upload_limit" :placeholder="$L('默认不限制')">
|
||||||
@ -173,7 +166,19 @@
|
|||||||
</template>
|
</template>
|
||||||
</Input>
|
</Input>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tip">{{$L('包含消息发送文件')}}</div>
|
<div class="form-tip">{{$L('包含消息发送的文件')}}</div>
|
||||||
|
</FormItem>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="block-setting-box" v-if="$A.isDooServer()">
|
||||||
|
<h3>{{ $L('特殊设置') }}</h3>
|
||||||
|
<div class="form-box">
|
||||||
|
<FormItem :label="$L('是否启动首页')" prop="startHome">
|
||||||
|
<RadioGroup v-model="formDatum.start_home">
|
||||||
|
<Radio label="open">{{$L('开启')}}</Radio>
|
||||||
|
<Radio label="close">{{$L('关闭')}}</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
<div class="form-tip">{{$L('仅支持网页版。')}}</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user