@sbs-plugin/vue2-intelligent-verification
v0.0.2
Published
Vue2 智能验证插件,提供文本、图片、音频、视频的智能核查功能
Readme
vue-admin-template
不要用 pnpm install,用 npm install
Build Setup
install dependency
npm install
develop
npm run dev
This will automatically open http://localhost:9528
## Build
```bash
# build for test environment
npm run build:stage
# build for production environment
npm run build:prodAdvanced
# preview the release environment effect
npm run preview
# preview the release environment effect + static resource analysis
npm run preview -- --report
# code format check
npm run lint
# code format check and auto fix
npm run lint -- --fix发布 npm 包指南
前置条件
确保已创建备份文件:
package.json.bak(主项目 package.json 备份)vue.config.js.bak(主项目 vue.config.js 备份)
如未创建,运行:
cp package.json package.json.bak
cp vue.config.js vue.config.js.bak切换到 npm 包配置
# 1. 切换 package.json
cp package.npm.json package.json
# 2. 切换 vue.config.js
cp vue.config.npm.js vue.config.js
# 3. 清理旧构建产物
rm -rf dist
# 4. 构建库
npm run lib
# 5. 发布到 npm
npm publish --access public恢复主项目配置
# 1. 恢复 package.json
cp package.json.bak package.json
# 2. 恢复 vue.config.js
cp vue.config.js.bak vue.config.js完整流程(一键切换 -> 发布 -> 恢复)
# 切换配置
cp package.npm.json package.json && cp vue.config.npm.js vue.config.js
# 构建并发布
rm -rf dist && npm run lib && npm publish --access public
# 恢复配置
cp package.json.bak package.json && cp vue.config.js.bak vue.config.js组件使用
1.Install dependencies
npm i @sbs-plugin/vue2-intelligent-verification2.Import the plugin and register it in your project's entry file (e.g., main.js or main.ts)
import Vue2IntelligentVerification from '@sbs-plugin/vue2-intelligent-verification';
import '@sbs-plugin/vue2-intelligent-verification/dist/vue2-intelligent-verification.css'
window.Vue = Vue
Vue.use(Vue2IntelligentVerification, {
theme: {
primaryColor: '#1677ff'
},
})
// 2. 获取到 token 后,使用方法1更新
IntelligentVerification.setToken('your-access-token-here')
// 3. 或者使用方法2更新
this.$setVerificationToken('your-access-token-here')
Vue.prototype.$setVerificationToken('your-access-token-here')
// 4.组件
<TextCheck />
<PicCheck />
<AudioCheck />
<VideoCheck />