feat: Files uploadFailedFirst size > 80MB text done.
This commit is contained in:
@@ -177,7 +177,7 @@ export async function uploadFailedFirst(failureType, failureMsg) {
|
||||
let value = '';
|
||||
switch (failureType) {
|
||||
case 'size':
|
||||
value = '檔案大小不可超過 90MB';
|
||||
value = 'File size exceeds 90MB.';
|
||||
break;
|
||||
case 'encoding':
|
||||
value = 'not in UTF-8';
|
||||
|
||||
@@ -123,10 +123,12 @@ export default defineStore('filesStore', {
|
||||
uploadloader(); // 進度條
|
||||
try {
|
||||
const response = await axios.post(api, fromData, config);
|
||||
console.log('第一階段 response:', response);
|
||||
this.uploadId = response.data.id;
|
||||
this.$router.push({name: 'Upload'});
|
||||
Swal.close(); // 關閉進度條
|
||||
} catch(error) {
|
||||
console.log('第一階段 error:', error);
|
||||
if(error.response.status === 422) {
|
||||
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
|
||||
// type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'
|
||||
@@ -162,6 +164,7 @@ export default defineStore('filesStore', {
|
||||
uploadloader(); // 進度條
|
||||
try {
|
||||
const response = await axios.post(api, data);
|
||||
console.log('第二階段 response:', response);
|
||||
|
||||
this.uploadLogId = await response.data.id;
|
||||
await Swal.close(); // 關閉進度條
|
||||
@@ -169,6 +172,8 @@ export default defineStore('filesStore', {
|
||||
await uploadSuccess();
|
||||
this.$router.push({name: 'Files'});
|
||||
} catch(error) {
|
||||
console.log('第二階段 error:', error);
|
||||
|
||||
if(error.response.status === 422) {
|
||||
uploadFailedSecond(error.response.data.detail[0].type, error.response.data.detail[0].msg);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user