Browse Source

获取customId接口更换调用页面

master
mk 1 year ago
parent
commit
ac136cb883
  1. 15
      src/views/modules/worklog/worklog.vue
  2. 10
      src/views/pages/login.vue

15
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)
})
}
}
}
</script>

10
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 () {

Loading…
Cancel
Save