适配getuserid函数

main
QMZ 1 month ago
parent 347411d9cf
commit 4deb0096c9

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

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

Loading…
Cancel
Save