We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const accessToken = (callback) => { Fiber(() => { const accessToken = AppState.find({stateName: wechatJsSdk.token}).fetch(); console.log(`accessToken ${JSON.stringify(accessToken)}`); callback(null, accessToken); }).run(); }; const updateToken= (token, callback) => { Fiber(() => { console.log(`updateToken ${JSON.stringify(token)}`); AppState.upsert({stateName: wechatJsSdk.token}, { $set: token}); callback(null); }).run(); }; const api = new WechatAPI( Meteor.settings.weChatMp.appId, Meteor.settings.weChatMp.appSecret, accessToken, updateToken ); const getTicketToken = (type, callback) => { Fiber(() => { const ticket = AppState.find({stateName: wechatJsSdk.ticket}).fetch(); console.log(`getTicketToken ${JSON.stringify(ticket)}`); callback(null, ticket); return ticket; }).run(); }; const saveTicketToken = (type, ticketToken) => { Fiber(() => { console.log(`saveTicketToken ${JSON.stringify(ticketToken)}`); AppState.upsert({stateName: wechatJsSdk.ticket}, { $set: ticketToken} ); }).run(); }; const getTicket = (err, result) => { Fiber(() => { console.log(`getTicket ${JSON.stringify(result)}`); if (!err) { AppState.upsert({stateName: wechatJsSdk.ticket}, { $set: result } ); } }).run(); }; //如果执行这两行, //api.registerTicketHandle(getTicketToken, saveTicketToken); //api.getTicket(wechatJsSdk.ticket, getTicket); //那这行没有返回结果. 而且access token 和 ticket 都会刷新两次以上。 //api.getJsConfig(param, callback);
具体问题就是这样的。请问这个API是这样用吗?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
具体问题就是这样的。请问这个API是这样用吗?
The text was updated successfully, but these errors were encountered: