Commit 26f28a2a authored by v-yuchenglong's avatar v-yuchenglong

update:商品图片上传问题

parent 68b81e77
......@@ -234,7 +234,7 @@
</template>
<script>
import { GOODS_URI } from "../../../../../server/config";
// import { GOODS_URI } from "../../../../../server/config";
import { ElMessage } from "element-plus";
import { getCookie } from "@/utils/util";
......@@ -286,7 +286,7 @@ export default {
picUrlList: [],
picUploadList: [], // 上传详情图片列表
isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
uploadUrl: `/api`, // 金山云上传地址
hideUpload: false,
limitCount: 1,
......@@ -429,7 +429,7 @@ export default {
marketing_name: this.editInfo.marketing_name,
marketing_type: "4",
ota_id: this.commodityForm.business1,
op_cur_user: getCookie('username'),
op_cur_user: getCookie("username"),
// op_cur_user: store.state.userInfo.email,
goods_sku_id: goodsSkuID,
});
......@@ -466,9 +466,11 @@ export default {
// 添加修改商品
async commodity(type, val) {
this.$refs.picUpload && this.$refs.picUpload.clearFiles && this.$refs.picUpload.clearFiles();
this.$refs.picUpload &&
this.$refs.picUpload.clearFiles &&
this.$refs.picUpload.clearFiles();
this.picUrlList = [];
this.picStr = ''
this.picStr = "";
this.addCommodityPopup = true;
this.commodityForm = {};
......@@ -497,7 +499,7 @@ export default {
marketing_type: "4",
price: this.commodityForm.price,
ota_id: this.commodityForm.business1,
op_cur_user: getCookie('username'),
op_cur_user: getCookie("username"),
});
if (res.code == 0) {
ElMessage.success({
......@@ -596,12 +598,12 @@ export default {
this.comTableData = newVal;
},
picUrlList: function () {
if(this.picUrlList.length >= this.limitCount) {
this.hideUpload = true
}else {
this.hideUpload = false
if (this.picUrlList.length >= this.limitCount) {
this.hideUpload = true;
} else {
this.hideUpload = false;
}
}
},
},
created() {
this.getBusinessListMet();
......
......@@ -7,6 +7,15 @@ module.exports = {
publicPath: isDev ? "/" : "/dist",
configureWebpack: {
devServer: {
proxy: {
'/api': {
target: `http://bp-test.ini.yidian-inc.com/ksy/ks3apiunencrypt/ks3api_upload`,
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
},
},
proxy: "http://127.0.0.1:8055", //http://localhost:8055
hot: true,
disableHostCheck: true,
......@@ -14,7 +23,7 @@ module.exports = {
resolve: {
// 配置解析规则
alias: {
'@': path.join(__dirname, 'src') // 使用@别名简写src目录所在的绝对路径
'@': path.join(__dirname, 'src') // 使用@别名简写src目录所在的绝对路径
},
},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment