diff --git a/.env.development b/.env.development index b00addc..6ab192b 100644 --- a/.env.development +++ b/.env.development @@ -14,5 +14,4 @@ VUE_APP_BASE_API = 'https://admintestpapi.sxczgkj.cn' VUE_APP_WS_API = 'ws://192.168.2.128:8000' VUE_APP_PHP_API = 'https://kysh.sxczgkj.cn' - # 是否启用 babel-plugin-dynamic-import-node插 \ No newline at end of file diff --git a/src/api/imagesPhp.js b/src/api/imagesPhp.js index 1654117..0bd0c6d 100644 --- a/src/api/imagesPhp.js +++ b/src/api/imagesPhp.js @@ -1,17 +1,57 @@ import request from "@/utils/requestPhp"; -// 查询图库 -export function getcommonCategor(data,params) { - return request({ - url: data + `/channel/file/getcommon-category`, - method: "get",params - }); - } - export function getcommonpicture(data,params) { - return request({ - url: data + "/channel/file/getcommon-picture", - method: "get", - params - }); - } +// 获取图片分类 +export function getcommonCategor(data) { + return request({ + url: `/sourcematerial/getcommon-category`, + method: 'post', + data: data + }) +} +// 获取图片 +export function getcommonpicture(data) { + return request({ + url: "/sourcematerial/getcommon-picture", + method: 'post', + data: data + }); +} +export function storeAddcategory(data) { + return request({ + url: '/sourcematerial/store-addcategory', + method: 'post', + data: { + ...data + }, + }) +} +export function addImg(data) { + return request({ + url: '/sourcematerial/add-img', + method: 'post', + data: { + ...data + }, + }) +} +// 删除图片 +export function delimg(data) { + return request({ + url: '/sourcematerial/delimg', + method: 'post', + data: { + ...data + }, + }) +} +// 删除类型 +export function delcate(data) { + return request({ + url: '/sourcematerial/delcate', + method: 'post', + data: { + ...data + }, + }) +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index 2938a73..2170f53 100644 --- a/src/main.js +++ b/src/main.js @@ -10,7 +10,6 @@ import Element from "element-ui"; // import VueSelectImage from 'vue-select-image' // import "vue-select-image/dist/vue-select-image.css"; // Vue.use(VueSelectImage) -// "vue-select-image": "^1.9.0", // 数据字典 import dict from "./components/Dict"; diff --git a/src/utils/requestPhp.js b/src/utils/requestPhp.js index b8970ee..6d00e61 100644 --- a/src/utils/requestPhp.js +++ b/src/utils/requestPhp.js @@ -8,7 +8,7 @@ import Cookies from 'js-cookie' // 创建axios实例 const service = axios.create({ - baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_PHP_API : '/php', + baseURL: process.env.NODE_ENV === 'production' ? process.env.VUE_APP_PHP_API : '/source', // baseURL: process.env.VUE_APP_PHP_API, // api 的 base_url timeout: Config.timeout // 请求超时时间 }) @@ -19,7 +19,7 @@ service.interceptors.request.use( // if (getToken()) { // config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 // } - // config.headers['Content-Type'] = 'application/json' + config.headers['Content-Type'] = 'text/html; charset=UTF-8' // config.headers['loginName'] = 'admin' // config.headers['token'] = 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyVHlwZSI6Ik1HIiwiZXhwIjoxNjkwMTgwNzE2LCJ1c2VySWQiOiIyNDQiLCJpYXQiOjE2ODg3MDk0ODcsImxvZ2luTmFtZSI6ImFkbWluIn0.lqxxvv2-FcecQngMBorz4MpkB3mIJQDG-IUULQyV-KQ' // config.headers["userId"] = '244' diff --git a/src/views/product/add_shop.vue b/src/views/product/add_shop.vue index 1f65e97..1daa517 100644 --- a/src/views/product/add_shop.vue +++ b/src/views/product/add_shop.vue @@ -47,7 +47,7 @@
注:第一张图为商品封面图,图片尺寸为750×750
- + 选择图片
@@ -552,15 +552,15 @@ export default { }, methods: { successEvent(d) { + // 删除重复数据 + // let index = this.files.findIndex(ele => ele.name == file.name) + // this.files.splice(index, 1); d.forEach(item => { item.uid = item.id - item.url = item.src - this.form.images.push(item.src); + item.url = item.url + this.form.images.push(item.url); }) this.$refs.uploadImg.fileList.push(...d) - // this.form.images.push(res[0]); - // console.log(this.$refs.uploadImg.fileList, '调试111111') - // console.log(this.$refs.uploadImg.files, '调试222') }, priceFormat(item, key) { const messageheight = 48; diff --git a/src/views/product/components/addImages.vue b/src/views/product/components/addImages.vue index d935577..a721c38 100644 --- a/src/views/product/components/addImages.vue +++ b/src/views/product/components/addImages.vue @@ -1,56 +1,141 @@ \ No newline at end of file diff --git a/src/views/product/components/imageComponent.vue b/src/views/product/components/imageComponent.vue new file mode 100644 index 0000000..fd0cadc --- /dev/null +++ b/src/views/product/components/imageComponent.vue @@ -0,0 +1,81 @@ + + + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index d0c1662..82d4eec 100644 --- a/vue.config.js +++ b/vue.config.js @@ -41,11 +41,11 @@ module.exports = { '^/auth': 'auth' } }, - '/php': { + '/source': { target: process.env.VUE_APP_PHP_API, changeOrigin: true, pathRewrite: { - '^/auth': 'auth' + '^/source': 'source' } } }