Skip to content

Commit d0951f9

Browse files
authored
docs(changelog): standardize according to the new rules (#3730)
* docs(changelog): standardize according to the new rules * chore: update the layout component routing of the site * chore: update the QR code of the page * fix: fix cr
1 parent 5e7a278 commit d0951f9

8 files changed

Lines changed: 2409 additions & 2380 deletions

File tree

CHANGELOG.md

Lines changed: 1125 additions & 1084 deletions
Large diffs are not rendered by default.

changelogs/CHANGELOG-0.x.md

Lines changed: 1261 additions & 1284 deletions
Large diffs are not rendered by default.

script/qrcode/index.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const isExistStr = (str, arr) => {
1313
return arr.includes(temp);
1414
};
1515

16+
const isSkylinePage = (str) => {
17+
return str.includes('skyline');
18+
};
19+
1620
const getImageList = () => {
1721
const imageFolderDir = path.resolve(__dirname, `../../site/public/assets/qrcode`);
1822
const images = fs.readdirSync(imageFolderDir);
@@ -26,14 +30,19 @@ const getImageList = () => {
2630
const getNewPageList = (list) => {
2731
const pageList = [];
2832
const imageOldList = getImageList();
33+
2934
list.forEach((item) => {
3035
if (Object.prototype.toString.call(item) === '[object Object]') {
3136
item.pages.forEach((subItem) => {
32-
if (!isExistStr(item.root + subItem, imageOldList)) {
37+
if (
38+
item.root === subItem &&
39+
!isExistStr(item.root + subItem, imageOldList) &&
40+
!isSkylinePage(`${item.root}${subItem}`)
41+
) {
3342
pageList.push(item.root + subItem);
3443
}
3544
});
36-
} else if (!isExistStr(item, imageOldList)) {
45+
} else if (!isExistStr(item, imageOldList) && !isSkylinePage(item)) {
3746
pageList.push(item);
3847
}
3948
});
@@ -45,7 +54,7 @@ const getUnlimitedQRCodeImage = (appid, appSecret) => {
4554
getAccessToken(appid, appSecret).then((e) => {
4655
if (e.access_token) {
4756
const token = e.access_token;
48-
console.log('==access_token 2h内有效=', token);
57+
console.log('access_token 2h内有效', token);
4958
const baseParameter = {
5059
width: 280, // 小程序码大小
5160
// check_path: false,
@@ -65,8 +74,8 @@ const getUnlimitedQRCodeImage = (appid, appSecret) => {
6574
page: item, // 扫码进入的小程序页面路径
6675
scene: `name=${temp[0]}`, // 标识
6776
};
68-
getUnlimitedQRCode(token, JSON.stringify({ ...specialParameter, ...baseParameter }), { ...baseConfig }).then(
69-
(res) => {
77+
getUnlimitedQRCode(token, JSON.stringify({ ...specialParameter, ...baseParameter }), { ...baseConfig })
78+
.then((res) => {
7079
// 因为微信接口 getwxacodeunlimit 成功时返回的是 Buffer ,失败时返回 JSON 结构。这里把返回数据全部当成 Buffer 处理,所以 res.length < 200, 则表示获取失败。
7180
if (res.length < 200) {
7281
const { errcode, errmsg } = JSON.parse(res.toString());
@@ -90,8 +99,10 @@ const getUnlimitedQRCodeImage = (appid, appSecret) => {
9099
}
91100
},
92101
);
93-
},
94-
);
102+
})
103+
.catch((e) => {
104+
console.log(e);
105+
});
95106
});
96107
}
97108
});

site/plugin-tdoc/component.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ export default defineComponent({
6363
},
6464
name() {
6565
const { path } = this.$route;
66-
return path.slice(path.lastIndexOf('/') + 1);
66+
const name = path.slice(path.lastIndexOf('/') + 1);
67+
68+
return name === 'layout' ? 'col' : name;
6769
},
6870
liveUrl() {
6971
return `//tdesign.tencent.com/miniprogram-live/m2w/program/miniprogram/#!pages/${this.name}/${this.name}.html`;
7072
},
7173
qrcode() {
72-
const { path } = this.$route;
73-
const name = path.slice(path.lastIndexOf('/') + 1);
7474
// new URL(): https://cn.vitejs.dev/guide/assets.html#new-url-url-import-meta-url
75-
return new URL(`../public/assets/qrcode/${name}.png`, import.meta.url).href;
75+
return new URL(`../public/assets/qrcode/${this.name}.png`, import.meta.url).href;
7676
},
7777
},
7878

site/public/assets/qrcode/col.png

43.5 KB
Loading
47 KB
Loading
44.3 KB
Loading

site/site.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const docs = [
121121
titleEn: 'Layout',
122122
name: 'layout',
123123
meta: { docType: 'base' },
124-
path: '/miniprogram/components/col',
124+
path: '/miniprogram/components/layout',
125125
component: () => import('@/col/README.md'),
126126
},
127127
{

0 commit comments

Comments
 (0)