****************************************
重载路径
****************************************
492030
function reloadState(model, notify) {
    return function reload() {
        let { pathname, histories } = model,
            method = actionTypes.replace;

        // 更新监听
        return notify({
            pathname, method, histories, length: histories.length
        });
    };
}
680098
function (_getType) {
    var getType = _getType || 'Native2Webkit'; // 获取类型，默认是获取兼容WebKit的语言标识数组

    var defaultLanguage = 'en';
    // 本地对应浏览器的语言标识
    var NativeApple2WebKitLanguageMap = this.nativeApple2WebKitLanguageMap;

    if (getType === 'Native2Webkit') { // 先获取Native的语言，然后查找Map
      var appleLanguage = 'en-US';
      if ($bc_$4.pN) {
        appleLanguage = $bc_$4.pN.app.curAppleLanguage();
      }

      if (NativeApple2WebKitLanguageMap.hasOwnProperty(appleLanguage)) {
        return NativeApple2WebKitLanguageMap[appleLanguage]
      }

      var n2wKeys = Object.getOwnPropertyNames(NativeApple2WebKitLanguageMap);
      for (var i = 0; i < n2wKeys.length; ++i) {
        var valueList = NativeApple2WebKitLanguageMap[n2wKeys[i]];
        if (valueList.indexOf(appleLanguage) > -1) {
          return valueList
        }
      }

      return NativeApple2WebKitLanguageMap[defaultLanguage]
    } else if (getType === 'webkitCompatible') {
      var mapValue = null;
      var webLanguage = navigator.language || 'en';

      var inArray = function (value, array) {
        if (Array.prototype.indexOf) {
          return array.indexOf(value)
        } else {
          for (var i = 0; i < array.length; i++) {
            if (array[i] === value) { return i }
          }
          return -1
        }
      };

      for (var key in NativeApple2WebKitLanguageMap) {
        if (NativeApple2WebKitLanguageMap.hasOwnProperty(key)) {
          var languageArray = NativeApple2WebKitLanguageMap[key];
          if (inArray(webLanguage, languageArray) > -1) {
            mapValue = languageArray;
            break
          }
        }
      }

      return mapValue
    }

    return console.error('调用方式不正确，需要的参数为:Native2Webkit 或者webkitCompatible')
  }
1138223
public function api()
    {
        //处理消息
        $this->wechat->server->setMessageHandler(function ($m) {
            $this->m = $m;
            Log::info($m);

            if ($m->Event != 'unsubscribe' && $m->Event != 'LOCATION' && $m->Event != 'VIEW' && $m->Event != 'TEMPLATESENDJOBFINISH') {
                //存上行消息
                $msg = new Message();
                $msg->from_user_name = $m->FromUserName;
                $msg->to_user_name = $m->ToUserName;
                $msg->create_time = $m->CreateTime;
                $msg->msg_type = $m->MsgType;
//                $msg->msg_id = isset($m->MsgId) ? $m->MsgId : 0;
                $msg->content = isset($m->Content) ? $m->Content : '';
                $msg->pic_url = isset($m->PicUrl) ? $m->PicUrl : '';
//                $msg->location_x = isset($m->Location_X) ? $m->Location_X : '';
//                $msg->location_x = isset($m->Location_Y) ? $m->Location_Y : '';
//                $msg->scale = isset($m->Scale) ? $m->Scale : '';
                $msg->label = isset($m->Label) ? $m->Label : '';
                $msg->title = isset($m->Title) ? $m->Title : '';
                $msg->description = isset($m->Description) ? $m->Description : '';
                $msg->url = isset($m->Url) ? $m->Url : '';
                $msg->media_id = isset($m->MediaId) ? $m->MediaId : '';
                $msg->thumb_media_id = $m->ThumbMediaId;
                $msg->event = $m->Event;
                $msg->event_key = $m->EventKey;
                $msg->save();
            }

            //从上行消息中提取关键词
            $key = '';
            switch ($m->MsgType) {
                case 'text':
                    $key = $m->Content;

                    break;
                case 'event':
                    switch ($m->Event) {
                        case 'CLICK':
                            $key = $m->EventKey;
                            break;
                        case 'subscribe'://关注事件
                            UserSns::where('openid', $m->FromUserName)->update(['status' => 0]);
                            break;
                        case 'unsubscribe'://取消关注事件
                            UserSns::where('openid', $m->FromUserName)->update(['status' => 1]);
                            break;
                        case 'SCAN':
                    }
                    break;
            }
            $this->key = $key;
            Log::info($this->key);

//            //帮用户生成本站用户数据
//            if (!$this->reg()) {
//                return 'whops';
//            }

            //判断关注默认回复的关键词
            if ($m->Event == 'subscribe' && empty($m->EventKey)) {
                $this->key = $this->keyFollow;
            }

            //事件key会抽风夹带类似这种的 last_trade_no_4009012001201605306519754434
            if (strpos($m->EventKey, 'last_trade_no') === 0) {
                $this->key = $this->keyFollow;
            }

            //根据关键词处理回复
            $res = FALSE;
            if (!empty($this->key)) {
                $this->r = $this->returnReply();
            } else {
                $this->r = '';
            }

            //入库消息.取关和地理位置不记录

            return $this->r;

        });

        return $this->wechat->server->serve();

    }
