|
@@ -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
|