4.6.201909201520 • Published 5 years ago

@dfeidao/fd-an-xxx v4.6.201909201520

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

XXX

Installation

yarn add --dev @dfeidao/fd-an-xxx

Requires

使用本原子操作需要在feidao.json中routers下加入

{
		"URL": "/`@pathname`",
		"METHOD": "get",
		"SERVICE": "dataservice.nodejs",
		"DATA": {
			"modelid": "`@path`"
		}
}

@pathname为url访问地址,@path为服务路径

Example

// 服务中
import math_expr from '@dfeidao/atom-nodejs/captcha/math-expr';
interface Message {
		cookie: {
			uk: string
		}
}
const options = { width: 100, height: 40, fontSize: 30, color: true, inverse: false, noise: 1, background: '#fff' };
const res = await math_expr(msg.cookie, options);
return res;
// 客户端中
import aw2 from '@dfeidao/fd-aw000002';
const raw2 = await aw2(`@pathname`, {});
const box = fd.data.node.querySelector<HTMLDivElement>('[id="box"]');
box.innerHTML = raw2;