aaa před 4 roky
rodič
revize
ee3eac1f90
1 změnil soubory, kde provedl 8 přidání a 3 odebrání
  1. 8 3
      src/views/home/learn/page-learn-content.vue

+ 8 - 3
src/views/home/learn/page-learn-content.vue

@@ -102,6 +102,7 @@
 
 <script>
 import { Toast } from "vant";
+import { mapState } from "vuex";
 export default {
   name: "page-learn-content",
   props: {
@@ -119,7 +120,11 @@ export default {
       commentValue: "" // 即将评论的内容
     };
   },
-  computed: {},
+  computed: {
+    ...mapState({
+      user: state => state.user
+    })
+  },
   created() {},
   mounted() {
     this.getContent();
@@ -182,7 +187,7 @@ export default {
     // 操作:收藏
     clickCollection() {
       let path = {
-        userName: "testuser-ztdxxDGdNj"
+        userName: this.user.userName
       };
       let params = {
         id: this.materialId
@@ -202,7 +207,7 @@ export default {
     // 操作:移除收藏
     clickRemoveCollection() {
       let path = {
-        userName: "testuser-ztdxxDGdNj"
+        userName: this.user.userName
       };
       let params = {
         id: this.materialId