瀏覽代碼

remove passwords in store

pull/342/head
Guillaume Vincent 8 年之前
父節點
當前提交
a759f756a7
共有 2 個檔案被更改,包括 2 行新增10 行删除
  1. +0
    -1
      src/components/PasswordGenerator.vue
  2. +2
    -9
      src/store.js

+ 0
- 1
src/components/PasswordGenerator.vue 查看文件

@@ -215,7 +215,6 @@
fetchPasswords(){
Passwords.all().then(response => {
this.passwords = response.data.results;
this.$store.dispatch('setPasswords', response.data.results);
});
},
fetchPassword(id){


+ 2
- 9
src/store.js 查看文件

@@ -10,17 +10,12 @@ const auth = new Auth(storage);

const state = {
authenticated: auth.isAuthenticated(),
email: '',
passwords: []
email: ''
};

const mutations = {
setPasswords(state, passwords){
state.passwords = passwords
},
logout(state){
state.authenticated = false;
state.passwords = [];
},
userAuthenticated(state, user){
state.authenticated = true;
@@ -33,14 +28,12 @@ const actions = {
logout: ({commit}) => {
auth.logout();
commit('logout');
},
setPasswords: ({commit}, password) => commit('setPasswords', password),
}
};

const getters = {
isAuthenticated: state => state.authenticated,
isGuest: state => !state.authenticated,
passwords: state => state.passwords,
email: state => state.email,
baseURL: state => state.baseURL
};


Loading…
取消
儲存