From abbd7d18ea431ee8b6b8e634abf3e8ccb1fbb1b3 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 28 三月 2025 18:43:33 +0800
Subject: [PATCH] 登录迁移

---
 packageCourse/components/teaching/index.js |  101 +++++++++++++++++++++++++++-----------------------
 1 files changed, 54 insertions(+), 47 deletions(-)

diff --git a/packageCourse/components/teaching/index.js b/packageCourse/components/teaching/index.js
index d6476b8..3d3b478 100644
--- a/packageCourse/components/teaching/index.js
+++ b/packageCourse/components/teaching/index.js
@@ -96,56 +96,63 @@
                 cmsPath: data.productLinkPath
               })
               .then((res) => {
-                const dataTeach = res.datas.cmsDatas[0]?.datas.find(
-                  (item) => item.refCode == 'jsek_interaction'
-                )
-                app.MG.store
-                  .getProductDetail({
-                    path: '*',
-                    queryType: '*',
-                    productId: this.properties.bookId,
-                    cmsPath: dataTeach.productLinkPath
-                  })
-                  .then((res) => {
-                    let datas = res.datas.cmsDatas[0] ? res.datas.cmsDatas[0].datas : []
-                    const dataRes = []
-                    if (datas?.length > 0) {
-                      datas.forEach(async (item) => {
-                        const cmsRes = await app.MG.store
-                          .getProductDetail({
-                            path: '*',
-                            queryType: '*',
-                            productId: this.properties.bookId,
-                            cmsPath: item.productLinkPath
+                try {
+                  const dataTeach = res.datas.cmsDatas[0]?.datas.find(
+                    (item) => item.refCode == 'jsek_interaction'
+                  )
+                  app.MG.store
+                    .getProductDetail({
+                      path: '*',
+                      queryType: '*',
+                      productId: this.properties.bookId,
+                      cmsPath: dataTeach.productLinkPath
+                    })
+                    .then((res) => {
+                      let datas = res.datas.cmsDatas[0] ? res.datas.cmsDatas[0].datas : []
+                      const dataRes = []
+                      if (datas?.length > 0) {
+                        datas.forEach(async (item) => {
+                          const cmsRes = await app.MG.store
+                            .getProductDetail({
+                              path: '*',
+                              queryType: '*',
+                              productId: this.properties.bookId,
+                              cmsPath: item.productLinkPath
+                            })
+                          if (
+                            cmsRes.datas.cmsDatas[0].datas &&
+                            cmsRes.datas.cmsDatas[0].datas.length > 0
+                          ) {
+                            cmsRes.datas.cmsDatas[0].datas.forEach((item, i) => {
+                              item.subList = []
+                              item.updateDate = '-'
+                              if (this.data.dataList.length > 0) {
+                                this.data.dataList.forEach((mitem) => {
+                                  if (mitem.name == item.name) {
+                                    item.updateDate = moment(mitem.updateDate).format(
+                                      'YYYY-MM-DD HH:mm:ss'
+                                    )
+                                    item.subList.push(mitem)
+                                  }
+                                })
+                              }
+                              dataRes.push(item)
+                            })
+                          }
+                          const resList = dataRes.sort((a, b) => b.subList.length - a.subList.length)
+                          this.setData({
+                            cmsDataList: resList,
+                            loading: false
                           })
-                        if (
-                          cmsRes.datas.cmsDatas[0].datas &&
-                          cmsRes.datas.cmsDatas[0].datas.length > 0
-                        ) {
-                          cmsRes.datas.cmsDatas[0].datas.forEach((item, i) => {
-                            item.subList = []
-                            item.updateDate = '-'
-                            if (this.data.dataList.length > 0) {
-                              this.data.dataList.forEach((mitem) => {
-                                if (mitem.name == item.name) {
-                                  item.updateDate = moment(mitem.updateDate).format(
-                                    'YYYY-MM-DD HH:mm:ss'
-                                  )
-                                  item.subList.push(mitem)
-                                }
-                              })
-                            }
-                            dataRes.push(item)
-                          })
-                        }
-                        const resList = dataRes.sort((a, b) => b.subList.length - a.subList.length)
-                        this.setData({
-                          cmsDataList: resList,
-                          loading: false
                         })
-                      })
-                    }
+                      }
+                    })
+                } catch (error) {
+                  this.setData({
+                    cmsDataList: [],
+                    loading: false
                   })
+                }
               })
           } catch (error) {
             this.setData({

--
Gitblit v1.9.1