Commit 9f7ae9da by crushh

udpate: dist

parent 6bdcf7f6
......@@ -76,18 +76,18 @@ Vue.axios.interceptors.request.use(
Vue.axios.interceptors.response.use(
data => {
removePending(data.config); //在一个ajax响应后再执行一下取消操作,把已经完成的请求从pending中移除
// if (data.status && data.status == 200 && (data.data.errorCode != 1||data.data.code!=1)) {
// if (data.data.errorCode == 4) {
// if (window.location.href.indexOf('gic-error') != -1) {
// return false;
// }
// window.location.href = gicHost + '/gic-web/#/login?ishb=1';
// }
// if (data.data.errorCode == 10 || data.data.errorCode == 7) {
// window.location.href = gicHost + '/haoban-3/#/index';
// }
// return data;
// }
if (data.status && data.status == 200 && (data.data.errorCode != 1 || data.data.code != 1)) {
if (data.data.errorCode == 4) {
if (window.location.href.indexOf('gic-error') != -1) {
return false;
}
window.location.href = gicHost + '/gic-web/#/login?ishb=1';
}
if (data.data.errorCode == 10 || data.data.errorCode == 7) {
window.location.href = gicHost + '/haoban-3/#/index';
}
return data;
}
return data;
},
err => {
......
......@@ -80,7 +80,8 @@ router.beforeEach((to, from, next) => {
baseUrl = host;
}
const { fromPath = [] } = from.meta || {};
const { fromPath = [],refresh } = from.meta || {};
if (Array.isArray(fromPath)) {
from.meta.keepAlive = fromPath.some(el => {
let menuUrlReg = el;
......@@ -96,7 +97,14 @@ router.beforeEach((to, from, next) => {
const reg = new RegExp(menuUrlReg);
return reg.test(to.path);
});
if(from.meta.keepAlive){
to.meta.refresh=false;
}else{
to.meta.refresh=refresh;
}
}
console.log(from)
console.log(to)
next();
});
......
......@@ -4,7 +4,11 @@ const attractFlowLinkRouter = [
{
path: '/attractFlowLink',
name: '引流链接',
component: _import('salesleads/actCodeManage/attractFlowLink', 'index')
component: _import('salesleads/actCodeManage/attractFlowLink', 'index'),
meta: {
keepAlive: true,
fromPath: ['/attractFlowLinkAdd', '/attractFlowLinkEdit/:id', '/attractFlowLinkInfo/:id']
}
},
{
path: '/attractFlowLinkAdd',
......@@ -33,7 +37,11 @@ const attractFlowLinkRouter = [
{
path: '/ladingPageList',
name: '落地页列表',
component: _import('salesleads/actCodeManage/attractFlowLink/landingPage', 'list')
component: _import('salesleads/actCodeManage/attractFlowLink/landingPage', 'list'),
meta: {
keepAlive: true,
fromPath: ['/ladingPageAdd', '/ladingPageEdit/:id']
}
},
{
path: '/ladingPageAdd',
......
......@@ -100,7 +100,11 @@ export const constantRouterMap = [
{
path: '/salutatory',
name: '欢迎语',
component: _import('enterprise', 'salutatoryIndex')
component: _import('enterprise', 'salutatoryIndex'),
meta:{
keepAlive: true,
fromPath: ['/editSalutatorySet','/salutatorySet']
}
},
{
path: '/salutatorySet',
......
......@@ -124,9 +124,18 @@ export default {
};
},
mounted() {
const that = this;
that.getData();
// this.getSetting();
this.getData();
console.log('mounted');
},
activated() {
if (this.$route.meta.refresh) {
this.form = {
title: '',
pageSize: 20,
pageNum: 1
};
}
this.getData();
},
props: {
type: {
......@@ -187,8 +196,9 @@ export default {
type: 'warning'
}).then(() => {
getRequest('/haoban-manage3-web/welcome/remove', { welcomeId: row.welcomeId }).then(res => {
console.log(res);
let resData = res.data;
if (resData.code == 0 && resData.result) {
if (resData.code == 0) {
this.$message.success('删除成功');
this.getData();
}
......@@ -197,7 +207,6 @@ export default {
},
delType2(row) {
getRequest('/haoban-manage3-web/welcome/statistics', { welcomeId: row.welcomeId }).then(res => {
console.log(res);
const { result } = res.data;
let str = '';
if (result) {
......@@ -223,8 +232,9 @@ export default {
type: 'warning'
}).then(() => {
getRequest('/haoban-manage3-web/welcome/remove', { welcomeId: row.welcomeId }).then(res => {
console.log(res);
let resData = res.data;
if (resData.code == 0 && resData.result) {
if (resData.code == 0) {
this.$message.success('删除成功');
this.getData();
}
......@@ -253,7 +263,7 @@ export default {
postJsonRequest('/haoban-manage3-web/welcome/list', { ...this.form, wxEnterpriseId: this.wxEnterpriseId, type: this.type })
.then(res => {
let resData = res.data;
console.log(resData);
if (resData.code == 0 && resData.result) {
this.tableData = resData.result.result;
this.tableData.forEach(item => {
......
......@@ -27,6 +27,9 @@ export default {
this.activeName = Number(sessionStorage.getItem('activeName'));
}
},
destroyed() {
sessionStorage.setItem('activeName', 1);
},
watch: {
activeName(val) {
sessionStorage.setItem('activeName', val);
......
......@@ -674,7 +674,7 @@ export default {
para.suitDepartmentDeleteList.forEach(item => {
item.selectType = 1;
});
console.log(para);
this.submitbtnLoading = true;
postJsonRequest('/haoban-manage3-web/welcome/save', para)
.then(res => {
......@@ -684,7 +684,9 @@ export default {
type: 'success',
message: '保存成功!'
});
// this.$router.push('/salutatory');
if (!this.$route.query.id) {
this.$route.meta.refresh = true;
}
this.$router.go(-1);
}
})
......
......@@ -177,8 +177,10 @@ export default {
storeData: [],
form: {
linkType: 1,
memberLabelName: '测试标签值名称重复- 温州青童时代店',
memberLabelId: 'edd3901afd1e418d93fdc3b50bb24784',
memberLabelName: '',
memberLabelId: '',
// memberLabelName: '测试标签值名称重复- 温州青童时代店',
// memberLabelId: 'edd3901afd1e418d93fdc3b50bb24784',
storeList: [],
name: '',
pageId: '',
......@@ -351,6 +353,7 @@ export default {
data.storeRuleJson = JSON.stringify(data.storeRuleJson);
data.customRuleJson = JSON.stringify(data.customRuleJson);
data.wxEnterpriseId = this.wxEnterpriseId;
delete data.memberLabelStatus;
this.$refs.form.validate(val => {
if (!val) {
this.scrollToError(this);
......@@ -362,6 +365,7 @@ export default {
.then(res => {
setTimeout(() => {
this.btnLoading = false;
this.$route.meta.refresh = true;
this.$router.go(-1);
}, 1000);
})
......
......@@ -191,6 +191,18 @@ export default {
mounted() {
this.getList();
},
activated() {
if (this.$route.meta.refresh) {
this.form = {
pageSize: 20,
pageNum: 1,
linkType: '',
searchParams: '',
dateRange: []
};
}
this.getList();
},
components: {
links
},
......
......@@ -126,6 +126,7 @@ export default {
guidePageSave(this.form)
.then(_ => {
this.$router.go(-1);
this.$route.meta.refresh = true;
this.$message.success('保存成功');
})
.finally(_ => {
......
......@@ -113,10 +113,22 @@ export default {
mounted() {
this.getList();
},
activated() {
if (this.$route.meta.refresh) {
this.form = {
pageSearchText: '',
dateRange: [],
pageSize: 20,
pageNum: 1
};
}
this.getList();
},
methods: {
toInput: _debounce(function(e, value) {
this.getList();
}, 500),
getList() {
const param = { ...this.form };
if (this.form.dateRange && this.form.dateRange.length) {
......
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