diff --git a/src/views/modules/worklog/worklog.vue b/src/views/modules/worklog/worklog.vue index 1661aaa..93ecb01 100644 --- a/src/views/modules/worklog/worklog.vue +++ b/src/views/modules/worklog/worklog.vue @@ -13,9 +13,24 @@ export default { } }, created () { + this.getCustomId() const _token = Cookies.get('token') || localStorage.getItem('token') const _customerId = Cookies.get('customerId') || localStorage.getItem('customerId') this.url = `${window.SITE_CONFIG['workLogURL']}/#/NoteTaking?token=${_token}&customerId=${_customerId}` + }, + methods:{ + getCustomId(){ + this.$http.get(`/api/plugins/workLog/getCustomId`) + .then(res => { + if (res.data.code !== 0) { + return this.$message.error(res.data.msg) + } + Cookies.set('customerId', res.data.data) + }) + .catch((err) => { + console.log(err) + }) + } } } diff --git a/src/views/pages/login.vue b/src/views/pages/login.vue index 5bcace5..8e838c0 100644 --- a/src/views/pages/login.vue +++ b/src/views/pages/login.vue @@ -151,16 +151,6 @@ export default { // 登陆之后从localStorage获取党委为空则从网络上拉取 this.checkLocakStorage() }).catch(() => { }) - this.$http.get(`/api/plugins/workLog/getCustomId`) - .then(res => { - if (res.data.code !== 0) { - return this.$message.error(res.data.msg) - } - Cookies.set('customerId', res.data.data) - }) - .catch((err) => { - console.log(err) - }) }) }, 1000, { 'leading': true, 'trailing': false }), checkLocakStorage () {