egg icon indicating copy to clipboard operation
egg copied to clipboard

连接redis,当redis没有设置password的时候,出错(正确使用d.ts)

Open nickasam opened this issue 7 years ago • 5 comments

If you want to access redis with no password, use password: null.

@atian25 天猪大佬您好,我看您添加了d.ts,应该改下readme,password:‘’,设置成null会被ts检测出来添加配置时报错。

以及在使用时怎么用? image 会显示没有redis属性

image 引入了egg-redis,后续调用封装好的方法会报错

不知道要怎么正确使用提示??

相关环境信息

  • 操作系统:win10:
  • Node 版本:node8.12.0

nickasam avatar Dec 19 '18 07:12 nickasam

呵,被自己蠢哭了,在项目的d.ts中引一下就好了,千万不要在代码之中引

怎么关闭这个issue啊??

nickasam avatar Dec 19 '18 07:12 nickasam

关了,😀

thonatos avatar Dec 19 '18 09:12 thonatos

都不需要自己引, egg-ts-helper 会自动生成

atian25 avatar Dec 19 '18 09:12 atian25

在项目中可以不写, egg-ts-helper 会自动生成,自动import到对应的位置,一般是plugin.d.ts,貌似做业务框架开发的时候不会生成,不能执行egg-bin的命令,需要手动import下

@atian25 大佬,是这样么?

nickasam avatar Dec 19 '18 09:12 nickasam

执行一次 egg-bin dev 或者 ets 就生成了。

atian25 avatar Dec 19 '18 10:12 atian25