Prechádzať zdrojové kódy

feat(upload): 添加店铺 ID 参数- 在上传组件中引入 getShopId 函数
- 将店铺 ID 添加到上传数据中

tangy 1 mesiac pred
rodič
commit
0bc2f0b53e
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      src/components/upload/index.vue

+ 4 - 2
src/components/upload/index.vue

@@ -48,7 +48,7 @@ import feedback from '@/utils/feedback'
 import type { ElUpload, UploadProps, UploadRawFile } from 'element-plus'
 import { RequestCodeEnum } from '@/enums/requestEnums'
 import ImageCompressor from 'image-compressor.js'
-import { getToken,getUserId,getBrandId,getHouseId } from '@/utils/auth'
+import {getToken, getUserId, getBrandId, getHouseId, getShopId} from '@/utils/auth'
 export default defineComponent({
     components: {},
     props: {
@@ -87,6 +87,7 @@ export default defineComponent({
         const brandId = getBrandId();
         const houseId = getHouseId();
         const token = getToken();
+        const shopId = getShopId();
         const headers = computed(() => ({
             ['like-admin']: userStore.token,
             version: config.version,
@@ -105,7 +106,8 @@ export default defineComponent({
             // 更新上传参数
             uploadData.value = {
                 ...props.data,
-                fileName: rawFile.name
+                fileName: rawFile.name,
+              shopId: shopId
             }
             if(props.type === 'image'){
               let q = 0.5