PDF2需求修复 - v1.16
## 修复 1. 资源对接:去掉"擅长什么"只保留两项 2. 资源对接:需登录+购买章节才能使用 3. 手机号API:修复AppSecret配置错误 4. 小程序码API:修复AppSecret配置错误 5. 获取地址:增强错误处理 ## AppSecret统一 - qrcode/phone API统一使用正确的AppSecret Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -185,7 +185,7 @@ Page({
|
||||
|
||||
// 生成推广海报
|
||||
async generatePoster() {
|
||||
wx.showLoading({ title: '生成中...' })
|
||||
wx.showLoading({ title: '生成中...', mask: true })
|
||||
this.setData({ showPosterModal: true, isGeneratingPoster: true })
|
||||
|
||||
try {
|
||||
@@ -196,16 +196,29 @@ Page({
|
||||
// 获取小程序码(带推荐人参数)
|
||||
let qrcodeImage = null
|
||||
try {
|
||||
// scene格式:ref=用户ID前20位
|
||||
const scene = userId ? `ref=${userId.slice(0,20)}` : 'ref=soul'
|
||||
console.log('[Poster] 请求小程序码, scene:', scene)
|
||||
|
||||
const qrRes = await app.request('/api/miniprogram/qrcode', {
|
||||
method: 'POST',
|
||||
data: { scene, page: 'pages/index/index', width: 280 }
|
||||
data: {
|
||||
scene,
|
||||
page: 'pages/index/index',
|
||||
width: 280
|
||||
}
|
||||
})
|
||||
if (qrRes.success && qrRes.image) {
|
||||
|
||||
console.log('[Poster] 小程序码响应:', qrRes?.success, qrRes?.image?.length)
|
||||
|
||||
if (qrRes && qrRes.success && qrRes.image) {
|
||||
qrcodeImage = qrRes.image
|
||||
console.log('[Poster] 小程序码获取成功')
|
||||
} else {
|
||||
console.log('[Poster] 响应无效:', qrRes)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('[Poster] 获取小程序码失败,使用占位符')
|
||||
console.error('[Poster] 获取小程序码失败:', e)
|
||||
}
|
||||
|
||||
// 海报尺寸 300x450
|
||||
|
||||
Reference in New Issue
Block a user