From 395f4f5f01b568d56790b3adda148e0183e81019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Tue, 19 Nov 2024 11:39:48 +0800 Subject: [PATCH] chore: replace api and release version (#562) --- packages/components/package.json | 2 +- .../src/components/td-header/index.js | 22 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index d07d870f..b5e4afab 100755 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "tdesign-site-components", - "version": "0.15.5", + "version": "0.15.6", "main": "lib/site.es.js", "scripts": { "dev": "vite", diff --git a/packages/components/src/components/td-header/index.js b/packages/components/src/components/td-header/index.js index 8c84e519..97f05d96 100755 --- a/packages/components/src/components/td-header/index.js +++ b/packages/components/src/components/td-header/index.js @@ -230,20 +230,14 @@ export default define({ get: (_host, lastValue) => lastValue || {}, set: (_host, value) => value, connect: (host) => { - allComponentsNpmUrl.forEach((item) => { - // flutter is not a npm package - if (item === 'tdesign-flutter') return; - fetch(`https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/npm/versions/${item}`) - .then((res) => res.json()) - .then((res) => { - const latestVersion = res?.['dist-tags']?.['latest']; - host.npmVersions = { - ...host.npmVersions, - [item]: latestVersion, - }; - }) - .catch(console.error); - }); + fetch(`https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/npm/latest-versions`) + .then((res) => res.json()) + .then((res) => { + host.npmVersions = { + ...res, + }; + }) + .catch(console.error); }, }, collapseMenu: {