diff --git a/CHANGELOG.md b/CHANGELOG.md index c096727..befdd68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.1.0-B.20](https://git.1000my.com/project-shenyangk11/sy_k11_H_base_daoshi_vue_ts/compare/v1.1.0-B.19...v1.1.0-B.20) (2023-07-27) + + +### Features + +* 🚀 修改弹框切割问题 ([8b774cb](https://git.1000my.com/project-shenyangk11/sy_k11_H_base_daoshi_vue_ts/commit/8b774cb3890456c316ada0d3dd018d95b8dad9f8)) + + +### Bug Fixes + +* 修改地图文件 ([5bc0c17](https://git.1000my.com/project-shenyangk11/sy_k11_H_base_daoshi_vue_ts/commit/5bc0c176e366ae72bb322630e8ee902fe770747f)) +* 增加首页json读取不到则调用Android的方法重启 ([ecb6732](https://git.1000my.com/project-shenyangk11/sy_k11_H_base_daoshi_vue_ts/commit/ecb6732d4f70fec6960a174f67fb49c565ff69e8)) + ## [1.1.0-B.19](https://git.1000my.com/project-shenyangk11/sy_k11_H_base_daoshi_vue_ts/compare/v1.1.0-B.18...v1.1.0-B.19) (2023-07-24) diff --git a/package-lock.json b/package-lock.json index 9a54441..18d2cda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue_cli_ts", - "version": "1.1.0-B.19", + "version": "1.1.0-B.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vue_cli_ts", - "version": "1.1.0-B.19", + "version": "1.1.0-B.20", "dependencies": { "@better-scroll/core": "^2.5.0", "@better-scroll/observe-image": "^2.5.0", diff --git a/package.json b/package.json index 7935f41..e70d803 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue_cli_ts", - "version": "1.1.0-B.19", + "version": "1.1.0-B.20", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/composables/useInitConfigAndMallInfo.ts b/src/composables/useInitConfigAndMallInfo.ts index 8233ca6..6e30517 100644 --- a/src/composables/useInitConfigAndMallInfo.ts +++ b/src/composables/useInitConfigAndMallInfo.ts @@ -53,7 +53,9 @@ export const useInitConfigAndMallInfo = async () => { store.SET_MENU_LIST(_menuList.data) store.SET_PICTURE_LIST(_pictureList.data) } catch (error) { + console.log('开机读取JSON报错 :>> ', JSON.stringify(error)) Message({ text: '初始化数据失败', type: 'success' }) + window.android.restartWebView() } } diff --git a/src/http/http.ts b/src/http/http.ts index d3cd159..afece98 100644 --- a/src/http/http.ts +++ b/src/http/http.ts @@ -54,19 +54,58 @@ class Request { if (config.interceptors?.requestInterceptors) { config = config.interceptors.requestInterceptors(config as any) } + const checkJsonList = [ + 'getDevCoordinateByIP', + 'getMapInfo', + 'getFacilityList', + 'GetWeather', + 'getBrandShopListByFloor', + 'getBrandShopListByIndustryId', + 'getBrandShopList', + 'getModuleList', + 'getArtList' + ] this.instance .request(config) .then(res => { - console.log('axios获取数据 :>> ', JSON.stringify(res)) + if ( + config.url && + config.url?.search('getMap.json') <= 0 && + config.url?.search('getMapInfo.json') <= 0 && + config.url?.search('getBrandShopListByFloor.json') <= 0 && + config.url?.search('getBrandShopListByIndustryId.json') <= 0 + ) { + console.log('axios获取数据 :>> ', JSON.stringify(res)) + } // 如果为单个响应设置拦截器,使用单个响应的拦截器 if (config.interceptors?.responseInterceptors) { res = config.interceptors.responseInterceptors(res) } - + if (config.url && Object(res).code !== 200) { + for (let t = 0; t < checkJsonList.length; t++) { + const element = checkJsonList[t] + if (config.url.search(element) > 0) { + console.log('开机读取JSON报错 :>> ') + window?.android?.restartWebView() + break + } + } + } resolve(res) }) .catch((err: any) => { console.log('axios获取数据失败 :==>> ', JSON.stringify(err)) + + if (config.url) { + for (let t = 0; t < checkJsonList.length; t++) { + const element = checkJsonList[t] + if (config.url.search(element) > 0) { + console.log('catch开机读取JSON报错 :>> ') + window.android.restartWebView() + break + } + } + } reject(err) }) }) diff --git a/src/types/window.d.ts b/src/types/window.d.ts index c65a27a..6389077 100644 --- a/src/types/window.d.ts +++ b/src/types/window.d.ts @@ -4,6 +4,7 @@ leaveScreenSave() 离开屏保需要调用我这里的方法 */ type Android = { goScreenSave: () => void + restartWebView: () => void } declare interface Window { android: Android