From 4d02e461c5f126b031b5614efeb728ba5b073040 Mon Sep 17 00:00:00 2001 From: "@zuopngfei" Date: Fri, 18 Jul 2025 17:55:47 +0800 Subject: [PATCH] dsds --- app.json | 1 + {assets/js => pages/home}/heightWeight.js | 0 pages/home/index.js | 2 +- pages/home/index.json | 1 - pages/login/login.js | 2 +- utils/aesCryptoJS.js | 6 ------ utils/util.js | 7 +++++++ 7 files changed, 10 insertions(+), 9 deletions(-) rename {assets/js => pages/home}/heightWeight.js (100%) delete mode 100644 utils/aesCryptoJS.js diff --git a/app.json b/app.json index 344d6a8..92d5197 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,6 @@ { "pages": ["pages/patients/index", "pages/my/index"], + "lazyCodeLoading": "requiredComponents", "usingComponents": { "t-toast": "tdesign-miniprogram/toast/toast" }, diff --git a/assets/js/heightWeight.js b/pages/home/heightWeight.js similarity index 100% rename from assets/js/heightWeight.js rename to pages/home/heightWeight.js diff --git a/pages/home/index.js b/pages/home/index.js index d476d0e..5c37551 100644 --- a/pages/home/index.js +++ b/pages/home/index.js @@ -1,6 +1,6 @@ import * as echarts from '../../ec-canvas/echarts.min'; import request from '~/api/request'; -import { heightList, weightList } from '~/assets/js/heightWeight'; +import { heightList, weightList } from './heightWeight'; const app = getApp(); Page({ diff --git a/pages/home/index.json b/pages/home/index.json index 633d109..dedaa19 100644 --- a/pages/home/index.json +++ b/pages/home/index.json @@ -2,7 +2,6 @@ "navigationStyle": "custom", "navigationBarTitleText": "首页", "usingComponents": { - "t-button": "tdesign-miniprogram/button/button", "ec-canvas": "../../ec-canvas/ec-canvas", "t-col": "tdesign-miniprogram/col/col", "t-row": "tdesign-miniprogram/row/row", diff --git a/pages/login/login.js b/pages/login/login.js index 522dd4b..996906e 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -1,6 +1,6 @@ import request from '~/api/request'; import { resetTokenInvalid } from '~/api/request'; -import aesCryptoJS from '~/utils/aesCryptoJS.js'; +import { aesCryptoJS } from '~/utils/util'; Page({ data: { diff --git a/utils/aesCryptoJS.js b/utils/aesCryptoJS.js deleted file mode 100644 index 0727fdc..0000000 --- a/utils/aesCryptoJS.js +++ /dev/null @@ -1,6 +0,0 @@ -import CryptoJS from "crypto-js"; - -const aesCryptoJS = function (text) { - return CryptoJS.MD5(text).toString() -} -export default aesCryptoJS; \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index 98b7b71..c3182eb 100644 --- a/utils/util.js +++ b/utils/util.js @@ -1,3 +1,5 @@ +import CryptoJS from "crypto-js"; + const formatNumber = (n) => { n = n.toString(); return n[1] ? n : `0${n}`; @@ -22,7 +24,12 @@ const getLocalUrl = (path, name) => { return tempFileName; }; +const aesCryptoJS = function (text) { + return CryptoJS.MD5(text).toString() +} + module.exports = { formatTime, getLocalUrl, + aesCryptoJS };