diff --git a/src/settings.js b/src/settings.js index a5ce4ff..e33893f 100644 --- a/src/settings.js +++ b/src/settings.js @@ -5,6 +5,7 @@ const spuPath = host + '/Data/UploadFiles/spu/'// spu图 const skuPath = host + '/Data/UploadFiles/sku/' // sku图 const logoPath = host + '/Data/UploadFiles/logo/' // 商铺图标 const photoPath = host + '/Data/UploadFiles/photo/'// 管理员图标 +const qrPath = host + '/Data/UploadFiles/qr/' // 菊花码 路径 const tempPath = host + '/Data/UploadFiles/temp/' // 临时图片路径 export default { @@ -22,6 +23,7 @@ export default { * sku图 路径 * 商铺图标 路径 * 管理员头像 路径 + * 菊花码图片 路径 * 临时图片 路径 * api飞机控制终端接口路径 * api小程序后台接口路径 @@ -34,6 +36,7 @@ export default { skuPath: skuPath, logoPath: logoPath, photoPath: photoPath, + qrPath: qrPath, tempPath: tempPath, apiPlanePath: '/mpApi/Plane/', apiAdminPath: '/mpApi/Admin/', diff --git a/src/store/index.js b/src/store/index.js index e38589d..77f5f84 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -382,6 +382,9 @@ const store = new Vuex.Store({ async fetchSiteList ({ commit }) { const res = await api.get('getSiteList') if (res.data.status === 1) { + res.data.siteList.forEach((site, index) => { + site.qr = settings.state.qrPath + site.qr // 把绝对路径加上 + }) commit('setSiteList', res.data.siteList) } else { commit('setSiteList', []) diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index 754746c..fc0d10f 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -9,6 +9,7 @@ const { skuPath, logoPath, photoPath, + qrPath, tempPath, apiPlanePath, apiAdminPath, @@ -28,6 +29,7 @@ const state = { skuPath: skuPath, logoPath: logoPath, photoPath: photoPath, + qrPath: qrPath, tempPath: tempPath, apiPlanePath: apiPlanePath, apiAdminPath: apiAdminPath, diff --git a/src/views/layout/components/main/site/add.vue b/src/views/layout/components/main/site/add.vue index fbf0be7..7dcf00d 100644 --- a/src/views/layout/components/main/site/add.vue +++ b/src/views/layout/components/main/site/add.vue @@ -26,9 +26,9 @@ :show-file-list="false" :on-success="handleUpSuccess" :on-error="handleUpErr" :before-upload="beforeAvatarUpload"> + :src="$store.state.settings.tempPath + form.upFile" class="avatar" /> + :src="defaultQr" class="avatar" />