Commit 88e6e05a by caoyanzhi

update: 添加校验是否已完成初始化的逻辑

parent ab7f14af
......@@ -43,15 +43,35 @@ export default {
};
},
created() {
provideData.layoutVm = this;
this.$on('command', this.onCommand);
this.$router.beforeEach((to, from, next) => {
this.activedMenu = this.getActivedMenu(this.getMenuByPath(to.path.slice(1)));
next();
});
this.getEnterpriseSecret();
this.getMenuList();
provideData.layoutVm = this;
this.$on('command', this.onCommand);
},
methods: {
getEnterpriseSecret() {
if (this.$route.path == '/enterpriseSet') return;
getRequest('/haoban-manage3-web/is-wx-enterprise-secret-set', {}).then(res => {
const { errorCode, result } = res.data || {};
if (errorCode != 1) {
errorMsg.errorMsg(res.data);
return;
}
if (!result) {
this.$confirm('提示', '请先完成商户初始化设置后,再进行其他操作', {
type: 'warning',
cancelButtonText: '忽略',
confirmButtonText: '去完成'
}).then(() => {
this.$router.push('/enterpriseSet');
});
}
});
},
getMenuList() {
getRequest('/haoban-manage3-web/get-haoban-menu', {}).then(res => {
const { errorCode, result } = res.data || [];
......
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