storeFriendsNetwork.js 393 B

12345678910
  1. module.exports = async (ctx, next) => {
  2. if (ctx.state.$wxInfo.loginState === 1) {
  3. const query = ctx.query
  4. const { mysql } = require('../qcloud')
  5. await mysql('friendsnetwork').insert({ id: null, openId: query.openId, appId: query.appId, fromOpenId: query.fromOpenId, fromGId: query.fromGId, time: null}).returning('*').then(res => {
  6. })
  7. } else {
  8. ctx.state.code = -1
  9. }
  10. }