Commit 5b2fd269 authored by leiqingsong's avatar leiqingsong

修改

parent 272c425e
export function getUserId() {
if (localStorage.getItem("user")) {
return JSON.parse(localStorage.getItem('user')).userId;
} else {
return "";
}
}
\ No newline at end of file
<template>
<div class="settings">
<van-cell-group class="group-1">
<van-cell title="用户名" value="135****1234" />
<van-cell title="用户名" :value="$userId" />
<van-cell is-link center title="头像" @click="onModefy">
<img
class="avatar-img"
......@@ -46,6 +46,7 @@
</template>
<script>
import { getUserInfo } from "@/api/user";
import { logoutToApp } from "@/utils/bridgeToAppFun";
import { logout } from "@/api/user";
import { fillInviteCode } from "@/api/user";
......@@ -61,7 +62,17 @@ export default {
inviteeCodeDialog: false
};
},
created() {
this.getUser()
},
methods: {
getUser() {
getUserInfo().then(res => {
if (res.code === 0) {
localStorage.setItem("user", JSON.stringify(res.data));
}
})
},
logout() {
const params = {
token: "qwedskdljlkjlklkjlkjlkjl"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment