|
@@ -38,20 +38,12 @@ export default {
|
|
},
|
|
},
|
|
saveUserInfo(){
|
|
saveUserInfo(){
|
|
const store=useStore()
|
|
const store=useStore()
|
|
- if(localStorage.getItem('user')){
|
|
|
|
- let user=localStorage.getItem('user');
|
|
|
|
- user=JSON.parse(user)
|
|
|
|
|
|
+ getUserProfile().then((res)=>{
|
|
store.$patch({
|
|
store.$patch({
|
|
- user
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- getUserProfile().then((res)=>{
|
|
|
|
- store.$patch({
|
|
|
|
- user:res.data
|
|
|
|
- })
|
|
|
|
- localStorage.setItem('user',JSON.stringify(res.data))
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ user:res.data
|
|
|
|
+ })
|
|
|
|
+ localStorage.setItem('user',JSON.stringify(res.data))
|
|
|
|
+ })
|
|
},
|
|
},
|
|
},
|
|
},
|
|
destroyed() {
|
|
destroyed() {
|