|
|
@@ -41,6 +41,32 @@ const user = {
|
|
|
state.signature = data.user.signature;
|
|
|
state.createdTime = data.user.createdTime;
|
|
|
state.valid = data.user.valid;
|
|
|
+ },
|
|
|
+ save_user: function (state) {
|
|
|
+ sessionStorage._token = state.token;
|
|
|
+ localStorage._name = state.name;
|
|
|
+ localStorage._id = state.id;
|
|
|
+ localStorage._phone = state.phone;
|
|
|
+ localStorage._username = state.username;
|
|
|
+ localStorage._email = state.email;
|
|
|
+ localStorage._photo = state.photo;
|
|
|
+ localStorage._role = state.role;
|
|
|
+ localStorage._signature = state.signature;
|
|
|
+ localStorage._createdTime = state.createdTime;
|
|
|
+ localStorage._valid = state.valid;
|
|
|
+ },
|
|
|
+ recover_user: function (state) {
|
|
|
+ state.token = sessionStorage._token;
|
|
|
+ state.name = localStorage._name;
|
|
|
+ state.id = localStorage._id;
|
|
|
+ state.phone = localStorage._phone;
|
|
|
+ state.username = localStorage._username;
|
|
|
+ state.email = localStorage._email;
|
|
|
+ state.photo = localStorage._photo;
|
|
|
+ state.role = localStorage._role;
|
|
|
+ state.signature = localStorage._signature;
|
|
|
+ state.createdTime = localStorage._createdTime;
|
|
|
+ state.valid = localStorage._valid;
|
|
|
}
|
|
|
},
|
|
|
|