zouzs 1 hónapja
szülő
commit
2c8d15f2ca

+ 0 - 8
.husky/commit-msg

@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# shellcheck source=./_/husky.sh
-. "$(dirname "$0")/_/husky.sh"
-
-PATH="/usr/local/bin:$PATH"
-
-npx --no-install commitlint --edit "$1"

+ 0 - 9
.husky/common.sh

@@ -1,9 +0,0 @@
-#!/bin/sh
-command_exists () {
-  command -v "$1" >/dev/null 2>&1
-}
-
-# Workaround for Windows 10, Git Bash and Pnpm
-if command_exists winpty && test -t 1; then
-  exec < /dev/tty
-fi

+ 0 - 10
.husky/pre-commit

@@ -1,10 +0,0 @@
-#!/bin/sh
-. "$(dirname "$0")/_/husky.sh"
-. "$(dirname "$0")/common.sh"
-
-[ -n "$CI" ] && exit 0
-
-PATH="/usr/local/bin:$PATH"
-
-# Perform lint check on files in the staging area through .lintstagedrc configuration
-pnpm exec lint-staged

+ 2 - 3
package.json

@@ -18,7 +18,6 @@
     "lint:prettier": "prettier --write  \"src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}\"",
     "lint:stylelint": "stylelint --cache --fix \"**/*.{html,vue,css,scss}\" --cache-location node_modules/.cache/stylelint/",
     "lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint",
-    "prepare": "husky",
     "preinstall": "npx only-allow pnpm"
   },
   "keywords": [
@@ -48,6 +47,7 @@
     "url": "https://github.com/xiaoxian521"
   },
   "dependencies": {
+    "@fingerprintjs/fingerprintjs": "^4.6.2",
     "@pureadmin/descriptions": "^1.2.1",
     "@pureadmin/table": "^3.3.0",
     "@pureadmin/utils": "^2.6.2",
@@ -59,7 +59,6 @@
     "dayjs": "^1.11.13",
     "echarts": "^5.6.0",
     "element-plus": "^2.11.3",
-    "plus-pro-components": "^0.1.29",
     "js-cookie": "^3.0.5",
     "js-md5": "^0.8.3",
     "localforage": "^1.10.0",
@@ -68,6 +67,7 @@
     "path-browserify": "^1.0.1",
     "pinia": "^3.0.3",
     "pinyin-pro": "^3.26.0",
+    "plus-pro-components": "^0.1.29",
     "qs": "^6.14.0",
     "responsive-storage": "^2.2.0",
     "sortablejs": "^1.15.6",
@@ -101,7 +101,6 @@
     "eslint-config-prettier": "^10.1.8",
     "eslint-plugin-prettier": "^5.5.3",
     "eslint-plugin-vue": "^10.3.0",
-    "husky": "^9.1.7",
     "lint-staged": "^16.1.2",
     "postcss": "^8.5.6",
     "postcss-html": "^1.8.0",

+ 15 - 10
pnpm-lock.yaml

@@ -8,6 +8,9 @@ importers:
 
   .:
     dependencies:
+      '@fingerprintjs/fingerprintjs':
+        specifier: ^4.6.2
+        version: 4.6.2
       '@pureadmin/descriptions':
         specifier: ^1.2.1
         version: 1.2.1(echarts@5.6.0)(element-plus@2.11.3(vue@3.5.21(typescript@5.9.2)))(typescript@5.9.2)
@@ -162,9 +165,6 @@ importers:
       eslint-plugin-vue:
         specifier: ^10.3.0
         version: 10.4.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.36.0(jiti@2.5.1))(vue-eslint-parser@10.2.0(eslint@9.36.0(jiti@2.5.1)))
-      husky:
-        specifier: ^9.1.7
-        version: 9.1.7
       lint-staged:
         specifier: ^16.1.2
         version: 16.2.0
