1.获取保存token
在前端界面中添加login方法()
login(form){
const _this = this
console.log(this.form)
const url = this.HOST + "/login"
Axs.post(url,{
username : this.form.username,
password : this.form.password
}).then(function (resp){
if(resp.data.flg == "true"){
_this.$store.commit('SET_TOKEN',resp.data.token)
_this.$store.commit('GET_USER', JSON.stringify(resp.data))
_this.$router.replace({
path:'/dashboard' }