适配getuserid函数

main
QMZ 1 month ago
parent 347411d9cf
commit 4deb0096c9

@ -61,6 +61,7 @@
<script>
import { defineComponent } from 'vue';
import axios from 'axios';
import {getUserId} from '@/token/auth';
@ -72,6 +73,7 @@
},
data() {
return {
userid:0,
showForm: false, //
radio: '日常动态',
form: {
@ -126,7 +128,7 @@
return;
}
const newPost = {
userid:1,
userid:getUserId(),
username: '用户',
avatarurl: 'https://via.placeholder.com/50',
timestamp: new Date().toLocaleString(),

@ -143,7 +143,7 @@
import PostCard from './PostCard.vue';
import PostForm from './Postform.vue';
import axios from '@/utils/axiosConfig';
// import {getToken} from '@/token/auth'
import {getUserId} from '@/token/auth'
export default {
name: 'CommunityIndex', //
components: { PostCard, PostForm },
@ -193,6 +193,7 @@
async loadData() {
try {
this.userid= getUserId();
//
await this.fllowlist();
await this.loadhotpost();

Loading…
Cancel
Save