更新记录

1.0.20250826(2025-08-25)

  1. 更新README

1.0.20250825(2025-08-25)

  1. 企业微信登录

平台兼容性

云端兼容性

阿里云 腾讯云 支付宝云

uni-app(4.07)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - - - 12 -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - -

uni-app x(4.07)

Chrome Safari Android iOS 鸿蒙 微信小程序
- - - - - -

引入插件

  • 点击插件试用引入到项目
  • 打包自定义基座包
  • 按照下方示例测试
  • 先插件试用,完全符合需求后购买

插件引入

import * as workwxUtils from "@/uni_modules/cms-workwx";

插件方法

方法 描述 参数
registerApp(WorkwxRegisterAppOption) 注册App 见下方
login(LoginOption) 登录 见下方
export type WorkwxRegisterAppOption = {
    // 第三方App的Scheme
    scheme : string,
    // 第三方App所属企业的ID
    corpid : string,
    // 第三方App在企业内部的ID也就是AgentId
    appid : string
}

export type LoginOption = {
    // state 会在成功和失败原样返回
    state ?: string,
    success : (code : string, state : string) => void,
    fail : (errCode : number, errMsg : string, state : string) => void
}

IOS

找到cms-workwx/app-ios/Info.plist 文件替换其中【scheme】为你自己的scheme

示例页面

需要先注册然后再调用login

    <view style="padding-top: 300rpx;">
        <button type="primary" @click="registerApp">注册</button>
        <button type="primary" @click="login">登陆</button>
    </view>
</template>

<script>
    import * as workwxUtils from "@/uni_modules/cms-workwx";

    export default {
        data() { return {} },
        methods: {
            registerApp() {
                this.showModal('registerApp', workwxUtils.registerApp({
                    // 第三方App的Scheme
                    scheme: "",
                    // 第三方App所属企业的ID
                    corpid: "",
                    // 第三方App在企业内部的ID也就是AgentId
                    appid: ""
                }))
            },
            login() {
                workwxUtils.login({
                    state: "test",
                    success:(code, state) =>{
                        this.showModal('login success', JSON.stringify({
                            code,
                            state
                        }));
                    },
                    fail:(errCode, errMsg,state) =>{
                        this.showModal('login fail', JSON.stringify({
                            errCode,
                            errMsg,
                            state
                        }));
                    }
                });
            },
            showModal(title, content) {
                uni.showModal({ title, content })
            }

        }
    }
</script>

需要帮助?有其他插件的需求?联系我!

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

插件不采集任何数据

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。