@@ -854,6 +854,9 @@ packages:
     resolution: {integrity: sha512-OEl393iCOoo/z8bMezRlJu+GlRGlsKbUAN7jKB6LhnKoqKve5DXRpalbItIIcwnCjs1k/FOPjFzcA6Qn+H+YbA==}
     engines: {node: '>=18.0.0', npm: '>=9.0.0'}
 
+  '@fingerprintjs/fingerprintjs@4.6.2':
+    resolution: {integrity: sha512-g8mXuqcFKbgH2CZKwPfVtsUJDHyvcgIABQI7Y0tzWEFXpGxJaXuAuzlifT2oTakjDBLTK4Gaa9/5PERDhqUjtw==}
+
   '@floating-ui/core@1.7.3':
     resolution: {integrity: sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==}
 
@@ -2301,11 +2304,6 @@ packages:
   htmlparser2@8.0.2:
     resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==}
 
-  husky@9.1.7:
-    resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==}
-    engines: {node: '>=18'}
-    hasBin: true
-
   ignore@5.3.2:
     resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
     engines: {node: '>= 4'}
@@ -3521,6 +3519,9 @@ packages:
   tslib@2.4.0:
     resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==}
 
+  tslib@2.8.1:
+    resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
+
   type-check@0.4.0:
     resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
     engines: {node: '>= 0.8.0'}
@@ -4369,6 +4370,10 @@ snapshots:
 
   '@faker-js/faker@9.9.0': {}
 
+  '@fingerprintjs/fingerprintjs@4.6.2':
+    dependencies:
+      tslib: 2.8.1
+
   '@floating-ui/core@1.7.3':
     dependencies:
       '@floating-ui/utils': 0.2.10
@@ -5966,8 +5971,6 @@ snapshots:
       domutils: 3.2.2
       entities: 4.5.0
 
-  husky@9.1.7: {}
-
   ignore@5.3.2: {}
 
   ignore@7.0.5: {}
@@ -7118,6 +7121,8 @@ snapshots:
 
   tslib@2.4.0: {}
 
+  tslib@2.8.1: {}
+
   type-check@0.4.0:
     dependencies:
       prelude-ls: 1.2.1

+ 18 - 0
src/router/modules/testFingerPrints.ts

@@ -0,0 +1,18 @@
+// 最简代码,也就是这些字段必须有
+export default {
+    path: "/testFingerPrints",
+    meta: {
+        title: "测试信息获取"
+    },
+    children: [
+        {
+            path: "/testFingerPrints/information",
+            name: "Information",
+            component: () => import("@/views/testFingerPrints/information/index.vue"),
+            meta: {
+                title: "fingerprints,浏览器指纹",
+                showParent: true
+            }
+        },
+    ]
+};

+ 27 - 0
src/router/modules/testUpload.ts

@@ -0,0 +1,27 @@
+// 最简代码,也就是这些字段必须有
+export default {
+    path: "/testUpload",
+    meta: {
+        title: "上传文件"
+    },
+    children: [
+        {
+            path: "/testUpload/upload",
+            name: "Upload",
+            component: () => import("@/views/testUpload/upload/index.vue"),
+            meta: {
+                title: "测试上传",
+                showParent: true
+            }
+        },
+        {
+            path: "/testUpload/upload-oss",
+            name: "UploadOss",
+            component: () => import("@/views/testUpload/upload-oss/index.vue"),
+            meta: {
+                title: "上传到oss",
+                showParent: true
+            }
+        }
+    ]
+};

+ 43 - 0
src/views/testFingerPrints/information/index.vue