310528
function () {
                var self = this, attrs = self.getAttrs(), attr, m;
                for (attr in attrs) {
                    m = ON_SET + ucfirst(attr);
                    if (self[m]) {
                        // 自动绑定事件到对应函数
                        self.on('after' + ucfirst(attr) + 'Change', onSetAttrChange);
                    }
                }
            }
589664
function Overloader() {
		var overloaded = new OverloadedFunction();
		var append = function(args) {
			overloaded.overload.apply(overloaded, args);
		};

		if (arguments.length) {
			// append(arguments);
		}

		var fn = function() {
			return overloaded.apply(this, arguments);
		};

		// 已创建的多态函数，仍可通过 overload() 方法扩展其多态实现。
		fn.overload = function(/* Type, Type, ..., Function */) {
			append(arguments);
			return fn;
		};

		// 扩展多态实现，同时将该实现设定为默认实现。
		fn.default = function(method) {
			overloaded.default(method);
			return fn;
		};

		// 返回一个函数实体。
		return fn;
	}
1295
function (ele) {
            var node = this[0];
            //结点类型判断
            if (node.nodeType === 1 || node.nodeType === 11 || node.nodeType === 9) {
                if(ele instanceof vQ){
                    ele.each(function(inx,ele){
                        node.appendChild(ele);
                    });
                } else if(ele.nodeType){
                    node.appendChild(ele);
                }
                // string array
            }
            return this;
        }
14469
function UserInfo() {
	//使用者帳號(索引用)
	this.strAccount = "";
	//電子信箱
	this.strEmail = "";
	//信箱通知勾選
	this.bEmailNotify = false;
	//電話資料
	this.strPhone = "";
	//簡訊通知勾選
	this.bSMSNotify = false;
	//使用者名稱(暱稱?)
	this.strUserName = "";
	//語系控制
	this.strLanguages = "";
	//系統保護
	this.bSystemAegis = false;
	//登入次數
	this.iLoginCount = 0;
	//登入時間
	this.iLogin = 0;
	//最後登出時間
	this.iLastLogout = 0;
}
271178
function (params) {
      var item = params[this._getNum(params.length - 1)];
      // 枚举类型可以没有属性
      if (!item) {
        return null;
      }
      var enumEleType = params && params[0].type;
      var enumEleDatatype = this.ds.find(function (dt) {
        return dt.id === enumEleType;
      });
      var enumEleSysType = null;
      if (enumEleDatatype.params.length) {
        // 自定义的字符或者数值类型
        // enumEleSysType = enumEleDatatype.params[0].type;
        // 根据 format 取值，这里有些老数据，params 的值没有正确设置
        if (enumEleDatatype.format === 4) {
          // 数值类型
          enumEleSysType = 10002;
        } else {
          // 其他都是字符串类型
          enumEleSysType = 10001;
        }
      } else {
        enumEleSysType = enumEleDatatype.id;
      }
      return this._getMockOfSysDatatype({
        id: enumEleSysType,
        defaultValue: item.defaultValue,
        genExpression: item.genExpression
      });
    }
914647
function init() {
  const {supportCordova = false} = this.config;

  onReady = onReady.bind(this);

  /***
   * 如果开启了对cordova的支持
   */
  if (supportCordova) {
    /***
     * 如果开启了对cordova的支持，那么页面完成事件和cordova的deviceReady事件必须同时完成后才能支持后续代码
     */
    Promise.all([
      readyPromise(),
      DOMContentLoadedPromise(),
      devicereadyPromise()
    ]).then(() => {
      onReady();
      fireEvent(window.document, "DOMContentAndDeviceReady");
    }).catch((error) => {

    });
  }
  else {
    /***
     * 页面载入完成事件
     */
    $(window.document).ready(onReady);

    /***
     * 自动 init
     */
    window.addEventListener("DOMContentLoaded", onReady);
  }
}
391811
function () {
            var me = this, range;
            if (me.body.contentEditable == 'false') {
                me.body.contentEditable = true;
                range = me.selection.getRange();
                //有可能内容丢失了
                try {
                    range.moveToBookmark(me.lastBk);
                    delete me.lastBk
                } catch (e) {
                    range.setStartAtFirst(me.body).collapse(true)
                }
                range.select(true);
                if (me.bkqueryCommandState) {
                    me.queryCommandState = me.bkqueryCommandState;
                    delete me.bkqueryCommandState;
                }
                if (me.bkqueryCommandValue) {
                    me.queryCommandValue = me.bkqueryCommandValue;
                    delete me.bkqueryCommandValue;
                }
                me.fireEvent('selectionchange');
            }
        }
