微信开放社区
服务商入驻
文档
登录
正在加载...

微信云托管官网

关注
公告
招募进行时:微信云开发「KOL技术实践官」,等你来解锁新技能!2024-04-15
全部公告
发帖

最热问题
  • 全部
  • 文章
  • 问答

全部
运营
审核
API和组件
框架
管理后台
开发者工具
客户端
插件
云开发
教程反馈
其它
最新提问最热问题
  • 置顶为什么我看不到有在运行的流水线但一直报错?

    [图片]

    2024-08-19
    11882
    啊哦啊哦

    一样

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶为什么即便我设置了时区,我查到的当天的时间都不对?

    public static Date getStartOfTheDay() { LocalDate currentDate = LocalDate.now(); // 将当前日期和零点时间合并 LocalDateTime currentDateTime = LocalDateTime.of(currentDate, LocalTime.MIDNIGHT); // 获取0点的Date对象 return Date.from(currentDateTime.atZone(java.time.ZoneId.of("Asia/Shanghai")).toInstant()); } public static Date getEndOfTheDay() { LocalDate currentDate = LocalDate.now(); // 将当前日期和零点时间合并 LocalDateTime currentDateTime = LocalDateTime.of(currentDate, LocalTime.MAX); // 获取0点的Date对象 return Date.from(currentDateTime.atZone(java.time.ZoneId.of("Asia/Shanghai")).toInstant()); } 上面是我的代码,我在零点多一点的时候,执行了以上的代码,并且写了一段这样的日志: log.info("the start date is: {} and the end date is: {}", TimeUtils.getStartOfTheDay(), TimeUtils.getEndOfTheDay()); 打出来的时间却是两天前的: 09/27 00:41:20 blood-sugar-dev-133 2024-09-26T16:41:19.814Z INFO 1 --- [blood-sugar-monitor] [nio-8080-exec-9] c.p.u.h.B.dao.impl.FoodDao : the start date is: Wed Sep 25 16:00:00 GMT 2024 and the end date is: Thu Sep 26 15:59:59 GMT 2024 如果是因为时区问题也可以理解,当前的GMT时间是26号,但是就算这样出来的时间也应该是26的0点-23:59吧?

    2024-09-27
    11868
    showms

    LocalDateTime currentDateTime = LocalDateTime.of(currentDate, LocalTime.MAX);

    以你这句代码为例,本质上你是先获取了当天最晚时间,如果当前是09-27号,utc+0时区,那么这句执行完currentDateTime已经是2024-09-27 23:59:59了,然后你再转成东八区Date.from(currentDateTime.atZone(java.time.ZoneId.of("Asia/Shanghai")).toInstant());,时间当然就错了

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 3
    1
  • 置顶小程序使用云托管后,接口API传输数据,还需要自己开发加解密吗?

    小程序使用云托管后,别人还能抓包吗?

    2024-08-12
    21864
    showms

    抓不了,除非你是用公网访问接口

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶模版二次开发,为什么无法fork?

    Error: fork 仓库失超过最大重试次数 bid: 51391360Error: fork 仓库失败,超过最大重试次数 bid: 51391360模板二次开发 使用模板二次开发会复制代码到指定仓库,并自动创建该仓库 CI/CD 流水线, 二次开发后代码 Push 即可触发部署更新。 我这个页面点击继续后,每次都失败

    03-18
    11867
    🍊🐟🐑

    我也一直失败,解决了吗

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶微信云托管静态资源域名提示非非微信官方页面该如何处理?

    如题

    02-12
    11864
    智能回答
    针对您提到的微信云托管静态资源域名提示非微信官方页面的问题,您可以按照以下步骤进行处理: **一、检查域名备案情况** 确保您使用的域名已经完成了备案。如果域名未备案,将无法访问。您可以前往腾讯云进行域名备案。 **二、确认自定义域名绑定** 如果您使用的是自定义域名,请确保已经按照以下步骤进行了正确绑定: 1. 前往微信云托管-服务管理 - 自定义域名,点击「绑定自定义域名」; 2. 关联服务并填写正确的域名信息; 3. 上传HTTPS访问所需的证书和私钥; 4. 添加CNAME记录,将域名指向微信云托管返回的服务CNAME域名。 **三、检查HTTPS配置** 确保您的自定义域名已经正确配置了HTTPS证书。如果证书配置不正确,也可能导致浏览器提示非官方页面。 **四、等待配置生效** 有时候配置的更改需要一定时间才能生效,通常需要等待几分钟到几小时不等。 **五、检查其他配置** 确认您的静态资源配置、缓存配置等没有问题,这些配置错误也可能导致类似的问题出现。 如果按照以上步骤操作后问题仍然存在,建议您联系微信云托管的客服或技术支持获取进一步的帮助。

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
  • 置顶使用了云托管,服务端获取不到X-WX-OPENID?

    小程序使用wx.cloud.callContainer调用了云托管服务端的接口,但是服务端并没有接收道Header中的X-WX-OPENID是什么原因呢

    2024-04-01
    11853
    曾洋
    同问。用wx.cloud.callContainerd调用,但是没有X-WX-OPENID,为啥呢。
    

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶express中有上传文件的api, 云托管callContainer的方式如何上传文件?

    我有一个express服务,其中有个api是用于上传文件,代码见如下。 export async function upload(req: express.Request, res: express.Response) { if (!req.files || !req.files.file) { res.status(400).send('未上传文件'); return; } try { //@ts-ignore const uploadedFile = req.files.file; //@ts-ignore const fileBuffer = uploadedFile.data; // 获取文件的 Buffer //@ts-ignore const fileName = uploadedFile.name; const url = await uploadBuffer(fileBuffer, fileName) res.status(200).json({ url }) } catch (ex) { //@ts-ignore res.status(500).json({ msg: ex.msg }) } } 在微信小程序中通过如下代码上传 export async function uploadFile(filePath: string): Promise<string> { const token = wx.getStorageSync("token") return new Promise((resolve, reject) => { wx.uploadFile({ url: env.baseUrl + "/file/upload", filePath: filePath, header: { "Authorization": `Bearer ${token}` }, name: 'file', success(res) { if (res.statusCode == 200) { const json = JSON.parse(res.data) as { url: string } resolve(json.url) return; } reject(res.errMsg) }, fail(e) { reject(e.errMsg) } }) }) } 现在因为一些原因我需要通过微信云托管去提供后端服务,我现在的问题是,我该如何通过callContainer或者其他的方式去上传文件?我不想上传到微信云的文件存储系统,我想通过调用我的后端api去完成文件的上传。 谢谢。

    05-24
    21840
    Alfred Huang

    callContainer 有请求大小限制,不建议用于上传文件

    可以使用云托管的 https 链路用于上传文件,走的标准 https 协议。

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶C#程序 微信云托管是不是只支持Web应用和Http,像控制台就无法部署?

    看官方提供的demo是Web程序,自己的控制台程序是按照官方目录来的,Dockerfile也是,但是部署失败了,不清楚是不是必须要Web应用啊,通信协议也必须是Http

    2024-09-27
    11843
    水蓝

    只要是正常的Docker都能运行的啊,只不过不是http协议的话,没法代理,也就没法访问到,要么就只能是内部连接到外面了。

    看看外面是不是也会部署失败,可以把失败日志贴一下

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶我在微信云托管中保存了一个文件,会不会发生错误。微信云托管有没有内置的磁盘空间?

    # 创建Word文档 def create_word_document(image_paths, doc_name): doc = Document() # 按3张图片一行进行排版 for i in range(0, len(image_paths), 3): # 添加一个表格,3列1行 table = doc.add_table(rows=1, cols=3) table.autofit = False table.allow_autofit = False # 插入图片到表格中 for j in range(3): if i + j < len(image_paths): cell = table.cell(0, j) paragraph = cell.paragraphs[0] run = paragraph.add_run() run.add_picture(image_paths[i + j], width=Inches(2.0)) # 保存Word文档 doc.save(doc_name) return doc_name

    03-29
    21798
    Mr.Zhao
    只能临时保存,你代码都写出来了,试试不就清楚了

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶nginx部署一直404访问不通,不知道为啥日志打印出来的就是不走location配置的代理服务器?

    user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; server { listen 443; server_name holmes-center-front-86714-6-1323419690.sh.run.tcloudbase.com; index index.html index.htm; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; # 生产环境 location /prod-api/ { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_intercept_errors on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass https://dlnmpwnf.xx.hahsntqc.ie54110f.com; } location / { root /usr/share/nginx/html; try_files $uri $uri/ /index.html; index index.html index.htm; } location = /50x.html { root /usr/share/nginx/html; } } } nginx配置如上: 2024/01/15 06:56:51 [error] 37#37: *99 open() "/usr/share/nginx/html/prod-api/captchaImage" failed (2: No such file or directory), client: 10.40.254.165, server: localhost, request: "GET /prod-api/captchaImage HTTP/1.1", host: "holmes-center-front-86714-6-1323419690.sh.run.tcloudbase.com", referrer: "https://holmes-center-front-86714-6-1323419690.sh.run.tcloudbase.com/login?redirect=%2Findex" 不去走代理配置的location ,反而去走了/usr/share/nginx/html/prod-api/captchaImage本地路径,配置了好久没成功,问题应该出在了ngxin配置上,求解带!

    2024-01-15
    11768
    喵不拉几

    已解决

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    2
  • 置顶大佬们可以直接修改云托管服务里的文件吗?每次修改都要重新部署吗

    大佬们可以直接修改云托管服务里的文件吗?每次修改都要重新部署吗?发布成功的容器不支持上传文件吗?怎么停止服务的运行?为什么不支持修改和上传?

    2024-09-14
    21751
    showms

    不建议修改。如果有需要修改的文件,还是放云存储吧

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶利用微信云托管,postman请求正常,但微信小程序客户端访问失败,什么原因?

    微信小程序客户端报错如下: [object Object] errno: 600002 errMsg: "request:fail url not in domain list"

    03-18
    41703
    showms

    云托管的服务如果想通过wx.request方式访问(也就是外网形式),需要在云托管后台先绑定一下自定义域名,然后把这个域名配置在小程序的request域名中。云托管还是推荐用callcontainer,走微信私有协议,可以免鉴权,也比较安全

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    4
  • 置顶云托管代码包发布只可以选择jdk7和jdk8 ?

    我的项目是jdk17 如何才能完成

    2024-09-26
    11713
    Alfred Huang

    使用docker镜像方式打包可以不受环境限制。docker镜像内的环境可以根据自身需求使用任意版本jdk。

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶微信云托管中微信支付配置绑定商户好返回268500896怎么办?有偿求

    微信支付是上个月申请的,这个月去绑定商户,返回268500896,有偿求方案,0交易 [图片] [图片]

    2024-01-08
    11708
    编程大石头

    这个很简单的

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 1
    1
  • 置顶小程序已绑定的开发者打开云托管提示:该账号下无任何(开发者身份)小程序或公众号!怎么回事?

    如图,有的小程序没问题有的小程序(wx6f576bd6566233c9)有问题[图片]

    2024-01-29
    11693
    guoguo

    在云托管后台添加权限

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶请核对是否是错别字

    https://developers.weixin.qq.com/miniprogram/dev/wxcloudservice/wxcloudrun/src/basic/intro.html 请核对是否应当是:事前事中事后 [图片]

    01-02
    01677
  • 置顶微信云托管如何实现定时执行任务?

    请问微信的云托管如何定时执行任务,比如每周三更新数据库

    2024-01-31
    11671
    showms

    一个是在自己部署的服务里面加个定时任务,另一个是在Mysql管理后台里面加一个事件调度器

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶小程序云托管如何内网调用?

    我在小程序云托管上部署了两个服务,A服务为接口,B服务是vue打包的项目,A服务已经开启内网地址了,B服务直接调用内网地址无法请求,请问这是怎么回事儿呢?

    04-15
    41638
    Mr.Zhao

    B服务是客户端,无论如何都请求不同内网地址吧

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶微信云托管服务接收不到formdata中的files?

    因为我在使用web访问云托管,但是云托管部署的服务的接口,接收不到我发送的formdata中的file文件 #这部分是接口 static addImageBanner(imageName: File) { const formData = new FormData(); formData.append('file', imageName); return callCloud(`${ROOM_BASE_URL}/Add_ImgBanner`, { method: "post", headers: { // 'Content-Type': 'application/octet-stream', "Content-Type": "multipart/form-data", "X-File-Name": imageName.name, }, data: formData, }); } 这个是callCloud的封装 export async function callCloud(path: string, options: any) { // 打印携带的数据 // console.log('携带的数据:', dataa); const c1 = new cloud.Cloud({ identityless: true, resourceAppid: "******", resourceEnv: "********", }); if (options.data && typeof options.data.entries === 'function') { for (let [key, value] of options.data.entries()) { console.log(key, value); } } else { console.log("options.data is undefined or does not have entries method"); } await c1.init(); let fullUrl = `${path}`; console.log(fullUrl); // 处理查询参数 if (options.params && Object.keys(options.params).length > 0) { const queryString = Object.entries(options.params) .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value as string)}`) .join('&'); fullUrl += `?${queryString}`; } const callContainerPromise = c1.callContainer({ path: fullUrl, method: options.method || "GET", header: { "X-WX-SERVICE": "ypyz", // xxx中填入服务名称(微信云托管 - 服务管理 - 服务列表 - 服务名称) ...options.headers, }, data: options.data || {}, }); const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error("请求超时")), 15000) ); try { const result = await Promise.race([callContainerPromise, timeoutPromise]); console.log(`微信云托管调用结果${result.errMsg} | callid:${result.callID}`); console.log(result); return result.data; } catch (error) { console.error("Error in callCloud:", error); throw error; } } 这个是后端代码 def post(self): rp = RequestParser() rp.add_argument('file', action='append', required=True, location='files', type=FileStorage) args = rp.parse_args() files = args.get('file') try: # files = request.data if not files: current_app.logger.error('没有上传文件') return {'code': 400, 'msg': '请上传图片'} else: img_list = ImgBanner.query.order_by(ImgBanner.created_at.asc()) current_app.logger.info(f"数据库中图片数量: {img_list.count()}") # FileUpload # 获取文件名 # for uploaded_file in files: base_dir = Path(__file__).resolve().parent.parent.parent if not os.path.exists(os.path.join(base_dir / 'static/roomimage')): try: os.makedirs(os.path.join(base_dir / 'static/roomimage')) current_app.logger.info(f"当前路径{base_dir / 'static/roomimage'}") current_app.logger.info(f"Directory roomimage created successfully.") except Exception as e: current_app.logger.error(f"Failed to create directory roomimage: {e}") return {'code': 20003, 'msg': '无法创建目录'} file_name = request.headers.get('X-File-Name', 'default.jpg') # file_name = uploaded_file.filename img_name = f"{uuid.uuid4().hex}" uuid_image_name = img_name + '-' + f'{file_name}' temp_file_path = os.path.join(base_dir / 'static/roomimage', uuid_image_name) # 保存文件对象到临时文件 files[0].save(temp_file_path) # with open(temp_file_path, 'wb') as f: # f.write(files) # files.save(temp_file_path) result = FileUpload.upload_main(uuid_image_name) if result['code'] == 200: file_list = [{'fileid': result['data']['file_id'], 'max_age': 30}] image_url = FileUpload.get_download_url(file_list) url = json.dumps(image_url['data']['file_list'][0]['download_url']).replace('"', '') new_image = ImgBanner(file_id=result['data']['file_id'], image_url=url, image_name=uuid_image_name) db.session.add(new_image) try: # 需要用到数据库事务处理 db.session.commit() except Exception as e: current_app.logger.error(f"Failed to save image to database: {e}") db.session.rollback() return {'code': 20004, 'msg': '保存图片到数据库失败'} else: current_app.logger.error(f"Failed to upload file: {result['msg']}") return {'code': 20002, 'msg': '上传失败'} return {'code': 200, 'msg': '上传成功'} except Exception as e: current_app.logger.error(f'处理上传文件时出错: {e}') return {'code': 500, 'msg': '服务器内部错误'} 但是我选择图片上传后报错 [图片] 就是在云托管服务上拿不到formdata中的file字段文件,但是在本地测试的时候可以拿到,没有问题,有没有大佬给解决一下啊

    2024-11-28
    11635
    Alfred Huang

    1、callContainer不是标准http接口,会有不同。

    2、callContainer接口有请求大小限制,不建议用于文件上传

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 0
    0
  • 置顶云开始技术方案请教?

    打扰大家了,有一个问题想请教大佬们。我有一个留学社区类小程序已经开发了大概90%,使用普通的程序开发(uniapp+springJava),不是腾讯云开发 因为一半的用户在海外各地(欧洲美洲澳洲都有),请问为了避免海外用户使用卡顿,使用云托管是否可以解决?云托管的云端文件存储带 CDN 加速吗? 目前得知云开发是可以完美解决海外使用问题,但是后端转云开发太麻烦了 如果云托管不能解决海外用户使用卡顿问题,请问有什么方法解决吗?

    2024-12-03
    21599
    欢乐马

    再开一台国外服务器反向代理,国外的ip走另一个api不就解决了嘛

    你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。

    待楼主反馈

    有用 1
    0
11213141516...25跳转
正在加载...
我的头像

暂无个人介绍

发布文章

0

回答

0

关注者

0

我关注的问答我的收藏
作品展示
关闭

选择发帖类型

  • 提出问题

    接入使用过程中遇到的疑问

  • 发表文章

    微信云托管相关实战经验及案例分享

  • 关于腾讯
  • 运营规范
  • 文档中心
  • 辟谣中心
  • 客服中心
  • Copyright © 2012-2025 Tencent. All Rights Reserved.