微信小程序自定义回调函数

微信小程序自定义函数回调

设置:

    var checkOpenid = function checkOpenid(openid,cb){
      var result =openid
      typeof cb == "function" && cb(result)
    }

module.exports = {
  checkOpenid:checkOpenid
};

引用

var qcloud = require('../../vendor/qcloud-weapp-client-sdk/index');
  qcloud.checkOpenid(11111111,function(result){
        console.log(result)
        if(result==1){
          console.log(333)
        }
    })

**注意更改引入路径

你可能感兴趣的:(微信小程序)