Sfoglia il codice sorgente

添加收藏和取消收藏

aaa 4 anni fa
parent
commit
d7e90709c9

+ 7 - 6
src/views/home/learn/page-learn-content.vue

@@ -187,15 +187,16 @@ export default {
     // 操作:收藏
     clickCollection() {
       let path = {
-        userName: this.user.userName
+        userName: this.user.userInfo.userName
       };
       let params = {
         id: this.materialId
       };
       this.$_http
-        .get(this.$pathParams(this.$_API.JTXT_POST_FAVORITE_MATERIALID, path), {
+        .post(
+          this.$pathParams(this.$_API.JTXT_POST_FAVORITE_MATERIALID, path),
           params
-        })
+        )
         .then(res => {
           console.log("--收藏--", res.data);
           this.isCollected = true;
@@ -207,9 +208,9 @@ export default {
     // 操作:移除收藏
     clickRemoveCollection() {
       let path = {
-        userName: this.user.userName
+        userName: this.user.userInfo.userName
       };
-      let params = {
+      let data = {
         id: this.materialId
       };
       this.$_http
@@ -219,7 +220,7 @@ export default {
             path
           ),
           {
-            params
+            data: data
           }
         )
         .then(res => {

+ 1 - 1
src/views/home/person/collection.vue

@@ -52,7 +52,7 @@ export default {
   methods: {
     getFavorites() {
       let path = {
-        userName: this.user.userName
+        userName: this.user.userInfo.userName
       };
       this.$_http
         .get(this.$pathParams(this.$_API.JTXT_GET_USER_FAVORITES, path))

+ 1 - 1
src/views/home/person/exam-history.vue

@@ -61,7 +61,7 @@ export default {
   methods: {
     getExamHistory() {
       let params = {
-        user: this.user.userName
+        user: this.user.userInfo.userName
       };
       this.$_http
         .get(this.$_API.JTXT_GET_USER_EXAMS_HISTORY, { params })

+ 2 - 2
src/views/home/person/page-person.vue

@@ -91,7 +91,7 @@ export default {
     //   获取今日分数
     getDailyPoints() {
       let path = {
-        userName: this.user.userName
+        userName: this.user.userInfo.userName
       };
       this.$_http
         .get(this.$pathParams(this.$_API.JTXT_GET_USER_DAIYL_POINTS, path))
@@ -106,7 +106,7 @@ export default {
     //   查询总积分
     getAllPoints() {
       let path = {
-        userName: this.user.userName
+        userName: this.user.userInfo.userName
       };
       this.$_http
         .get(this.$pathParams(this.$_API.JTXT_GET_USER_ALL_POINTS, path))

+ 1 - 1
src/views/home/person/rank.vue

@@ -64,7 +64,7 @@ export default {
   methods: {
     getFavorites() {
       let path = {
-        userName: this.user.userName
+        userName: this.user.userInfo.userName
       };
       this.$_http
         .get(this.$pathParams(this.$_API.JTXT_GET_USER_FAVORITES, path))