{"id":29926755,"url":"https://github.com/ecomfe/bat-ria","last_synced_at":"2025-08-02T12:43:49.573Z","repository":{"id":14232501,"uuid":"16939559","full_name":"ecomfe/bat-ria","owner":"ecomfe","description":"RIA extensions for Brand Ads","archived":false,"fork":false,"pushed_at":"2017-07-25T09:36:03.000Z","size":732,"stargazers_count":11,"open_issues_count":10,"forks_count":15,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-25T08:05:14.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecomfe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-18T06:38:46.000Z","updated_at":"2020-12-30T06:36:12.000Z","dependencies_parsed_at":"2022-08-28T16:02:33.356Z","dependency_job_id":null,"html_url":"https://github.com/ecomfe/bat-ria","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ecomfe/bat-ria","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fbat-ria","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fbat-ria/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fbat-ria/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fbat-ria/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/bat-ria/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Fbat-ria/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268392216,"owners_count":24243297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-02T12:43:06.556Z","updated_at":"2025-08-02T12:43:49.505Z","avatar_url":"https://github.com/ecomfe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BAT-RIA 扩展\n\n## 额外依赖的 edp 包\n\n* urijs\n\n## ESL config\n\n## 启动入口\n\n在 `common/main`（或其他入口模块）中如此通过 BAT-RIA 来启动系统：\n```javascript\nrequire('bat-ria/main').start(config).then(function () {\n    // custom system initialization\n});\n```\n`bat-ria/main` 会请求用户、常量数据后启动 ER，完成后可以进行额外的系统初始化（导航栏、用户信息区域的渲染等）。\n\n## 用户信息和常量接口\n\n`bat-ria/main` 负责请求后端用户和系统常量接口数据。\n\n两个接口的 URL 需要在 `common/config` 模块下的 `api.user` 和 `api.constants` 中进行配置。\n\n用户数据接口有如下两种情况：\n\n1. 对于可能以他人身份登录系统的情况，`result` 需要符合如下格式：\n\n    ```javascript\n    {\n        visitor: {\n            // 当前登录用户自身信息\n        },\n\n        adOwner: {\n            // 被登录的广告主的信息\n        }\n    }\n    ```\n\n2. 只会有一种身份登录的系统，直接在 `result` 中展开用户信息字段即可（非 1. 中所述情况时自动视作此情况）。\n\n读取完毕后，会在下面两个模块封装对应的数据：\n\n* `bat-ria/system/user`\n* `bat-ria/system/constants`\n\n`user.visitor` 提供正在访问系统的用户的信息，`user.ader` 用来在管理员以他人身份登录系统时提供被登录用户的信息（可能不存在）。\n\n\n## util\n\n常用的单纯的数据操作工具被扩展到了 `underscore` 中，参见 `bat-ria/extension/underscore`。\n其他和 ER/ESUI/EF 相关的辅助方法在 `bat-ria/util` 中。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fbat-ria","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Fbat-ria","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Fbat-ria/lists"}