diff --git a/src/App.vue b/src/App.vue index cc00004..e5a4c92 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,7 +19,6 @@ export default { ...mapState(['user']) }, async mounted () { - this.$cookies.set('token', '123', 60) this.GET_DEPLIST() }, methods: { @@ -44,7 +43,7 @@ export default { handleDingtalkLogin (val) { apiDingtalkLogin(val).then(res => { if (res && res.code === 0) { - this.$cookie.set('token', res.token) + this.$cookies.set('token', res.token) this.dataForm.verify = '登录成功,跳转中...' window.open(window.location.protocol + '//' + window.location.host + '/digitization/kpi/workbench/home?code=' + this.dingCode.code) } else { diff --git a/src/views/kpi/workbench/index.vue b/src/views/kpi/workbench/index.vue index cb11861..619b603 100644 --- a/src/views/kpi/workbench/index.vue +++ b/src/views/kpi/workbench/index.vue @@ -12,16 +12,9 @@ v-model="input" clearable> - 登 陆 - + 登 陆 +
token : {{token}}
+ @@ -36,8 +29,9 @@ export default { return { isShow: false, islzmanagement, - input: '', - verify: '888888' + input: localStorage.getItem('input'), + verify: '888888', + token: this.$cookies.get('token') } }, computed: {}, @@ -53,9 +47,14 @@ export default { // console.log('res: ', res) // }, async handleLogin () { + localStorage.setItem('input', this.input) const params = {'userName': this.input, 'password': 'admin', 'uuid': '', 'verify': this.verify, 'verifyCode': this.verify} let res = await apiLogin(params) - console.log('res: ', res) + if (res.code === 200) { + this.token = res.token + this.$cookies.set('token', res.token, res.expire) + history.go(0) + } } }, watch: {}