提交 4a3287a7 authored 作者: huaxinzhu's avatar huaxinzhu

优化01

上级 db11856f
...@@ -100,18 +100,13 @@ export default { ...@@ -100,18 +100,13 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
var ssa = window.location.host var ssa = window.location.host
setTimeout(function (){ if(ssa =='localhost:1024'){
if(ssa =='localhost:1024'){
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login'
}else{
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login' window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login'
} }else{
}, 1000) window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa+'/login'
}
}) })
}) })
} }
......
...@@ -96,11 +96,11 @@ const user = { ...@@ -96,11 +96,11 @@ const user = {
removeToken() removeToken()
var ssa = window.location.host var ssa = window.location.host
// setTimeout(function (){ // setTimeout(function (){
if(ssa =='localhost:1024'){ // if(ssa =='localhost:1024'){
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa // window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa
}else{ // }else{
window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa // window.location.href='http://sso.jxhh.com/logout?redirect=http://'+ssa
} // }
// }, 1000) // }, 1000)
resolve() resolve()
......
...@@ -52,8 +52,9 @@ service.interceptors.response.use(res => { ...@@ -52,8 +52,9 @@ service.interceptors.response.use(res => {
hideLoading() hideLoading()
}, 200) }, 200)
// debugger
// 未设置状态码则默认成功状态 // 未设置状态码则默认成功状态
const code = res.data.code || 200; const code = ( res.data.code === 0 ? 0 : res.data.code ) || 200;
// 返回所有数据的统一处理 // 返回所有数据的统一处理
const data = res.data; const data = res.data;
// 获取错误信息 // 获取错误信息
...@@ -88,13 +89,8 @@ service.interceptors.response.use(res => { ...@@ -88,13 +89,8 @@ service.interceptors.response.use(res => {
location.reload() // 为了重新实例化vue-router对象 避免bug location.reload() // 为了重新实例化vue-router对象 避免bug
}) })
}) })
} else if (code === 500) { }
Message({ else if (code !== 200 && code !== 1) {
message: message,
type: 'error'
})
return Promise.reject(new Error(message))
} else if (code !== 200 && code !== 1) {
Notification.error({ Notification.error({
title: message title: message
}) })
...@@ -110,8 +106,6 @@ service.interceptors.response.use(res => { ...@@ -110,8 +106,6 @@ service.interceptors.response.use(res => {
// }, 1000) // }, 1000)
// location.reload() // 为了重新实例化vue-router对象 避免bug // location.reload() // 为了重新实例化vue-router对象 避免bug
}) })
} else if (code === 200 || code === 1 ) {
return res.data
} }
}, error => { }, error => {
setTimeout(() => { setTimeout(() => {
......
...@@ -679,6 +679,8 @@ ...@@ -679,6 +679,8 @@
.brand-carousel { .brand-carousel {
width:70%; width:70%;
min-width: 600px;
max-width: 1920px;
display : flex; display : flex;
justify-content : center; justify-content : center;
flex-direction : row; flex-direction : row;
......
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
let money = [] let money = []
let count = [] let count = []
let actual = [] let actual = []
if(response.data.line && response.data.line.length > 0) { if(response.data && response.data.line && response.data.line.length > 0) {
response.data.line.forEach(function(item, index) { response.data.line.forEach(function(item, index) {
money.unshift(item.price) money.unshift(item.price)
actual.unshift(item.date) actual.unshift(item.date)
...@@ -179,7 +179,7 @@ export default { ...@@ -179,7 +179,7 @@ export default {
this.lineChartData.actualData = count this.lineChartData.actualData = count
this.lineChartData.months= actual this.lineChartData.months= actual
// this.lineChartData.countData = count // this.lineChartData.countData = count
console.log("response.data",response.data) //console.log("response.data",response.data)
this.panelData.goodsTotal= response.data.goodsTotal this.panelData.goodsTotal= response.data.goodsTotal
this.panelData.refundTotal= response.data.rettotal this.panelData.refundTotal= response.data.rettotal
......
...@@ -190,7 +190,6 @@ ...@@ -190,7 +190,6 @@
goodsImgFileList: [], // 商品图片地址 集合list goodsImgFileList: [], // 商品图片地址 集合list
goodsImgVisible: false, // 图片能否预览 goodsImgVisible: false, // 图片能否预览
goodsImgUrlDialog: '', goodsImgUrlDialog: '',
/* 修改 商品分类 */ /* 修改 商品分类 */
loadingSSQ: false, loadingSSQ: false,
editGoodsTypeDialog: false, editGoodsTypeDialog: false,
...@@ -210,7 +209,6 @@ ...@@ -210,7 +209,6 @@
watch: {}, watch: {},
created() {}, created() {},
mounted() { mounted() {
//debugger
//深拷贝一份最开始的数据,为初始化准备 //深拷贝一份最开始的数据,为初始化准备
//this.goodsInfoDataClone = this.deepClone(this.goodsinfodata); //this.goodsInfoDataClone = this.deepClone(this.goodsinfodata);
if(this.goodsinfodata.goods_id) { if(this.goodsinfodata.goods_id) {
...@@ -226,7 +224,6 @@ ...@@ -226,7 +224,6 @@
this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr; this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr;
this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList; this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList;
} }
//console.log("tup",this.goodsImgFileList)
// 获取 省 // 获取 省
this.getArea(); this.getArea();
// 获取 商品品牌 // 获取 商品品牌
...@@ -286,7 +283,6 @@ ...@@ -286,7 +283,6 @@
if(level === 2) { if(level === 2) {
limboNode = { pid: node.value }; limboNode = { pid: node.value };
} }
//this.loadingSSQ = true;
getAreaList(limboNode).then(res => { getAreaList(limboNode).then(res => {
let result = {}; let result = {};
if (level === 0) { if (level === 0) {
...@@ -317,7 +313,6 @@ ...@@ -317,7 +313,6 @@
}) })
} }
resolve(result) resolve(result)
//this.loadingSSQ = false;
}); });
}, },
SSQGoodsChange(value) { SSQGoodsChange(value) {
......
...@@ -268,7 +268,6 @@ ...@@ -268,7 +268,6 @@
// 规格子组件,传给父组件的数据 // 规格子组件,传给父组件的数据
calcSpeTable(data) { calcSpeTable(data) {
if(data.pamTableList.length > 0) { if(data.pamTableList.length > 0) {
// debugger
data.pamTableList.forEach((item, index) => { data.pamTableList.forEach((item, index) => {
if( Array.isArray(data.pamDataList[index]) ) { if( Array.isArray(data.pamDataList[index]) ) {
item[0].spec_values = data.pamDataList[index]; item[0].spec_values = data.pamDataList[index];
...@@ -312,7 +311,7 @@ ...@@ -312,7 +311,7 @@
if(level === 2) { if(level === 2) {
limboNode = { id: node.value }; limboNode = { id: node.value };
} }
this.loading = true; //this.loading = true;
NewGetCategory(limboNode).then(res => { NewGetCategory(limboNode).then(res => {
let result = {}; let result = {};
...@@ -363,7 +362,7 @@ ...@@ -363,7 +362,7 @@
} }
resolve(result) resolve(result)
this.loading = false; //this.loading = false;
}); });
}, },
// 添加商品后,下一步 操作 // 添加商品后,下一步 操作
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论