diff --git a/buyer/src/components/nav/CateNav.vue b/buyer/src/components/nav/CateNav.vue index 95e90d5c..5dfc6517 100644 --- a/buyer/src/components/nav/CateNav.vue +++ b/buyer/src/components/nav/CateNav.vue @@ -89,7 +89,11 @@ export default { }, computed: { navList () { // 导航列表 - return JSON.parse(storage.getItem('navList')) || [] + if (storage.getItem('navList')) { + return JSON.parse(storage.getItem('navList')) + } else { + return [] + } } }, methods: { diff --git a/buyer/src/components/nav/GoodsClassNav.vue b/buyer/src/components/nav/GoodsClassNav.vue index 9a3db4c0..570fec48 100644 --- a/buyer/src/components/nav/GoodsClassNav.vue +++ b/buyer/src/components/nav/GoodsClassNav.vue @@ -188,7 +188,7 @@ export default { }, computed: { cateList () { // 商品分类 - return this.$store.state.category + return this.$store.state.category || [] } }, watch: { diff --git a/buyer/src/components/nav/cateNav.vue b/buyer/src/components/nav/cateNav.vue index 95e90d5c..5dfc6517 100644 --- a/buyer/src/components/nav/cateNav.vue +++ b/buyer/src/components/nav/cateNav.vue @@ -89,7 +89,11 @@ export default { }, computed: { navList () { // 导航列表 - return JSON.parse(storage.getItem('navList')) || [] + if (storage.getItem('navList')) { + return JSON.parse(storage.getItem('navList')) + } else { + return [] + } } }, methods: { diff --git a/buyer/src/vuex/store.js b/buyer/src/vuex/store.js index faaebfc9..6c1123c5 100644 --- a/buyer/src/vuex/store.js +++ b/buyer/src/vuex/store.js @@ -13,7 +13,7 @@ export default new Vuex.Store({ cartNum: storage.getItem('cartNum') || 0, logoImg: require('@/assets/images/logo2.png'), hotWordsList: storage.getItem('hotWordsList'), - category: localStorage.getItem('category') + category: JSON.parse(localStorage.getItem('category')) }, getters, actions, diff --git a/manager/src/main.js b/manager/src/main.js index fa03abd2..1843f474 100644 --- a/manager/src/main.js +++ b/manager/src/main.js @@ -22,11 +22,13 @@ import liliDialog from '@/views/lili-dialog' import {md5} from '@/utils/md5.js'; Vue.config.devtools = true; Vue.config.productionTip = false -Vue.prototype.linkTo = function (goodsId, skuId, link='https://pc-b2b2c.pickmall.cn') { // 跳转买家端商品 - window.open(`${link}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') +const buyerUrlPC = 'https://pc-b2b2c.pickmall.cn' // 跳转买家端地址 pc端 +const buyerUrlWap = 'https://m-b2b2c.pickmall.cn' // 跳转买家端地址 wap端 +Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品 + window.open(`${buyerUrlPC}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') }; Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码 - return `https://m-b2b2c.pickmall.cn/pages/product/goods?id=${skuId}&goodsId=${goodsId}` + return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}` }; Vue.use(VueLazyload, { error: require('./assets/img-error.png'), diff --git a/seller/src/api/goods.js b/seller/src/api/goods.js index dd8e4264..ae41ef83 100644 --- a/seller/src/api/goods.js +++ b/seller/src/api/goods.js @@ -8,14 +8,6 @@ import { getRequestWithNoToken, commonUrl } from "@/libs/axios"; -import config from "@/config"; - -// 文件上传接口 -export const uploadFile = commonUrl + "/common/upload/file"; -// 验证码渲染图片接口 -export const drawCodeImage = "/common/captcha/draw/"; -// 获取菜单 -export const getMenuList = "/permission/getMenuList"; // 获取数据字典 export const getDictData = "/dictData/getByType/"; // Websocket diff --git a/seller/src/api/index.js b/seller/src/api/index.js index 6d1f870b..84305fd3 100644 --- a/seller/src/api/index.js +++ b/seller/src/api/index.js @@ -6,17 +6,8 @@ import { deleteRequest, getRequestWithNoToken, postRequestWithNoToken, - commonUrl, - baseUrl } from "@/libs/axios"; -// 文件上传接口 -export const uploadFile = commonUrl + "/common/upload/file"; -// 验证码渲染图片接口 -export const drawCodeImage = commonUrl + "/common/captcha/draw/"; -// 获取菜单 -export const getMenuList = baseUrl + "/permission/getMenuList"; - //获取所有city export const getAllCity = (params) => { return getRequest(commonUrl+'/common/region/allCity', params) diff --git a/seller/src/api/platform.js b/seller/src/api/platform.js index 71a4214a..6adc02b5 100644 --- a/seller/src/api/platform.js +++ b/seller/src/api/platform.js @@ -1,10 +1,6 @@ // 统一请求路径前缀在libs/axios.js中修改 import { getRequest, postRequest, putRequest, deleteRequest, importRequest, getRequestWithNoToken } from '@/libs/axios'; -// 验证码渲染图片接口 -export const drawCodeImage = "/lili/common/captcha/draw/" - - // 获取kuaidi配置 export const getParams = (params) => { return getRequest('/platformSetting/get/'+params) diff --git a/seller/src/api/shops.js b/seller/src/api/shops.js index 67146076..35100159 100644 --- a/seller/src/api/shops.js +++ b/seller/src/api/shops.js @@ -3,12 +3,6 @@ import {getRequest, postRequest, putRequest, deleteRequest, importRequest, getRe // Vaptcha ID export const vaptchaID = "5dce36188713b71e70a41eb7" -// 文件上传接口 -export const uploadFile = "/upload/file" -// 验证码渲染图片接口 -export const drawCodeImage = "/common/captcha/draw/" -// 获取菜单 -export const getMenuList = "/permission/getMenuList" // 获取数据字典 export const getDictData = "/dictData/getByType/" // Websocket diff --git a/seller/src/libs/axios.js b/seller/src/libs/axios.js index 315441d9..862e55b2 100644 --- a/seller/src/libs/axios.js +++ b/seller/src/libs/axios.js @@ -15,7 +15,8 @@ export const commonUrl = process.env.NODE_ENV === "development" ? config.api_dev.common : config.api_prod.common; - +// 文件上传接口 +export const uploadFile = commonUrl + "/common/upload/file"; var isRefreshToken = 0; const refreshToken = getTokenDebounce(); const service = axios.create({ diff --git a/seller/src/main.js b/seller/src/main.js index c73b4bbc..3752e635 100644 --- a/seller/src/main.js +++ b/seller/src/main.js @@ -56,11 +56,13 @@ Vue.prototype.setStore = setStore; Vue.prototype.getStore = getStore; Vue.prototype.removeStore = removeStore; Vue.prototype.md5 = md5; -Vue.prototype.linkTo = function (goodsId, skuId, link='https://pc-b2b2c.pickmall.cn') { // 跳转买家端商品 - window.open(`${link}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') +const buyerUrlPC = 'https://pc-b2b2c.pickmall.cn' // 跳转买家端地址 pc端 +const buyerUrlWap = 'https://m-b2b2c.pickmall.cn' // 跳转买家端地址 wap端 +Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品 + window.open(`${buyerUrlPC}/goodsDetail?skuId=${skuId}&goodsId=${goodsId}`, '_blank') }; Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码 - return `https://m-b2b2c.pickmall.cn/pages/product/goods?id=${skuId}&goodsId=${goodsId}` + return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}` }; Array.prototype.remove = function(from, to) { diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index f13ec3c9..31ae0b2f 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -315,6 +315,7 @@ import * as API_Shop from "@/api/shops"; import cloneObj from "@/utils/index"; import vuedraggable from "vuedraggable"; import editor from "@/views/my-components/lili/editor"; +import { uploadFile } from "@/libs/axios"; import {regular} from "@/utils"; export default { @@ -371,7 +372,7 @@ export default { //提交状态 submitLoading: false, //上传图片路径 - uploadFileUrl: API_GOODS.uploadFile, + uploadFileUrl: uploadFile, // 预览图片路径 previewPicture: "", //商品图片 diff --git a/seller/src/views/my-components/lili/editor.vue b/seller/src/views/my-components/lili/editor.vue index ea4212c0..18878a32 100644 --- a/seller/src/views/my-components/lili/editor.vue +++ b/seller/src/views/my-components/lili/editor.vue @@ -50,7 +50,7 @@