From dba0331e44a00839c9b5aca5905e64a17bdf410d Mon Sep 17 00:00:00 2001 From: cool Date: Tue, 28 May 2024 16:17:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8F=92=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=B1=BB=E5=9E=8B=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/plugin/service/info.ts | 2 +- src/modules/user/service/login.ts | 2 +- src/modules/user/service/wx.ts | 6 ++-- typings/plugin.d.ts | 4 --- typings/uniphone.d.ts | 14 -------- typings/wx.d.ts | 58 ------------------------------ 6 files changed, 5 insertions(+), 81 deletions(-) delete mode 100644 typings/uniphone.d.ts delete mode 100644 typings/wx.d.ts diff --git a/src/modules/plugin/service/info.ts b/src/modules/plugin/service/info.ts index 75cc9f7..c1478d6 100644 --- a/src/modules/plugin/service/info.ts +++ b/src/modules/plugin/service/info.ts @@ -144,7 +144,7 @@ export class PluginService extends BaseService { ...params ) { // 实例 - const instance = await this.getInstance(key); + const instance: any = await this.getInstance(key); return await instance[method](...params); } diff --git a/src/modules/user/service/login.ts b/src/modules/user/service/login.ts index 8e1e006..6d32603 100644 --- a/src/modules/user/service/login.ts +++ b/src/modules/user/service/login.ts @@ -89,7 +89,7 @@ export class UserLoginService extends BaseService { * @param openid */ async uniPhone(access_token, openid, appId) { - const instance = await this.pluginService.getInstance('uniphone'); + const instance: any = await this.pluginService.getInstance('uniphone'); const phone = await instance.getPhone(access_token, openid, appId); if (phone) { return await this.phone(phone); diff --git a/src/modules/user/service/wx.ts b/src/modules/user/service/wx.ts index a85bed7..c1f42c6 100644 --- a/src/modules/user/service/wx.ts +++ b/src/modules/user/service/wx.ts @@ -32,7 +32,7 @@ export class UserWxService extends BaseService { * @returns */ async getMiniApp() { - const wxPlugin = await this.pluginService.getInstance('wx'); + const wxPlugin: any = await this.pluginService.getInstance('wx'); return wxPlugin.MiniApp(); } @@ -41,7 +41,7 @@ export class UserWxService extends BaseService { * @returns */ async getOfficialAccount() { - const wxPlugin = await this.pluginService.getInstance('wx'); + const wxPlugin: any = await this.pluginService.getInstance('wx'); return wxPlugin.OfficialAccount(); } @@ -50,7 +50,7 @@ export class UserWxService extends BaseService { * @returns */ async getOpenPlatform() { - const wxPlugin = await this.pluginService.getInstance('wx'); + const wxPlugin: any = await this.pluginService.getInstance('wx'); return wxPlugin.OpenPlatform(); } diff --git a/typings/plugin.d.ts b/typings/plugin.d.ts index 55178be..e2ae5a0 100644 --- a/typings/plugin.d.ts +++ b/typings/plugin.d.ts @@ -1,12 +1,8 @@ -import * as wx from './wx'; -import * as uniphone from './uniphone'; import { BaseUpload, MODETYPE } from './upload'; type AnyString = string & {}; /** * 插件类型声明 */ interface PluginMap { - wx: wx.CoolPlugin; upload: BaseUpload; - uniphone: uniphone.CoolPlugin; } diff --git a/typings/uniphone.d.ts b/typings/uniphone.d.ts deleted file mode 100644 index 35734c5..0000000 --- a/typings/uniphone.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { BasePlugin } from '@cool-midway/plugin-cli'; -/** - * 一键手机号登录 - */ -export declare class CoolPlugin extends BasePlugin { - /** - * 获得手机号 - * @param access_token 前端获取的access_token - * @param openid 前端获取的openid - * @param appId 前端获取的appId - */ - getPhone(access_token: string, openid: string, appId: string): Promise; -} -export declare const Plugin: typeof CoolPlugin; diff --git a/typings/wx.d.ts b/typings/wx.d.ts deleted file mode 100644 index cb375e7..0000000 --- a/typings/wx.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { BasePlugin } from '@cool-midway/plugin-cli'; -import { - OfficialAccount, - MiniApp, - Pay, - OpenPlatform, - Work, - OpenWork, -} from 'node-easywechat'; -/** - * 微信 - */ -export declare class CoolPlugin extends BasePlugin { - /** - * 公众号 - * @param config - * @returns - */ - OfficialAccount(config?: any): Promise; - /** - * 小程序 - * @param config - * @returns - */ - MiniApp(config?: any): Promise; - /** - * 支付 - * @param config - * @returns - */ - Pay(config?: any): Promise; - /** - * 开放平台 - * @param config - * @returns - */ - OpenPlatform(config?: any): Promise; - /** - * 企业微信 - * @param config - * @returns - */ - Work(config?: any): Promise; - /** - * 企业微信开放平台 - * @param config - * @returns - */ - OpenWork(config?: any): Promise; - /** - * 设置缓存 - * @param app - */ - setCache( - app: OfficialAccount | MiniApp | Pay | OpenPlatform | Work | OpenWork - ): Promise; -} -export declare const Plugin: typeof CoolPlugin;