Ejemplo n.º 1
0
        function _init(callback) {
            if (!_.isEmpty(wechatSetting)) {
                if (wechatSetting.picUrl) {
                    wechatSetting.picUrl = "/svc/public/wechat/" + enterpriseId + "/" + wechatSetting.picUrl;
                } else {
                    wechatSetting.picUrl = "/svc/public/wechat/home_default.jpg";
                }
                callback(null);
                return;
            }
            wechatSetting = {};

            dbHelper.getUniqueId(enterpriseId, function (error, id) {
                if (error) {
                    callback(error);
                    return;
                }

                wechatSetting.id = id;
                wechatSetting.enterprise_id = enterpriseId;
                wechatSetting.welcomeWord = "";
                wechatSetting.picUrl = "";
                wechatSetting.state = 0;// 开通状态初始化为0,表示未开通
                dbHelper.addData("weixin_setting", wechatSetting, callback);
            });
        }
Ejemplo n.º 2
0
    function _buildFileName(callback) {
        dbHelper.getUniqueId(enterpriseId, function (error, id) {
            if (error) {
                callback(error);
                return;
            }

            targetName = id;
            targetPath += targetName;

            callback(null);
        });
    }