@@ -0,0 +1,43 @@
+<script setup lang="ts">
+import {load} from '@fingerprintjs/fingerprintjs';
+import {ref} from "vue";
+
+defineOptions({
+  name: "Information"
+})
+
+let fingerId = ref<string>();
+let userId = ref<string[]>();
+
+const finger = async () => {
+  const result = await load();
+  const visitorId = await result.get();
+  console.log(visitorId.visitorId); // 打印生成的指纹
+  fingerId.value = visitorId.visitorId;
+}
+
+
+const userAgent = () => {
+  console.log("userAgent", navigator.userAgent);
+  userId.value = navigator.userAgent.split("/");
+  return navigator.userAgent;
+}
+</script>
+
+<template>
+  <div>
+    <el-card class="box-card flex flex-row items-center justify-center">
+      <el-button @click="finger">生成指纹</el-button>
+      <span class="ml-5">{{ fingerId }}</span>
+    </el-card>
+    <el-card class="box-card flex flex-row items-center justify-center mt-5">
+      <el-button @click="userAgent">获取浏览器信息</el-button>
+      <span class="ml-5">{{ userId }}</span>
+    </el-card>
+  </div>
+
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 44 - 0
src/views/testUpload/upload-oss/index.vue

@@ -0,0 +1,44 @@
+<script setup lang="ts">
+defineOptions({
+  name: "UploadOss"
+})
+import { ref } from "vue";
+
+const fileList = ref([
+  {
+    name: "food.jpeg",
+    url: "https://example.com/food.jpeg"
+  },
+  {
+    name: "drink.jpeg",
+    url: "https://example.com/drink.jpeg"
+  }
+]);
+</script>
+
+<template>
+  <div>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>上传组件</span>
+      </div>
+      <el-upload
+        class="upload-demo"
+        drag
+        action="https://jsonplaceholder.typicode.com/posts/"
+        :on-preview="(file) => { console.log('preview', file); }"
+        :on-remove="(file, fileList) => { console.log('remove', file, fileList); }"
+        :before-remove="(file, fileList) => { return $confirm(`确定移除 ${file.name}?`); }"
+        :file-list="fileList"
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
+      </el-upload>
+    </el-card>
+  </div>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 75 - 0
src/views/testUpload/upload/index.vue

@@ -0,0 +1,75 @@
+<script setup lang="ts">
+defineOptions({
+  name: "Upload"
+})
+import { ref } from "vue";
+const fileList = ref([
+  {
+    name: "food.jpeg",
+    url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
+  },
+  {
+    name: "food2.jpeg",
+    url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
+  }
+]);
+
+const form = ref({
+  name: '',
+  file: null
+})
+</script>
+
+<template>
+  <div>
+    <el-card class="box-card">
+      <div slot="header" class="clearfix">
+        <span>上传组件</span>
+      </div>
+      <el-upload
+        class="upload-demo"
+        drag
+        action="https://jsonplaceholder.typicode.com/posts/"
+        :on-preview="(file) => { console.log('preview', file); }"
+        :on-remove="(file, fileList) => { console.log('remove', file, fileList); }"
+        :before-remove="(file, fileList) => { return $confirm(`确定移除 ${file.name}?`); }"
+        :file-list="fileList"
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
+      </el-upload>
+    </el-card>
+
+    <el-card class="box-card mt-5">
+      <div slot="header" class="clearfix">
+        <span>表单中的上传组件</span>
+      </div>
+      <el-form :model="{ name: '', file: null }" label-width="80px">
+        <el-form-item label="姓名">
+          <el-input v-model="form.name"></el-input>
+        </el-form-item>
+        <el-form-item label="上传文件">
+          <el-upload
+            action="https://jsonplaceholder.typicode.com/posts/"
+            :on-preview="(file) => { console.log('preview', file); }"
+            :on-remove="(file, fileList) => { console.log('remove', file, fileList); }"
+            :before-remove="(file, fileList) => { return $confirm(`确定移除 ${file.name}?`); }"
+            :file-list="fileList"
+          >
+            <el-button size="small" type="primary">点击上传</el-button>
+            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
+          </el-upload>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary">提交</el-button>
+          <el-button>重置</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<style scoped lang="scss">
+
+</style>