泛型 IAppOption 里的 globalData 的类型也要跟着变动,或者直接去掉 <IAppOption> 让 ts 自动推导试试?
在appt.ts中的globalData中加了属性,编译就出错?[图片] 错误日志: VM3431:1 miniprogram/app.ts:4:5 - error TS2322: Type '{ phone: null; }' is not assignable to type '{ userInfo?: UserInfo | undefined; }'. Object literal may only specify known properties, and 'phone' does not exist in type '{ userInfo?: UserInfo | undefined; }'. 4 phone:null, ~~~~~~~~~~ typings/index.d.ts:4:3 4 globalData: { ~~~~~~~~~~ The expected type comes from property 'globalData' which is declared here on type 'Options<IAppOption>' Found 1 error. VM3396:1 npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! miniprogram-ts-quickstart@1.0.0 tsc: `node ./node_modules/typescript/lib/tsc.js` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the miniprogram-ts-quickstart@1.0.0 tsc script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. console.error @ VM3396:1 (anonymous) @ VM3432:1 VM3396:1 执行自定义预览前预处理命令失败! console.error @ VM3396:1 (anonymous) @ VM3433:1 VM3396:1 npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-03-23T05_00_40_141Z-debug.log
2020-03-23即使我们解决反编译的问题,插件代码依然是可以在工具或者客户端通过各种方法看到的,应该说代码透明是前端很难避免的问题。只能说尽量不要让安全性依赖源码,AppSecret 之类的可以由使用者小程序借助它自己的后端来交互避免问题之类的。当然,我们会持续努力提高获取线上代码的门槛和难度。
请问小程序插件安全性如何保证?你好,想请问下小程序插件的安全性如何保证,包括: 插件代码的安全性。我尝试使用线上的插件,发现花点心思还是可以看到插件源码,虽然是混淆的,但看出其逻辑并不难。插件使用者与插件提供方如何安全通信。原生app业界方案一般是使用appkey、AppSecret等保证,但在反编译微信小程序问题依然存在的情况下,这些信息都有可能被三方获取到。如果三方使用伪造的小程序,微信小程序有方案保证该种场景下的通信安全吗?
2020-03-17是不是有页面没有添加到插件的 pages 列表里?看看和这个问题一样不 https://developers.weixin.qq.com/community/develop/doc/000aca1d8f041894323954a9651000
小程序插件本地正常,发布之后加载失败?[图片] [图片]
2020-03-16新建项目时,语言可以选择 TypeScript,开发工具会配置好自动编译命令
小程序能直接编译ts吗,或者less?[图片] 像我目前这样,每次都会手动通过tsc来生成对应的js文件。能否直接编译ts。不需要再手动生成了js,增加多余的文件。 编译器的这个选项没有用吗? [图片]
2020-03-04类型定义写在 IAppOption 里,这里应该写值
小程序里尝试用typescript,出现了不知道怎么解决的报错?求指导[图片]
2020-02-26Cannot redeclare block-scoped variable 'console' 的问题参见 https://github.com/wechat-miniprogram/api-typings/issues/66 special.ts 报错的问题,看起来是没有正确推导方法。special.ts 的代码可以看一下吗?不用具体逻辑,主要是看看函数签名和 Page 构造器的调用有没有定义没覆盖到的情况,谢谢~
TypeSrcipt模板更新添加miniprogram-api-typings编译出错。求助官方?[图片][图片] [图片] 之前TypeSrcipt 模板里面 package.json 中dependencies 里面没有 miniprogram-api-typings。 npm install miniprogram-api-typings 之后在 tsconfig.json 中修改 typeRoots : [ "./node_modules/miniprogram-api-typings" ] 1.编译出现 错误 miniprogram/pages/auc/special/special.ts:62:3 - error TS2345: Argument of type '{ data: { curPage: number; pageSize: number; specials: never[]; session: {}; sesCode: string; loading: false; footer: false; showmask: false; loadAfresh: false; }; onLoad(options: any): void; onPullDownRefresh(): void; ... 4 more ...; handleTapLots(event: any): void; }' is not assignable to parameter of type 'Options<{ curPage: number; pageSize: number; specials: never[]; session: {}; sesCode: string; loading: boolean; footer: boolean; showmask: boolean; loadAfresh: boolean; }, {}>'. Object literal may only specify known properties, and 'eventLoadAfresh' does not exist in type 'Options<{ curPage: number; pageSize: number; specials: never[]; session: {}; sesCode: string; loading: boolean; footer: boolean; showmask: boolean; loadAfresh: boolean; }, {}>'. 62 eventLoadAfresh() { 2.miniprogram-api-typings 文件里面也出现错误 node_modules/miniprogram-api-typings/types/wx/lib.wx.api.d.ts:15775:15 - error TS2451: Cannot redeclare block-scoped variable 'console'. 15775 declare const console: WechatMiniprogram.Console ~~~~~~~ node_modules/typescript/lib/lib.dom.d.ts:17510:13 17510 declare var console: Console; ~~~~~~~ 'console' was also declared here.
2020-02-14插件在手机上预览的时候套用的 appid 是你个人的测试号,详细可以参考 https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/development.html#%E9%A2%84%E8%A7%88%E3%80%81%E4%B8%8A%E4%BC%A0%E5%92%8C%E5%8F%91%E5%B8%83
微信开发者工具最新版本,插件开发状态下,refer中appid和项目中appid不一致?环境:win10 手机:华为p30 开发工具版本: 1.02.2001202 devtools下:Referer: https://servicewechat.com/wxd291656f9ee97f56/devtools/page-frame.html 编译到手机下:Referer: https://servicewechat.com/wxa510569715500250/0/page-frame.html 后台提供
2020-02-11插件自己引用自己的自定义组件,可以用相对路径,也可以用 plugin-private://APPID/components/toast/toast 插件 appid 和同账号下的小程序 appid 相同 工具里应该是有上传按钮的,就和普通小程序的上传按钮的位置相同。没有看到的话截图一起看一下是不是有什么 bug?
插件中如何自己引用组件?如图: [图片] 这个路径有什么不对?就算换绝对路径也是,一直报错,我人傻了。 [图片] 这是文档: [图片] 有没大佬指点下迷津?或者demo参考下?不胜感激
2020-01-14感谢反馈,尽快解决,可以在这里跟踪 https://github.com/wechat-miniprogram/api-typings/issues/96 https://github.com/wechat-miniprogram/api-typings/issues/97
开发者工具提供的自定义组件的 TS 类型定义不全开发者工具提供的自定义组件的 TS 类型定义缺少实例方法 selectOwnerComponent、animate 及 clearAnimation 的类型定义。 并且自定义组件的属性的类型推导并没有使用 optionalTypes,导致推导的类型信息不全。
2020-01-13同一个 provider 不就是同一个插件吗,为什么要添加两次😂
同一个 provider 只能有一个 plugin?app.json { "pages": [ "pages/index/index" ], "plugins": { "hello-plugin": { "version": "dev", "provider": "wx68*************" }, "pipe-plugin":{ "version":"dev", "provider":"wx68*************" } }, "sitemapLocation": "sitemap.json" } 错误信息: plugins["pipe-plugin"] 与 plugins["hello-plugin"] 的 provider 相同
2020-01-09