12345678910111213141516171819202122232425262728293031 |
- import request from '@/utils/request'
- // 获取不限制的小程序码
- export function getUnlimitedQRCode(data = {}) {
- // 从本地存储获取用户类型和用户ID
- const userType = uni.getStorageSync('userType') || '';
- const userId = uni.getStorageSync('userId') || '';
-
- // 打印日志,便于调试
- console.log('从本地存储获取用户信息:', { userType, userId });
-
- return request({
- url: '/core/InviteUser/getInviteQrCode',
- method: 'get',
- params: {
- // scene: data.scene, // 最大32个可见字符,只支持数字,大小写英文以及部分特殊字符
- // page: data.page, // 默认是主页,页面 page,例如 pages/index/index
- // check_path: data.check_path || true, // 默认是true,检查page 是否存在
- // env_version: data.env_version || 'release', // 要打开的小程序版本。正式版为 "release",体验版为 "trial",开发版为 "develop"
- // width: data.width || 430, // 二维码的宽度,单位 px,最小 280px,最大 1280px
- // auto_color: data.auto_color || false, // 自动配置线条颜色
- // line_color: data.line_color || { r: 0, g: 0, b: 0 }, // 使用 rgb 设置颜色
- // is_hyaline: data.is_hyaline || false, // 是否需要透明底色
- referrerType: userType, // 使用本地存储的 userType
- referrerId: userId, // 使用本地存储的 userId
- page:'pages/login',
- scene: data.scene || `${userType}:${userId}`, // 同样使用本地存储的值生成 scene
- },
- // responseType: 'arraybuffer', // 设置响应类型为arraybuffer,因为返回的是图片二进制内容
- })
- }
|