egg-city
Install
$ npm i egg-city --save
Usage
// {app_root}/config/plugin.jsexportscity = enable: true package: 'egg-city';
Configuration
// {app_root}/config/config.default.jsexportscity = ;
see config/config.default.js for more detail.
Example
// {app_root}/app/controller/home.js'use strict'; Controller async { /** * 获取城市信息 * @method getCity * @param * @returns * @description 返回值成员的属性包括: * @description name(城市名称) * @description code(城市代号) * @description distinctInfo(拥有的所有“区/县”信息,若查询本身为“县/区”级别,则不含该字段) * @description provinceInfo(所属“省份”信息,若查询本身为“省”级别,则不含该字段) * @description cityInfo(包含/所属“市”信息,若查询本身为“市”级别,则不含该字段) */ const cityInfo = await thisservicecity; }moduleexports = HomeController;
Questions & Suggestions
Please open an issue here.