{"_id":"@captcha-pro/uniapp-vue2","_rev":"3-64899fcd757a8eb6681cecd2efb5463a","name":"@captcha-pro/uniapp-vue2","dist-tags":{"latest":"2.2.0"},"versions":{"2.0.0":{"name":"@captcha-pro/uniapp-vue2","version":"2.0.0","keywords":["captcha","uniapp","vue2","slider-captcha","click-captcha"],"author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"license":"MIT","_id":"@captcha-pro/uniapp-vue2@2.0.0","maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"dist":{"shasum":"e3334995c279bef0c247d963cc5893c09703359f","tarball":"https://registry.npmjs.org/@captcha-pro/uniapp-vue2/-/uniapp-vue2-2.0.0.tgz","fileCount":19,"integrity":"sha512-IU09Z0bdyp/ApdQw6vLLaCahogxey9yN4rf/0mHIDrFteHbEnvXxQqP+Q4VpmVXJ9p8AvcQBcQp9s43oQ0nMQw==","signatures":[{"sig":"MEQCIHoHj5Ew7ds4Z7cQoNtKkggneDq3r/VmyabVzKdJa0YgAiBfixVYJ8jxk4mkAn7gYFX2DmFgIxb6Z7dR0+Pvmeyvuw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39069},"main":"dist/index.cjs","type":"module","_from":"file:captcha-pro-uniapp-vue2-2.0.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./types":"./dist/types.js","./request":"./dist/request.js","./click-captcha.vue":"./src/components/click-captcha.vue","./popup-captcha.vue":"./src/components/popup-captcha.vue","./slider-captcha.vue":"./src/components/slider-captcha.vue"},"scripts":{"test":"echo 'no tests'","build":"vite build -c build/vite.config.ts","clean":"rm-all dist","watch":"vite build -c build/vite.config.ts -w"},"_npmUser":{"name":"saqqdy","email":"saqqdy@qq.com"},"_resolved":"/tmp/ac6fcb2495cee953d1fb371a9647d2a3/captcha-pro-uniapp-vue2-2.0.0.tgz","_integrity":"sha512-IU09Z0bdyp/ApdQw6vLLaCahogxey9yN4rf/0mHIDrFteHbEnvXxQqP+Q4VpmVXJ9p8AvcQBcQp9s43oQ0nMQw==","_npmVersion":"10.8.2","description":"uni-app + Vue 2 captcha components for captcha-pro (backend-only mode)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@captcha-pro/mp-shared":"2.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.19","rm-all":"^1.1.1","typescript":"^5.9.3","@types/node":"^24.13.3"},"peerDependencies":{"vue":"^2.7.0"},"_npmOperationalInternal":{"tmp":"tmp/uniapp-vue2_2.0.0_1786288873426_0.7104090893096839","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@captcha-pro/uniapp-vue2","version":"2.1.0","keywords":["captcha","uniapp","vue2","slider-captcha","click-captcha"],"author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"license":"MIT","_id":"@captcha-pro/uniapp-vue2@2.1.0","maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"dist":{"shasum":"7ce744a161bdec54fc65483d7ae53e9048a45622","tarball":"https://registry.npmjs.org/@captcha-pro/uniapp-vue2/-/uniapp-vue2-2.1.0.tgz","fileCount":19,"integrity":"sha512-I3oHJVZhgBwyC3l8K8Ux6w7FlZ/BjMA37mDZOyUFZ2nb6acRv6VSuIdwGbrRbHy3qDYqQFQE9ElhQVzQmZeDdg==","signatures":[{"sig":"MEYCIQC5m/0+j1UBVfzgNEjzVQtym+Q/itAp0EhNvv/MPW9FMwIhAL8NP+X8955p1WCm4dpi3/sU6p0foEJvnKSiO0mhnyvT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39069},"main":"dist/index.cjs","type":"module","_from":"file:captcha-pro-uniapp-vue2-2.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./types":"./dist/types.js","./request":"./dist/request.js","./click-captcha.vue":"./src/components/click-captcha.vue","./popup-captcha.vue":"./src/components/popup-captcha.vue","./slider-captcha.vue":"./src/components/slider-captcha.vue"},"scripts":{"test":"echo 'no tests'","build":"vite build -c build/vite.config.ts","clean":"rm-all dist","watch":"vite build -c build/vite.config.ts -w"},"_npmUser":{"name":"saqqdy","email":"saqqdy@qq.com"},"_resolved":"/tmp/a54cc545835ea07ef23ce913f85cd044/captcha-pro-uniapp-vue2-2.1.0.tgz","_integrity":"sha512-I3oHJVZhgBwyC3l8K8Ux6w7FlZ/BjMA37mDZOyUFZ2nb6acRv6VSuIdwGbrRbHy3qDYqQFQE9ElhQVzQmZeDdg==","_npmVersion":"10.8.2","description":"uni-app + Vue 2 captcha components for captcha-pro (backend-only mode)","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@captcha-pro/mp-shared":"2.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.4.19","rm-all":"^1.1.1","typescript":"^5.9.3","@types/node":"^24.13.3"},"peerDependencies":{"vue":"^2.7.0"},"_npmOperationalInternal":{"tmp":"tmp/uniapp-vue2_2.1.0_1786844031614_0.2230930189846294","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@captcha-pro/uniapp-vue2","description":"uni-app + Vue 2 captcha components for captcha-pro (backend-only mode)","type":"module","version":"2.2.0","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.js"},"./slider-captcha.vue":"./src/components/slider-captcha.vue","./click-captcha.vue":"./src/components/click-captcha.vue","./popup-captcha.vue":"./src/components/popup-captcha.vue","./request":"./dist/request.js","./types":"./dist/types.js"},"dependencies":{"@captcha-pro/mp-shared":"2.2.0"},"devDependencies":{"@types/node":"^24.13.3","rm-all":"^1.1.1","typescript":"^5.9.3","vite":"^5.4.19"},"peerDependencies":{"vue":"^2.7.0"},"keywords":["captcha","uniapp","vue2","slider-captcha","click-captcha"],"license":"MIT","author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"scripts":{"build":"vite build -c build/vite.config.ts","watch":"vite build -c build/vite.config.ts -w","clean":"rm-all dist","test":"echo 'no tests'"},"_id":"@captcha-pro/uniapp-vue2@2.2.0","_integrity":"sha512-a4DQugf5ZtxODS7bbxTqCcqovEiKad/UxzNRt1GfYJA3yJOszV12RbMJpnorDEZvFKEXxoOO/XjhAxjKRoIozQ==","_resolved":"/tmp/8733b5486b3c95bd8fb277edca248328/captcha-pro-uniapp-vue2-2.2.0.tgz","_from":"file:captcha-pro-uniapp-vue2-2.2.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-a4DQugf5ZtxODS7bbxTqCcqovEiKad/UxzNRt1GfYJA3yJOszV12RbMJpnorDEZvFKEXxoOO/XjhAxjKRoIozQ==","shasum":"7e26bb309f0dff497d07755f3cb7a5efeff329f8","tarball":"https://registry.npmjs.org/@captcha-pro/uniapp-vue2/-/uniapp-vue2-2.2.0.tgz","fileCount":19,"unpackedSize":40522,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBjWNTvw5iODGNQbPYmBM5zqFycxzCl5vzMV0Sg9IG/NAiBZu1J8ijR9rE/+2S5vjUVl8udvoY3AC+oKmQUCuuvLKw=="}]},"_npmUser":{"name":"saqqdy","email":"saqqdy@qq.com"},"directories":{},"maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/uniapp-vue2_2.2.0_1786972762500_0.46135990338574273"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T15:21:13.177Z","modified":"2026-08-17T13:19:23.001Z","2.0.0":"2026-08-09T15:21:13.548Z","2.1.0":"2026-08-16T01:33:51.778Z","2.2.0":"2026-08-17T13:19:22.676Z"},"author":{"name":"saqqdy","email":"https://github.com/saqqdy"},"license":"MIT","keywords":["captcha","uniapp","vue2","slider-captcha","click-captcha"],"description":"uni-app + Vue 2 captcha components for captcha-pro (backend-only mode)","maintainers":[{"name":"saqqdy","email":"saqqdy@qq.com"}],"readme":"# @captcha-pro/uniapp-vue2\n\nuni-app + Vue 2 captcha components for Captcha Pro (backend-only mode).\n\n**[简体中文](./README_CN.md)**\n\n## Installation\n\n```bash\npnpm add @captcha-pro/uniapp-vue2\n```\n\n## Important: Backend-Only Mode\n\nThis package only supports backend verification mode. All captcha images are provided by backend API, `backend` configuration is required.\n\n## Usage\n\n### Global Registration\n\n```javascript\nimport Vue from 'vue'\nimport CaptchaPro from '@captcha-pro/uniapp-vue2'\n\nVue.use(CaptchaPro)\n```\n\n### Component Usage\n\n```vue\n<template>\n  <!-- Slider Captcha -->\n  <SliderCaptcha\n    :backend=\"backendConfig\"\n    :width=\"300\"\n    :height=\"170\"\n    @success=\"onSuccess\"\n    @fail=\"onFail\"\n  />\n\n  <!-- Click Captcha -->\n  <ClickCaptcha\n    :backend=\"backendConfig\"\n    :width=\"300\"\n    :height=\"170\"\n    @success=\"onSuccess\"\n  />\n\n  <!-- Popup Captcha -->\n  <PopupCaptcha\n    ref=\"popupRef\"\n    type=\"slider\"\n    :backend=\"backendConfig\"\n    @success=\"onSuccess\"\n  />\n</template>\n\n<script>\nexport default {\n  data() {\n    return {\n      backendConfig: {\n        getCaptcha: 'https://your-api.com/captcha/get',\n        verify: 'https://your-api.com/captcha/verify',\n        timeout: 10000,\n      },\n    }\n  },\n  methods: {\n    onSuccess() {\n      console.log('Verification passed!')\n    },\n    showPopup() {\n      this.$refs.popupRef.show()\n    },\n  },\n}\n</script>\n```\n\n### Using Mixins\n\n```vue\n<template>\n  <view ref=\"containerRef\" class=\"captcha-container\" />\n  <view v-if=\"loading\">Loading...</view>\n  <view v-if=\"status === 'success'\" class=\"success\">{{ statusText }}</view>\n</template>\n\n<script>\nimport { sliderCaptchaMixin } from '@captcha-pro/uniapp-vue2/mixins'\n\nexport default {\n  mixins: [sliderCaptchaMixin],\n  data() {\n    return {\n      backendConfig: {\n        getCaptcha: '/api/captcha/get',\n        verify: '/api/captcha/verify',\n      },\n    }\n  },\n  // Mixin provides: status, statusText, loading, error, refresh, etc.\n}\n</script>\n```\n\n## Backend Configuration (Required)\n\n```typescript\ninterface BackendConfig {\n  getCaptcha: string | (params: any) => Promise<any>  // Required\n  verify: string | (data: any) => Promise<any>        // Required\n  headers?: Record<string, string>                     // Optional\n  timeout?: number                                     // Optional, default: 10000\n}\n```\n\nExample with custom functions:\n\n```javascript\nbackendConfig: {\n  async getCaptcha(params) {\n    const res = await uni.request({\n      url: '/api/captcha/get',\n      data: params,\n    })\n    return res.data\n  },\n  async verify(data) {\n    const res = await uni.request({\n      url: '/api/captcha/verify',\n      data,\n      method: 'POST',\n    })\n    return res.data\n  },\n}\n```\n\n## Components\n\n### SliderCaptcha\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| backend | Object | - | **Required**, backend API config |\n| width | Number | 300 | Container width |\n| height | Number | 170 | Container height |\n| sliderWidth | Number | 42 | Slider piece width |\n| sliderHeight | Number | 42 | Slider piece height |\n| showRefresh | Boolean | true | Show refresh button |\n| locale | String | 'zh-CN' | Language |\n\n### ClickCaptcha\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| backend | Object | - | **Required**, backend API config |\n| width | Number | 300 | Container width |\n| height | Number | 170 | Container height |\n| showRefresh | Boolean | true | Show refresh button |\n\n### PopupCaptcha\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| type | String | 'slider' | 'slider' or 'click' |\n| backend | Object | - | **Required**, backend API config |\n| title | String | '请完成安全验证' | Popup title |\n| maskClosable | Boolean | true | Close on mask click |\n| showClose | Boolean | true | Show close button |\n| autoClose | Boolean | true | Auto close on success |\n| closeDelay | Number | 500 | Close delay (ms) |\n\n## Ref Methods\n\n```javascript\n// Access via ref\nthis.$refs.captcha.refresh()\nthis.$refs.captcha.getData()\n\n// PopupCaptcha methods\nthis.$refs.popupRef.show()\nthis.$refs.popupRef.hide()\nthis.$refs.popupRef.isVisible()\n```\n\n## Events\n\n| Event | Description | Payload |\n|-------|-------------|---------|\n| success | Verification passed | `{ verifiedAt }` |\n| fail | Verification failed | - |\n| refresh | Refresh clicked | - |\n| error | Loading error | `Error` |\n| open | Popup opened | - |\n| close | Popup closed | - |\n\n## License\n\nMIT","readmeFilename":"README.md"}