From 7a6686bc0b924683d1cffbed24c2ff78964d4427 Mon Sep 17 00:00:00 2001 From: Mrjing <837317210@qq.com> Date: Mon, 20 Dec 2021 17:02:49 +0800 Subject: [PATCH 1/2] fix: fix bug --- packages/admin/src/components/QrCode/index.tsx | 6 +++++- .../project/operation/Activity/ActivityTable.tsx | 14 ++++++++++++-- packages/cms-openapi/src/api/api.controller.ts | 10 ++++++---- packages/cms-sms-page/src/App.vue | 2 +- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/packages/admin/src/components/QrCode/index.tsx b/packages/admin/src/components/QrCode/index.tsx index 96305afd..9f234cc3 100644 --- a/packages/admin/src/components/QrCode/index.tsx +++ b/packages/admin/src/components/QrCode/index.tsx @@ -13,10 +13,12 @@ export default (props: { actionRef: MutableRefObject<{ show: Function }> + appPath?: string + appPathQuery?: string // 不显示渠道选择器 disableChannel?: boolean }) => { - const { activityId, actionRef, disableChannel } = props + const { activityId, actionRef, disableChannel, appPath, appPathQuery } = props const [{ dataUri, isModalVisible, channel }, setState] = useSetState({ channel: '', @@ -66,6 +68,8 @@ export default (props: { const result = await callWxOpenAPI('generateUrlLink', { path: `/${activityPage}/index.html`, query: `activityId=${activityId}&source=${source}`, + appPath, + appPathQuery, }) copyToClipboard(result.urlLink) diff --git a/packages/admin/src/pages/project/operation/Activity/ActivityTable.tsx b/packages/admin/src/pages/project/operation/Activity/ActivityTable.tsx index 23fb0ab2..b0d467c8 100644 --- a/packages/admin/src/pages/project/operation/Activity/ActivityTable.tsx +++ b/packages/admin/src/pages/project/operation/Activity/ActivityTable.tsx @@ -29,9 +29,12 @@ export const ActivityTable: React.FC<{ const { currentSchema } = props const qrCodeRef = useRef() const ctx = useConcent<{}, ContentCtx>('content') - const [{ activityId }, setState] = useSetState({ + const [{ activityId, appPath, appPathQuery }, setState] = useSetState({ activityId: '', + appPath: '', + appPathQuery: '', }) + const projectId = getProjectId() // 检索的字段 @@ -143,6 +146,8 @@ export const ActivityTable: React.FC<{ onClick={async () => { setState({ activityId: row._id, + appPath: row.appPath, + appPathQuery: row.appPathQuery, }) qrCodeRef.current?.show() }} @@ -269,7 +274,12 @@ export const ActivityTable: React.FC<{ }} /> - + ) } diff --git a/packages/cms-openapi/src/api/api.controller.ts b/packages/cms-openapi/src/api/api.controller.ts index 32aeb11a..f1710ee8 100644 --- a/packages/cms-openapi/src/api/api.controller.ts +++ b/packages/cms-openapi/src/api/api.controller.ts @@ -147,15 +147,17 @@ export class ApiController { */ @UseGuards(PermissionGuard('operation')) @Post('generateUrlLink') - async generateUrlLink(@Body() body: { path: string; query: string }) { - const { path, query } = body + async generateUrlLink( + @Body() body: { path: string; query: string; appPath: string; appPathQuery: string } + ) { + const { path, query, appPath, appPathQuery } = body const envId = getEnvIdString() const wxCloudApp = getWxCloudApp() return wxCloudApp.openapi.urllink.generate({ - path: '', - query: '', + path: appPath, + query: appPathQuery, isExpire: true, expireType: 1, expireInterval: 30, diff --git a/packages/cms-sms-page/src/App.vue b/packages/cms-sms-page/src/App.vue index f0908559..bda34673 100644 --- a/packages/cms-sms-page/src/App.vue +++ b/packages/cms-sms-page/src/App.vue @@ -258,7 +258,7 @@ export default { } if (activity.appPathQuery) { - jumpPath += activity.appPathQuery + jumpPath += `&${activity.appPathQuery}` } console.log('跳转链接', jumpPath) From 4285b3eae887e690337a20fd27a8865683dd415a Mon Sep 17 00:00:00 2001 From: Mrjing <837317210@qq.com> Date: Mon, 20 Dec 2021 17:05:15 +0800 Subject: [PATCH 2/2] v2.13.5 --- lerna.json | 2 +- packages/admin/package.json | 2 +- packages/cms-openapi/package.json | 2 +- packages/cms-sms-page/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index d04006ca..0181cc29 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "packages": ["packages/*"], "npmClient": "yarn", - "version": "2.13.4" + "version": "2.13.5" } diff --git a/packages/admin/package.json b/packages/admin/package.json index 0989c5ac..e33db050 100644 --- a/packages/admin/package.json +++ b/packages/admin/package.json @@ -1,6 +1,6 @@ { "name": "cloudbase-cms-admin", - "version": "2.13.4", + "version": "2.13.5", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/packages/cms-openapi/package.json b/packages/cms-openapi/package.json index 9bb05a1a..a9034854 100644 --- a/packages/cms-openapi/package.json +++ b/packages/cms-openapi/package.json @@ -1,6 +1,6 @@ { "name": "cloudbase-cms-openapi", - "version": "2.13.0", + "version": "2.13.5", "description": "CloudBase content manager system service restful api", "author": "cwuyiqing@gmail.com", "private": true, diff --git a/packages/cms-sms-page/package.json b/packages/cms-sms-page/package.json index 3ea2d6b4..7f2a43c6 100644 --- a/packages/cms-sms-page/package.json +++ b/packages/cms-sms-page/package.json @@ -1,6 +1,6 @@ { "name": "sms-page", - "version": "2.13.0", + "version": "2.13.5", "private": true, "scripts": { "dev": "vue-cli-service serve",