login-page.mixin.js 387 字节
Newer Older
雪洛's avatar
雪洛 已提交
1 2 3 4 5 6 7 8 9 10
import {mapMutations} from 'vuex';
import loginSuccess from './loginSuccess.js';
let mixin = {
	methods:{
		...mapMutations({
			setUserInfo: 'user/login'
		}),
		loginSuccess(result){
			loginSuccess(result)
			delete result.userInfo.token
DCloud_JSON's avatar
-...  
DCloud_JSON 已提交
11 12 13
			if (result.type == "register") {
				result.userInfo._id = result.uid  
			}
雪洛's avatar
雪洛 已提交
14 15 16 17 18
			this.setUserInfo(result.userInfo)
		}
	}
}
export default mixin