|
@@ -1,28 +1,6 @@
|
|
|
import Taro from "@tarojs/taro";
|
|
|
import indexStore from "@src/store/index";
|
|
|
import { setApp } from "@src/config";
|
|
|
-/**
|
|
|
- * 获取小程序组件配置列表
|
|
|
- * */
|
|
|
-// export function getAppComponent() {
|
|
|
-// return new Promise(async (resolve, reject) => {
|
|
|
-// try {
|
|
|
-// // 初始化
|
|
|
-// Taro.request({
|
|
|
-// url: '/app/appComponent/list',
|
|
|
-// method: 'GET',
|
|
|
-// success: (res) => {
|
|
|
-// resolve(res)
|
|
|
-// },
|
|
|
-// fail: (err) => {
|
|
|
-// reject(err);
|
|
|
-// }
|
|
|
-// })
|
|
|
-// } catch (error) {
|
|
|
-// reject(error);
|
|
|
-// }
|
|
|
-// })
|
|
|
-// }
|
|
|
|
|
|
|
|
|
|
|
@@ -38,9 +16,7 @@ export function getShortBanners(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexBanners) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexBanners: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexBanners: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -64,9 +40,7 @@ export function getShortHotCategory(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexHotCategory) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexHotCategory: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexHotCategory: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -90,9 +64,7 @@ export function getShortNewBooks(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexNewBooks) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexNewBooks: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexNewBooks: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -116,9 +88,7 @@ export function getShortHotRec(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexHotRec) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexHotRec: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexHotRec: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -142,9 +112,7 @@ export function getShortBestReviews(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexBestReviews) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexBestReviews: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexBestReviews: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -168,9 +136,7 @@ export function getShortClassicBooks(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexClassicBooks) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexClassicBooks: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexClassicBooks: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -194,9 +160,7 @@ export function getShortBestBooks(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexBestBooks) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexBestBooks: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexBestBooks: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -220,9 +184,7 @@ export function getShortGuessLike(data) {
|
|
|
method: 'GET',
|
|
|
data,
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexGuessLike) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexGuessLike: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexGuessLike: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|
|
@@ -247,9 +209,7 @@ export function getShortHotBooks(workDirection) {
|
|
|
method: 'GET',
|
|
|
data: { workDirection },
|
|
|
success: (res) => {
|
|
|
- if(JSON.stringify(indexStore.indexHotBooks) !== JSON.stringify(res.data.data)){
|
|
|
- indexStore.setData({ indexHotBooks: res.data.data })
|
|
|
- }
|
|
|
+ indexStore.setData({ indexHotBooks: res.data.data })
|
|
|
resolve(res)
|
|
|
},
|
|
|
fail: (err) => {
|