umi-plugin-rds
v0.1.1
Published
umijs
Downloads
4
Readme
umi-plugin-rds
umijs
Install
# or yarn
$ npm install
Development UI
UI mini start:
$ npm run build --watch
$ npm run start
Usage
直接安装umi-plugin-rds的依赖
// package.json
{
"dependencies": {
"umi-plugin-rds": "^0.1.0"
}
}
在配置路由时,增加RDSId配置,route.ts
[
{
path: '/mini/dev',
component: 'Home/index',
RDSId: 'openhome_sendACKCode',
},
{
path: '/mini/create',
component: 'Create/index',
RDSId: 'openhome_queryUserInfo',
},
{
path: '/mini/sub',
component: 'Sub/index',
},
]
获取json_ua
import getUaAsync from 'umi-plugin-rds/es/rds';
export async function getUserInfo(params) {
const ua = await getUaAsync();
const result = await get('/api', {
...params,
ua,
});
};