Skip to content

Commit

Permalink
✨ new way to get openid
Browse files Browse the repository at this point in the history
  • Loading branch information
shawjia committed Nov 4, 2018
1 parent bb6d73f commit bab5fc6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/cloud/funds/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const cloud = require('wx-server-sdk');
cloud.init();
const db = cloud.database();

exports.main = async (event) => {
const { openId } = event.userInfo;
exports.main = async () => {
const { OPENID: openId } = cloud.getWXContext();
const funds = await db.collection('funds')
.where({ _openid: openId })
.limit(1)
Expand Down
22 changes: 11 additions & 11 deletions src/cloud/funds/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/cloud/sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const db = cloud.database();

exports.main = async (event) => {
const { funds } = event;
const { openId } = event.userInfo;
const { OPENID: openId } = cloud.getWXContext();

const oldFunds = await db.collection('funds')
.where({ _openid: openId })
.limit(1)
Expand Down
24 changes: 12 additions & 12 deletions src/cloud/sync/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bab5fc6

Please sign in to comment.