From ac136cb883e91a473e60260c2479146981906d76 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 14 Mar 2024 10:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96customId=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E8=B0=83=E7=94=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/worklog/worklog.vue | 15 +++++++++++++++ src/views/pages/login.vue | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) 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 () {