Skip to content

Commit

Permalink
Merge pull request #141 from TencentCloudBase/hotfix/fix_bug
Browse files Browse the repository at this point in the history
fix: fix bug
  • Loading branch information
Mrjing authored Dec 21, 2021
2 parents 0997d66 + 4285b3e commit 5139ce8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"version": "2.13.4"
"version": "2.13.5"
}
2 changes: 1 addition & 1 deletion packages/admin/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 5 additions & 1 deletion packages/admin/src/components/QrCode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ export const ActivityTable: React.FC<{
const { currentSchema } = props
const qrCodeRef = useRef<any>()
const ctx = useConcent<{}, ContentCtx>('content')
const [{ activityId }, setState] = useSetState({
const [{ activityId, appPath, appPathQuery }, setState] = useSetState({
activityId: '',
appPath: '',
appPathQuery: '',
})

const projectId = getProjectId()

// 检索的字段
Expand Down Expand Up @@ -143,6 +146,8 @@ export const ActivityTable: React.FC<{
onClick={async () => {
setState({
activityId: row._id,
appPath: row.appPath,
appPathQuery: row.appPathQuery,
})
qrCodeRef.current?.show()
}}
Expand Down Expand Up @@ -269,7 +274,12 @@ export const ActivityTable: React.FC<{
}}
/>

<QrCode activityId={activityId} actionRef={qrCodeRef} />
<QrCode
activityId={activityId}
actionRef={qrCodeRef}
appPath={appPath}
appPathQuery={appPathQuery}
/>
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cms-openapi/package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"private": true,
Expand Down
10 changes: 6 additions & 4 deletions packages/cms-openapi/src/api/api.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/cms-sms-page/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sms-page",
"version": "2.13.0",
"version": "2.13.5",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion packages/cms-sms-page/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export default {
}
if (activity.appPathQuery) {
jumpPath += activity.appPathQuery
jumpPath += `&${activity.appPathQuery}`
}
console.log('跳转链接', jumpPath)
Expand Down

0 comments on commit 5139ce8

Please sign in to comment.