Browse Source

更新上传文件桶名

lex 2 năm trước cách đây
mục cha
commit
2bfc20d81e

+ 5 - 1
src/components/o-upload-all/index.tsx

@@ -48,7 +48,11 @@ export default defineComponent({
     },
     bucket: {
       type: String,
-      default: 'daya'
+      default: 'gyt'
+    },
+    path: {
+      type: String,
+      default: ''
     },
     uploadIcon: {
       type: String,

+ 1 - 1
src/components/o-upload/index.tsx

@@ -55,7 +55,7 @@ export default defineComponent({
     },
     bucket: {
       type: String,
-      default: 'daya'
+      default: 'gyt'
     },
     path: {
       // 创建的目录

+ 4 - 0
src/school/manage-teacher/manage-teacher-register.tsx

@@ -332,6 +332,8 @@ export default defineComponent({
                     <OUpload
                       style={{ width: '100%' }}
                       tips="上传身份证正面"
+                      bucket="gyt"
+                      path="/user/"
                       v-model:modelValue={state.forms.idcardFrontImg}
                     />
                   )
@@ -352,6 +354,8 @@ export default defineComponent({
                     <OUpload
                       style={{ width: '100%' }}
                       tips="上传身份证反面"
+                      bucket="gyt"
+                      path="/user/"
                       v-model:modelValue={state.forms.idcardBackImg}
                     />
                   )

+ 2 - 2
src/school/mass-message/create-message.tsx

@@ -39,7 +39,7 @@ export default defineComponent({
     const forms = reactive({
       id: route.query.id,
       type: 'ADD',
-      bucket: 'daya',
+      bucket: 'gyt',
       sendStatus: false,
       sendType: 'IMMEDIATELY' as any,
       textMessage: null,
@@ -91,7 +91,7 @@ export default defineComponent({
         // 获取签名
         const signUrl = '/api-school/open/getUploadSign'
         const tempName = file.name || ''
-        const fileName = tempName && tempName.replace(/ /gi, '_')
+        const fileName = '/i-m/' + (tempName && tempName.replace(/ /gi, '_'))
         const key = new Date().getTime() + fileName
         showLoadingToast({
           message: '加载中...',

+ 22 - 16
src/school/orchestra/compontent/photo-create.tsx

@@ -65,9 +65,12 @@ export default defineComponent({
               parentId: route.query.parentId
             }
           })
-          setTimeout(() => {
-            showToast('添加成功')
-          }, 100)
+          // setTimeout(() => {
+          //   showToast('添加成功')
+          // }, 100)
+          state.status = false
+          state.photoName = null
+          onSearch()
         } else {
           await request.post('/api-school/orchestraPhotoAlbum/update', {
             data: {
@@ -77,15 +80,18 @@ export default defineComponent({
               name: state.photoName
             }
           })
-          setTimeout(() => {
-            showToast('修改成功')
-          }, 100)
-        }
-        state.status = false
-        setTimeout(() => {
+          // setTimeout(() => {
+          //   showToast('修改成功')
+          // }, 100)
+          state.status = false
           state.photoName = null
           onSearch()
-        }, 1100)
+        }
+
+        // setTimeout(() => {
+        //   state.photoName = null
+        //   onSearch()
+        // }, 1100)
       } catch {
         //
       }
@@ -158,13 +164,13 @@ export default defineComponent({
               id: state.selectItem.id
             }
           })
-          setTimeout(() => {
-            showToast('删除成功')
-          }, 100)
+          // setTimeout(() => {
+          //   showToast('删除成功')
+          // }, 100)
 
-          setTimeout(() => {
-            onSearch()
-          }, 1100)
+          // setTimeout(() => {
+          onSearch()
+          // }, 1100)
         } catch {
           //
         }

+ 5 - 0
src/school/orchestra/compontent/photo-detail.module.less

@@ -2,6 +2,11 @@
   // padding: 13px;
   --van-uploader-size: 92px !important;
 
+  :global {
+    .van-button {
+      font-size: 18px;
+    }
+  }
   .addPhone {
     margin: 13px;
     width: calc(100% - 26px);

+ 42 - 26
src/school/orchestra/compontent/photo-detail.tsx

@@ -45,7 +45,7 @@ export default defineComponent({
       },
 
       showPhoto: false,
-      bucket: 'daya',
+      bucket: 'gyt',
       fileList: [] as any,
       checkboxRefs: [] as any,
       check: [] as any
@@ -112,7 +112,7 @@ export default defineComponent({
         // 获取签名
         const signUrl = '/api-school/open/getUploadSign'
         const tempName = file.name || ''
-        const fileName = tempName && tempName.replace(/ /gi, '_')
+        const fileName = '/orchestra/' + (tempName && tempName.replace(/ /gi, '_'))
         const key = new Date().getTime() + fileName
 
         const res = await request.post(signUrl, {
@@ -182,19 +182,28 @@ export default defineComponent({
           }
         })
 
-        setTimeout(() => {
-          showToast('添加成功')
-          state.showPhoto = false
-          state.fileList = []
-        }, 100)
-        setTimeout(() => {
-          state.params.page = 1
-          state.list = []
-          state.listState.dataShow = true // 判断是否有数据
-          state.listState.loading = false
-          state.listState.finished = false
-          getList()
-        }, 1100)
+        state.showPhoto = false
+        state.fileList = []
+        state.params.page = 1
+        state.list = []
+        state.listState.dataShow = true // 判断是否有数据
+        state.listState.loading = false
+        state.listState.finished = false
+        getList()
+
+        // setTimeout(() => {
+        //   showToast('添加成功')
+        //   state.showPhoto = false
+        //   state.fileList = []
+        // }, 100)
+        // setTimeout(() => {
+        //   state.params.page = 1
+        //   state.list = []
+        //   state.listState.dataShow = true // 判断是否有数据
+        //   state.listState.loading = false
+        //   state.listState.finished = false
+        //   getList()
+        // }, 1100)
       } catch {
         //
       }
@@ -239,17 +248,24 @@ export default defineComponent({
             }
           })
 
-          setTimeout(() => {
-            showToast('删除成功')
-          }, 100)
-          setTimeout(() => {
-            state.params.page = 1
-            state.list = []
-            state.listState.dataShow = true // 判断是否有数据
-            state.listState.loading = false
-            state.listState.finished = false
-            getList()
-          }, 1100)
+          state.params.page = 1
+          state.list = []
+          state.listState.dataShow = true // 判断是否有数据
+          state.listState.loading = false
+          state.listState.finished = false
+          getList()
+
+          // setTimeout(() => {
+          //   showToast('删除成功')
+          // }, 100)
+          // setTimeout(() => {
+          //   state.params.page = 1
+          //   state.list = []
+          //   state.listState.dataShow = true // 判断是否有数据
+          //   state.listState.loading = false
+          //   state.listState.finished = false
+          //   getList()
+          // }, 1100)
         } catch {
           //
         }

+ 25 - 16
src/school/orchestra/compontent/photo.tsx

@@ -62,9 +62,12 @@ export default defineComponent({
               name: state.photoName
             }
           })
-          setTimeout(() => {
-            showToast('添加成功')
-          }, 100)
+          // setTimeout(() => {
+          //   showToast('添加成功')
+          // }, 100)
+          state.status = false
+          state.photoName = null
+          onSearch()
         } else {
           await request.post('/api-school/orchestraPhotoAlbum/update', {
             data: {
@@ -73,15 +76,20 @@ export default defineComponent({
               name: state.photoName
             }
           })
-          setTimeout(() => {
-            showToast('修改成功')
-          }, 100)
-        }
-        state.status = false
-        setTimeout(() => {
+          state.status = false
           state.photoName = null
           onSearch()
-        }, 1100)
+          // setTimeout(() => {
+          //   showToast('修改成功')
+          // }, 100)
+        }
+        state.status = false
+        state.photoName = null
+        onSearch()
+        // setTimeout(() => {
+        // state.photoName = null
+        // onSearch()
+        // }, 1100)
       } catch {
         //
       }
@@ -161,13 +169,14 @@ export default defineComponent({
               id: state.selectItem.id
             }
           })
-          setTimeout(() => {
-            showToast('删除成功')
-          }, 100)
+          onSearch()
+          // setTimeout(() => {
+          //   showToast('删除成功')
+          // }, 100)
 
-          setTimeout(() => {
-            onSearch()
-          }, 1100)
+          // setTimeout(() => {
+          //   onSearch()
+          // }, 1100)
         } catch {
           //
         }

+ 2 - 0
src/school/school-detail/eidt-school.tsx

@@ -219,6 +219,8 @@ export default defineComponent({
             <OUpload
               class={styles.upload}
               cropper
+              bucket="gyt"
+              path="/orchestra/"
               v-model:modelValue={forms.logo}
               ref={schoolImageRef}
             />

+ 1 - 1
src/state.ts

@@ -24,7 +24,7 @@ export const state = reactive({
 
 // 预览上传到oss的地址
 export const getOssUploadUrl = (bucket: string) => {
-  const tmpBucket = bucket || 'daya'
+  const tmpBucket = bucket || 'gyt'
   return `https://${tmpBucket}.ks3-cn-beijing.ksyuncs.com/`
 }
 

+ 1 - 1
src/student/music-group/state-music.ts

@@ -11,7 +11,7 @@ export const state = reactive({
 
 // 预览上传到oss的地址
 export const getOssUploadUrl = (bucket: string) => {
-  const tmpBucket = bucket || 'daya'
+  const tmpBucket = bucket || 'gyt'
   return `https://${tmpBucket}.ks3-cn-beijing.ksyuncs.com/`
 }