136241
function() {
			var oThis = this,styleStr = '',str = '';
			this.ele.innerHTML = '';
			if(this.options.width){
				str += 'width:' + this.options.width + ';';
			}else{
				str += 'width:auto;';
			}
			if(this.options.height){
				str += 'height:' + this.options.height + ';';
			}else{
				str += 'height:auto;';
			}
			if(str != ''){
				styleStr = 'style="' + str + '"';
			}
			var htmlStr = '<div id="' + this.options.id + '" data-role="grid" class="u-grid" ' + styleStr + '>';
			htmlStr += '</div>';
			this.ele.insertAdjacentHTML('afterBegin', htmlStr);
			// 创建屏幕div,用于拖动等操作
			var htmlStr = '<div id="' + this.options.id + '_top" class="u-grid-top"></div>';
			this.ele.insertAdjacentHTML('afterBegin', htmlStr);
			this.initEventFun(); //创建完成之后顶层div添加监听
			this.widthChangeFun(); // 根据整体宽度创建grid或form展示区域
		}
256464
function(watcher){
    var dirty = false;
    if(!watcher) return;

    var now, last, tlast, tnow,  
      eq, diff, keyOf, trackDiff
     

    if(!watcher.test){

      now = watcher.get(this);
      last = watcher.last;
      keyOf = watcher.keyOf

      if(now !== last || watcher.force){
        tlast = _.typeOf(last);
        tnow = _.typeOf(now);
        eq = true; 

        // !Object
        if( !(tnow === 'object' && tlast==='object' && watcher.deep) ){
          // Array
          if( tnow === 'array' && ( tlast=='undefined' || tlast === 'array') ){
            if(typeof keyOf === 'function'){
              trackDiff = diffTrack(now, watcher.last || [], keyOf )
              diff = trackDiff.steps;
              if(trackDiff.dirty) dirty = true;
            }else{
              diff = diffArray(now, watcher.last || [], watcher.diff)
            }
            
            if(!dirty && (tlast !== 'array' || diff === true || diff.length) ) dirty = true;
          }else{
            eq = _.equals( now, last );
            if( !eq || watcher.force ){
              watcher.force = null;
              dirty = true; 
            }
          }
        }else{
          diff =  diffObject( now, last, watcher.diff, keyOf  );
          if(diff.isTrack){
            trackDiff = diff;
            diff = trackDiff.steps;
          }
          if( diff === true || diff.length ) dirty = true;
        }
      }

    } else{
      // @TODO 是否把多重改掉
      var result = watcher.test(this);
      if(result){
        dirty = true;
        watcher.fn.apply(this, result)
      }
    }
    if(dirty && !watcher.test){
      if(tnow === 'object' && watcher.deep || tnow === 'array'){
        watcher.last = _.clone(now);
      }else{
        watcher.last = now;
      }
      watcher.fn.call(this, now, last, diff, trackDiff && trackDiff.oldKeyMap, trackDiff && trackDiff.dirty)
      if(watcher.once) this.$unwatch(watcher)
    }

    return dirty;
  }
86866
function format(str, args) {
  if (!args) {
    throw new Error("args empty!");
  }
  //判断是否是数组
  if (args.constructor == Array) {
    var l = args.length;
    var reg = /(%[sdf])/;
    for(var i= 0; i<l; i++) {
      str = str.replace(reg, args[i]);
    }
  } else if (typeof args == 'object') {
    for(var key in args) {
      var reg = new RegExp(":"+key);
      str = str.replace(reg, args[key]);
    }
  }
  return str;
}
198419
async def grant(self, user_id, *permissions):
        "  "

        prefix = f"{self._prefix_perm}/{user_id}/"

        perm_names = [str(p) for p in permissions]        
        checkings = [
            KV.put.txn(prefix + p, b'\0', prev_kv=True) for p in perm_names
        ]
        success, response = await self._client.txn(compare=[], success=checkings)
        if not success:
            errmsg = f"无法授予用户({user_id})的权限: {{{', '.join(perm_names)}}}"
            raise Unprocessable(errmsg)

        if logger.isEnabledFor(logging.DEBUG):
            granted, ignored = set(), set()
            for i, (perm, _)  in enumerate(response):
                if perm is None:
                    granted.add(perm_names[i])
                else:
                    ignored.add(perm_names[i])
            
            logger.debug(f"授予用户({user_id})权限({', '.join(granted)}), "
                            f"忽略已授权({', '.join(ignored)})")
