essay-org / essay

personalise blog system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

点击登陆后不会转入后台,但是提示登陆成功

zengjinlong opened this issue · comments

export default{ layout:'login', name: 'Login', data () { return { username: '', password: '', loginTip: '' } }, methods: { async login () { if (this.username === '' || this.password === '') { this.loginTip = '请正确填写用户名和密码' return } await this.$store.dispatch('LOGIN', { username: this.username, password: this.password }) if (this.$store.state.status.code === 200) { // 登录成功, 存储token this.$store.commit('SET_USER', this.$store.state.status.token) this.$router.push('/publish') this.username = '' this.password = '' } this.loginTip = this.$store.state.status.message } } }

commented

新版本已经解决这些问题