## Build Setup


```bash
# clone the project
git clone http://172.23.105.167/product/cusc-realname-pc.git

# enter the project directory
cd cusc-realname-pc

# install dependency
npm install

# husky install
npx husky install

# develop
npm run dev
```

This will automatically open http://localhost:8080

## Build

```bash
# build for test environment
npm run build:stage

# build for production environment
npm run build:prod
```

## Advanced

```bash
# 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
```
## husky && lint-staged && validate-commit-msg

```bash
# init husky
npx husky-init

# package.json
"lint-staged": {
  "src/**/*.{js,vue,jsx,ts,tsx}": "eslint"
},
"config": {
  "validate-commit-msg": {
    "types": ["feat", "fix", "docs", "style", "refactor", "test", "chore"],
    "warnOnFail": false,
    "maxSubjectLength": 100,
    "subjectPattern": ".+",
    "subjectPatternErrorMsg": "请输入message信息!",
    "helpMessage": "Commit message 格式错误， http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html"
  }
},

# .husky/pre-commmit
npx lint-staged

# .husky/commit-msg
npx validate-commit-msg
```

## 安卓bridge

|接口名|访问路径|接口回调|入参| 返回值|
|:--|:--|:--|:--|:--|
|获取app是否处于后台|无|window.callJSAPPStatus|无|result：结果|
|打开相机|window.android.getAndroidCamera|window.callJSImages|无|{ imageBase64: '图片的base64' }|
|打开相册|window.android.getAndroidPhoto|window.callJSImages|无|{ imageBase64: '图片的base64' }|
|调用相机扫二维码|window.android.getAndroidCodeScan|window.callJSCodeScan|isBarcode: 是否需要打开条形码功能（默认只打开二维码）|result：扫码结果|
|获取读卡器上身份证信息|window.android.getAndroidBluetooth|window.callJSBluetooth|无|{ name: "姓名", gender: "性别", idNum: "证件号码", expireDate: "过期时间", address: "证件地址" }|
|读卡器链接状态|window.android.getAndroidDeviceStatus|window.callJSDeviceStatus|无|appstatus: 设备的链接状态|
|pad端NFC读取身份证|window.android.readIDCardByOTG|window.callJSBluetooth|无|{ name: "姓名", gender: "性别", idNum: "证件号码", expireDate: "过期时间", address: "证件地址" }|
|获取当前PAD，一体机设备类型|window.android.geOtgReadType|无|无|type：设备类型|
|切换蓝牙设备|window.android.choiceBluetoothDevice|window.callJSBluetooth|无|无|
|获取摄像头列表|window.android.getUvcCameraList|无|无|设备列表JSON字符串|
|打开指定的摄像头|window.android.openTargetUvcCamera|window.callJSUvcCameras|无|{ type: "返回的视频还是图片", file: "文件的base64编码" }|
|打开默认摄像头|window.android.openUvcCamera|window.callJSUvcCameras|无|{ type: "返回的视频还是图片", file: "文件的base64编码" }|
|打开摄像头|window.android.getAndroidVideo|window.callJSVideos|无|{ file: "文件的base64编码" }|
|下载文件|window.android.saveFile|无|base64：文件的base64编码；fileName：下载的文件名|无|