625347
public function save(): void
    {
        $keys = [];

        $primaryKey = $this->primaryKey;

        //每个行对象进行保存
        foreach ($this as $record) {
            /*
             * @var SRecord
             */
            $record->save();

            //取行对象的主键值
            $keys[] = $record->{$primaryKey};
        }

        //要删除的记录的主键值
        $deletedKeys = array_diff($this->oldPrimaryKeys, $keys);

        //一对多时,在关联表中进行删除
        if ($this->type === 'hasMany') {
            /**
             * @var $tableClass Table
             */
            $tableClass = $this->tableClass;
            $tableClass::instance()->delete([$this->primaryKey => $deletedKeys]);
        } elseif ($this->type === 'belongsToMany') {
            //多对多关联时,删除 中间表
            $config = $this->relation;

            //配置信息
            $middleClass = $config['middle'];  //中间表
            $selfForeignKey = $config['selfForeignKey'];//中间表中与本表关联的键
            $targetForeignKey = $config['targetForeignKey'];//中间表中与对方 表关联的键
            $selfPrimaryValue = $config['selfPrimaryValue']; //主表主键值

            //在中间表中进行删除
            $middleClass::instance()->delete([$selfForeignKey => $selfPrimaryValue, $targetForeignKey => $deletedKeys]);
        }
    }
486531
private function f1()
    {
        $_linkstr = "\n<p class=\"links\">\n"; //begin
        if ($this->totalpage < 2) {
            $nextpage = $this->cpage + 1;
            $_linkstr .= "<span class=\"disabled\">首页</span>" . " \n";
            $_linkstr .= "<span class=\"disabled\">上一页</span> \n";
            $_linkstr .= "<span class=\"disabled\">下一页</span> \n";
            $_linkstr .= "<span class=\"disabled\">尾页</span> \n";
        } elseif ($this->cpage < 2) {
            // 首页
            $nextpage = $this->cpage + 1;
            $_linkstr .= "<span class=\"disabled\">首页</span>" . " \n";
            $_linkstr .= "<span class=\"disabled\">上一页</span> \n";
            $_linkstr .= "<a href=\"" . $this->url ( $nextpage ) . "\">下一页</a> \n";
            $_linkstr .= "<a href=\"" . $this->url ( $this->totalpage ) . "\">尾页</a> \n";
        } elseif ($this->cpage >= $this->totalpage) {
            // ＝尾页
            $prepage = $this->cpage - 1;

            $_linkstr .= "<a href=\"" . $this->url ( 1 ) . "\">首页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $prepage ) . "\">上一页</a>\n";
            $_linkstr .= "\n<span class=\"disabled\">下一页</span>\n";
            $_linkstr .= "<span class=\"disabled\">尾页</span>" . "\n";
        } else {
            // 正常
            $prepage  = $this->cpage - 1;
            $nextpage = $this->cpage + 1;

            $_linkstr .= "<a href=\"" . $this->url ( 1 ) . "\">首页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $prepage ) . "\">上一页</a>\n";
            $_linkstr .= "\n<a href=\"" . $this->url ( $nextpage ) . "\">下一页</a>\n";
            $_linkstr .= "<a href=\"" . $this->url ( $this->totalpage ) . "\">尾页</a>\n";
        }
        $_linkstr .= "</p>\n"; //end div
        return $_linkstr;
    }
176505
function s(s) {
        /**
         * 该函数运行在View上
         * @param target View实例
         * @param decoratedPropertyName 属性名
         */
        return function (target, decoratedPropertyName) {
            var targetType = target.constructor;
            // 目标view的名称
            var name = target.constructor.toString().match(/^function\s*([^\s(]+)/)[1];
            if (!targetType.hasOwnProperty("__inject__")) {
                targetType["__inject__"] = {};
            }
            if (!targetType["__inject__"][name]) {
                targetType["__inject__"][name] = {
                    constructor: target.constructor
                };
            }
            if (!targetType["__inject__"][name]["services"]) {
                targetType["__inject__"][name]["services"] = [];
            }
            var temp = new view_5.serviceInjectModel();
            temp.creator = s;
            temp.propertyName = decoratedPropertyName;
            targetType["__inject__"][name]["services"].push(temp);
        };
    }