数据库访问,无返回查询内容
发布于 5 年前 作者 qianggu 12350 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)登录phpmyadmin数据库,有一个警告信号:配置文件现在需要一个短语密码
  • 预期表现:无
  • 复现路径:
  • 提供一个最简复现 Demo
2 回复

你好,目前暂不支持此功能。

 服务端的代码

const { mysql } = require(’…/qcloud’)

async function get_goods(ctx, next) {

  await mysql(‘goods’).select(‘id’, ‘title’, ‘price’, ‘url1’,‘clickratenum’,‘volume’).then(res => {

    ctx.state.code = 0

   ctx.state.data = res

  }).catch(err => {

    ctx.state.code = -1

    throw new Error(err)

  })

}

module.exports = {

  get_goods

}

回到顶部