diff --git a/api/agent.js b/api/agent.js
index 4dc7ad7..0dee233 100644
--- a/api/agent.js
+++ b/api/agent.js
@@ -6,13 +6,13 @@ module.exports = agent => {
// 你还可以通过 messenger 对象发送消息给 App Worker。
// 但是,需要等 App Worker 启动成功后才能发送,否则可能丢失消息。
agent.messenger.on('egg-ready', () => {
- let params = {
- subType: "add",
- name: "admin",
- password: md5("admin"),
- email: "admin@admin.com",
- allowRegist: true,
- }
- agent.messenger.sendToApp('createAdmin', params);
+ // let params = {
+ // subType: "add",
+ // name: "admin",
+ // password: md5("admin"),
+ // email: "admin@admin.com",
+ // allowRegist: true,
+ // }
+ // agent.messenger.sendToApp('createAdmin', params);
});
};
\ No newline at end of file
diff --git a/api/app.js b/api/app.js
index 3fa0166..e821a51 100644
--- a/api/app.js
+++ b/api/app.js
@@ -32,15 +32,15 @@ class AppBootHook {
}
async serverDidReady() {
- // http/https 服务器已启动,开始接收外部请求
- // 此时可以从 app.server 获取 server 实例
- const ctx = await this.app.createAnonymousContext();
- this.app.messenger.on('createAdmin', async params => {
- let res = await ctx.model.User.find({ name: params.name });
- if (!res.length) {
- await ctx.service.user.index(params)
- }
- });
+ // // http/https 服务器已启动,开始接收外部请求
+ // // 此时可以从 app.server 获取 server 实例
+ // const ctx = await this.app.createAnonymousContext();
+ // this.app.messenger.on('createAdmin', async params => {
+ // let res = await ctx.model.User.find({ name: params.name });
+ // if (!res.length) {
+ // await ctx.service.user.index(params)
+ // }
+ // });
}
}
diff --git a/api/app/controller/user.js b/api/app/controller/user.js
index 0d87ec6..2a86a4a 100644
--- a/api/app/controller/user.js
+++ b/api/app/controller/user.js
@@ -3,14 +3,20 @@ const { Controller } = require('egg');
class UserController extends Controller {
async index() {
const { ctx } = this;
- console.log(777,ctx.request.body)
+ // console.log(777,ctx.request.body)
ctx.body = await ctx.service.user.index(ctx.request.body)
}
async download() {
const { ctx } = this;
- console.log(777,ctx.request.body)
+ // console.log(777,ctx.request.body)
ctx.body = await ctx.service.user.downloadPng(ctx.request.body)
}
+ async getPng() {
+ const { ctx } = this;
+ console.log(777, ctx.request.url)
+ let id=ctx.request.url.split('?')[1].split('=')[1]
+ ctx.body = await ctx.service.user.getPng(id)
+ }
}
module.exports = UserController;
diff --git a/api/app/router.js b/api/app/router.js
index 654b690..8ec3f70 100644
--- a/api/app/router.js
+++ b/api/app/router.js
@@ -5,4 +5,5 @@ module.exports = app => {
const { router, controller } = app;
router.post('/api/upload', controller.user.index);
router.post('/api/download', controller.user.download);
+ router.get('/api/getPng', controller.user.getPng);
};
diff --git a/api/app/service/user.js b/api/app/service/user.js
index 10420c5..93b2faa 100644
--- a/api/app/service/user.js
+++ b/api/app/service/user.js
@@ -2,73 +2,111 @@
const Service = require('egg').Service;
const _ = require("lodash")
-const tencentcloud = require('tencentcloud-sdk-nodejs');
-// 导入对应产品模块的client models。
-const CvmClient = tencentcloud.iotexplorer.v20190423.Client
-
+const tencentcloud = require("tencentcloud-sdk-nodejs-ft");
+const { mongoose } = require('../../config/plugin');
+const FtClient = tencentcloud.ft.v20200304.Client;
class UserService extends Service {
async index(params) {
let { ctx } = this
let modelLocal = ctx.model.User
let returnData = { hasError: false, msg: "数据错误", list: [] }
- console.log(77777, params)
- // 新增
- paramsLocal["update_at"] = Date.now();
+ // 请求照片
+ let reqCount = 9
+ let pngList = []
+ for (let i = 1; i < reqCount; i++) {
+ let para = {
+ img: params.img,
+ age: i * 10
+ }
+ let pngRes = await this.createPng(para)
+ if (pngRes.haserror) {
+ pngList.push({
+ age: i * 10,
+ png: "",
+ ResultUrl: "",
+ RequestId: "",
+ })
+ } else {
+ pngList.push({
+ age: i * 10,
+ png: `data:image/png;base64,${pngRes.ResultImage}`,
+ ResultUrl: pngRes.ResultUrl,
+ RequestId: pngRes.RequestId,
+ })
+ }
+
+ }
let paramsLocal = {
name: params.name,
age: params.age,
+ createImgList: pngList,
imgbase64: params.img,
}
- let pngRes = await this.createPng(params)
- // let res = await modelLocal.create(paramsLocal)
+ let res = await modelLocal.create(paramsLocal)
returnData.hasError = false
returnData.msg = "数据新增成功"
returnData.list = res
return returnData
}
async createPng(params) {
- let { ctx } = this
- let modelLocal = ctx.model.User
- let returnData = { hasError: false, msg: "数据错误", list: [] }
- console.log(77777, params)
- const client = new CvmClient({
- // 为了保护密钥安全,建议将密钥设置在环境变量中或者配置文件中,请参考本文凭证管理章节。
- // 硬编码密钥到代码中有可能随代码泄露而暴露,有安全隐患,并不推荐。
+ let clientConfig = {
credential: {
- secretId: "AKIDLgwLkIcpoZ6PZht382oUMCC6wdFhMwZ8",
- secretKey: "TmvwtkcYWTJ5qkEg3FIB2sokccepOsCO",
+ secretId: "AKIDLgwLkIcpoZ6PZht382oUMCC6wdFhMwZ8",//客户端身份标识
+ secretKey: "TmvwtkcYWTJ5qkEg3FIB2sokccepOsCO",//客户端身份密钥
},
- // 产品地域
region: "ap-chengdu",
- // 可选配置实例
profile: {
- signMethod: "TC3-HMAC-SHA256", // 签名方法
httpProfile: {
- reqMethod: "POST", // 请求方法
- reqTimeout: 30, // 请求超时时间,默认60s
+ endpoint: "ft.tencentcloudapi.com",
},
},
- }
- );
- const params = {
- // 这里填写接口所需的参数,例如:
- ImageUrl: params.img, // 图片URL
- Age: params.age, // 想要改变的年龄,比如50表示变老50岁
- // 其他参数根据接口文档填充
};
-
- let res = client.ChangeFaceAge(params)
- console.log(777, res)
- return returnData
+ // 实例化要请求产品的client对象,clientProfile是可选的
+ let client = new FtClient(clientConfig);
+ let paramsLocal = {
+ AgeInfos: [
+ { Age: params.age },
+ ],
+ Image: params.img
+ }
+ let resPng = {}
+ try {
+ console.log(9999, paramsLocal.AgeInfos[0].Age)
+ resPng = await client.ChangeAgePic(paramsLocal);
+ if (resPng.ResultImage) {
+ return resPng
+ } else {
+ return {
+ ResultImage: "",
+ ResultUrl: "",
+ RequestId: "",
+ haserror: true
+ }
+ }
+ } catch (e) {
+ return {
+ ResultImage: "",
+ ResultUrl: "",
+ RequestId: "",
+ haserror: true
+ }
+ }
}
async downloadPng(params) {
let { ctx } = this
let modelLocal = ctx.model.User
let returnData = { hasError: false, msg: "数据错误", list: [] }
- console.log(77777, params)
//查询后下载8张图片
return returnData
}
+ async getPng(id) {
+ let { ctx } = this
+ let modelLocal = ctx.model.User
+ let res = await modelLocal.find({ _id: id })
+ //查询后下载8张图片
+ return res
+ }
+
}
module.exports = UserService;
diff --git a/api/config/config.default.js b/api/config/config.default.js
index 984a425..80b595d 100644
--- a/api/config/config.default.js
+++ b/api/config/config.default.js
@@ -28,6 +28,15 @@ module.exports = appInfo => {
ignore: '/',
},
};
+ config.cors = {
+ // 任何地址都可以访问
+ origin: "*",
+ // 指定地址才可以访问
+ // origin: 'http://localhost:8080',
+ allowMethods: 'GET,PUT,POST,DELETE',
+ // cookie跨域配置
+ credentials: true
+ };
config.bodyParser = {
formLimit: "100mb",
jsonLimit: "100mb",
diff --git a/api/package.json b/api/package.json
index b7c248f..f6de042 100644
--- a/api/package.json
+++ b/api/package.json
@@ -12,7 +12,7 @@
"egg-scripts": "2",
"lodash": "^4.17.21",
"md5": "^2.3.0",
- "tencentcloud-sdk-nodejs": "^4.0.852"
+ "tencentcloud-sdk-nodejs-ft": "^4.0.810"
},
"devDependencies": {
"egg-bin": "6",
diff --git a/front/package-lock.json b/front/package-lock.json
index c511252..fa40bba 100644
--- a/front/package-lock.json
+++ b/front/package-lock.json
@@ -17,7 +17,9 @@
"element-plus": "^2.7.1",
"lodash": "^4.17.21",
"pinia": "^2.1.7",
- "pinia-plugin-persist": "^1.0.0"
+ "pinia-plugin-persist": "^1.0.0",
+ "qrcode": "^1.5.3",
+ "qrcode-vue3": "^1.6.8"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
@@ -1137,6 +1139,7 @@
"version": "0.0.9",
"resolved": "https://registry.npmmirror.com/@jiaminghi/bezier-curve/-/bezier-curve-0.0.9.tgz",
"integrity": "sha512-u9xJPOEl6Dri2E9FfmJoGxYQY7vYJkURNX04Vj64tdi535tPrpkuf9Sm0lNr3QTKdHQh0DdNRsaa62FLQNQEEw==",
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.5.5"
}
@@ -1145,6 +1148,7 @@
"version": "0.4.3",
"resolved": "https://registry.npmmirror.com/@jiaminghi/c-render/-/c-render-0.4.3.tgz",
"integrity": "sha512-FJfzj5hGj7MLqqqI2D7vEzHKbQ1Ynnn7PJKgzsjXaZpJzTqs2Yw5OSeZnm6l7Qj7jyPAP53lFvEQNH4o4j6s+Q==",
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.5.5",
"@jiaminghi/bezier-curve": "*",
@@ -1156,24 +1160,23 @@
"version": "0.2.18",
"resolved": "https://registry.npmmirror.com/@jiaminghi/charts/-/charts-0.2.18.tgz",
"integrity": "sha512-K+HXaOOeWG9OOY1VG6M4mBreeeIAPhb9X+khG651AbnwEwL6G2UtcAQ8GWCq6GzhczcLwwhIhuaHqRygwHC0sA==",
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.5.5",
"@jiaminghi/c-render": "^0.4.3"
}
},
"node_modules/@jiaminghi/color": {
- "version": "0.1.1",
- "resolved": "https://registry.npmmirror.com/@jiaminghi/color/-/color-0.1.1.tgz",
- "integrity": "sha512-M09+Sb5HGqVim0zo+nG5gU1v+6gXT8ptr0BZR6dMGt83XmCJgnZtO8s7llTW4hLFFFM5co6geZvTekqLpSPAAQ==",
- "license": "MIT",
- "dependencies": {
- "@babel/runtime": "^7.5.5"
- }
+ "version": "1.1.3",
+ "resolved": "https://registry.npmmirror.com/@jiaminghi/color/-/color-1.1.3.tgz",
+ "integrity": "sha512-ZY3hdorgODk4OSTbxyXBPxAxHPIVf9rPlKJyK1C1db46a50J0reFKpAvfZG8zMG3lvM60IR7Qawgcu4ZDO3+Hg==",
+ "license": "MIT"
},
"node_modules/@jiaminghi/transition": {
"version": "1.1.11",
"resolved": "https://registry.npmmirror.com/@jiaminghi/transition/-/transition-1.1.11.tgz",
"integrity": "sha512-owBggipoHMikDHHDW5Gc7RZYlVuvxHADiU4bxfjBVkHDAmmck+fCkm46n2JzC3j33hWvP9nSCAeh37t6stgWeg==",
+ "license": "MIT",
"dependencies": {
"@babel/runtime": "^7.5.5"
}
@@ -1234,6 +1237,7 @@
"version": "1.7.2",
"resolved": "https://registry.npmmirror.com/@kjgl77/datav-vue3/-/datav-vue3-1.7.2.tgz",
"integrity": "sha512-Fvllk4rJEdUwLdumvsnPADZNPMKkDdC7u/vJEAPBsMh6UgFQytIT+SVtjj1vy/TXtgcH/te9hlXBPgV8LVSmQw==",
+ "license": "MIT",
"dependencies": {
"@jiaminghi/c-render": "^0.4.3",
"@jiaminghi/charts": "^0.2.18",
@@ -1241,62 +1245,6 @@
"@vueuse/core": "^10.7.2"
}
},
- "node_modules/@kjgl77/datav-vue3/node_modules/@jiaminghi/color": {
- "version": "1.1.3",
- "resolved": "https://registry.npmmirror.com/@jiaminghi/color/-/color-1.1.3.tgz",
- "integrity": "sha512-ZY3hdorgODk4OSTbxyXBPxAxHPIVf9rPlKJyK1C1db46a50J0reFKpAvfZG8zMG3lvM60IR7Qawgcu4ZDO3+Hg=="
- },
- "node_modules/@kjgl77/datav-vue3/node_modules/@types/web-bluetooth": {
- "version": "0.0.20",
- "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
- "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow=="
- },
- "node_modules/@kjgl77/datav-vue3/node_modules/@vueuse/core": {
- "version": "10.9.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.9.0.tgz",
- "integrity": "sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg==",
- "dependencies": {
- "@types/web-bluetooth": "^0.0.20",
- "@vueuse/metadata": "10.9.0",
- "@vueuse/shared": "10.9.0",
- "vue-demi": ">=0.14.7"
- }
- },
- "node_modules/@kjgl77/datav-vue3/node_modules/@vueuse/metadata": {
- "version": "10.9.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.9.0.tgz",
- "integrity": "sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA=="
- },
- "node_modules/@kjgl77/datav-vue3/node_modules/@vueuse/shared": {
- "version": "10.9.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.9.0.tgz",
- "integrity": "sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==",
- "dependencies": {
- "vue-demi": ">=0.14.7"
- }
- },
- "node_modules/@kjgl77/datav-vue3/node_modules/vue-demi": {
- "version": "0.14.7",
- "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz",
- "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
- "hasInstallScript": true,
- "bin": {
- "vue-demi-fix": "bin/vue-demi-fix.js",
- "vue-demi-switch": "bin/vue-demi-switch.js"
- },
- "engines": {
- "node": ">=12"
- },
- "peerDependencies": {
- "@vue/composition-api": "^1.0.0-rc.1",
- "vue": "^3.0.0-0 || ^2.6.0"
- },
- "peerDependenciesMeta": {
- "@vue/composition-api": {
- "optional": true
- }
- }
- },
"node_modules/@malept/cross-spawn-promise": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz",
@@ -1552,9 +1500,9 @@
"optional": true
},
"node_modules/@types/web-bluetooth": {
- "version": "0.0.16",
- "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
- "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==",
+ "version": "0.0.20",
+ "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
+ "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==",
"license": "MIT"
},
"node_modules/@types/yargs": {
@@ -1719,15 +1667,15 @@
"license": "MIT"
},
"node_modules/@vueuse/core": {
- "version": "9.13.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz",
- "integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==",
+ "version": "10.9.0",
+ "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.9.0.tgz",
+ "integrity": "sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg==",
"license": "MIT",
"dependencies": {
- "@types/web-bluetooth": "^0.0.16",
- "@vueuse/metadata": "9.13.0",
- "@vueuse/shared": "9.13.0",
- "vue-demi": "*"
+ "@types/web-bluetooth": "^0.0.20",
+ "@vueuse/metadata": "10.9.0",
+ "@vueuse/shared": "10.9.0",
+ "vue-demi": ">=0.14.7"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
@@ -1760,21 +1708,21 @@
}
},
"node_modules/@vueuse/metadata": {
- "version": "9.13.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz",
- "integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==",
+ "version": "10.9.0",
+ "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.9.0.tgz",
+ "integrity": "sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@vueuse/shared": {
- "version": "9.13.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz",
- "integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==",
+ "version": "10.9.0",
+ "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.9.0.tgz",
+ "integrity": "sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==",
"license": "MIT",
"dependencies": {
- "vue-demi": "*"
+ "vue-demi": ">=0.14.7"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
@@ -1892,7 +1840,6 @@
"version": "5.0.1",
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
@@ -1902,7 +1849,6 @@
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
- "dev": true,
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
@@ -2416,6 +2362,14 @@
"node": ">=6"
}
},
+ "node_modules/camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/caniuse-lite": {
"version": "1.0.30001616",
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001616.tgz",
@@ -2532,7 +2486,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
- "dev": true,
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
@@ -2545,7 +2498,6 @@
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
- "dev": true,
"license": "MIT"
},
"node_modules/colors": {
@@ -2688,6 +2640,14 @@
}
}
},
+ "node_modules/decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/decompress-response": {
"version": "3.3.0",
"resolved": "https://registry.npmmirror.com/decompress-response/-/decompress-response-3.3.0.tgz",
@@ -2766,6 +2726,11 @@
"license": "MIT",
"optional": true
},
+ "node_modules/dijkstrajs": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
+ "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="
+ },
"node_modules/dir-compare": {
"version": "2.4.0",
"resolved": "https://registry.npmmirror.com/dir-compare/-/dir-compare-2.4.0.tgz",
@@ -3235,13 +3200,111 @@
"vue": "^3.2.0"
}
},
+ "node_modules/element-plus/node_modules/@types/web-bluetooth": {
+ "version": "0.0.16",
+ "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz",
+ "integrity": "sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==",
+ "license": "MIT"
+ },
+ "node_modules/element-plus/node_modules/@vueuse/core": {
+ "version": "9.13.0",
+ "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-9.13.0.tgz",
+ "integrity": "sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/web-bluetooth": "^0.0.16",
+ "@vueuse/metadata": "9.13.0",
+ "@vueuse/shared": "9.13.0",
+ "vue-demi": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/element-plus/node_modules/@vueuse/core/node_modules/vue-demi": {
+ "version": "0.14.7",
+ "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz",
+ "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "vue-demi-fix": "bin/vue-demi-fix.js",
+ "vue-demi-switch": "bin/vue-demi-switch.js"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ },
+ "peerDependencies": {
+ "@vue/composition-api": "^1.0.0-rc.1",
+ "vue": "^3.0.0-0 || ^2.6.0"
+ },
+ "peerDependenciesMeta": {
+ "@vue/composition-api": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/element-plus/node_modules/@vueuse/metadata": {
+ "version": "9.13.0",
+ "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-9.13.0.tgz",
+ "integrity": "sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/element-plus/node_modules/@vueuse/shared": {
+ "version": "9.13.0",
+ "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-9.13.0.tgz",
+ "integrity": "sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==",
+ "license": "MIT",
+ "dependencies": {
+ "vue-demi": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
+ "node_modules/element-plus/node_modules/@vueuse/shared/node_modules/vue-demi": {
+ "version": "0.14.7",
+ "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz",
+ "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==",
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "vue-demi-fix": "bin/vue-demi-fix.js",
+ "vue-demi-switch": "bin/vue-demi-switch.js"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ },
+ "peerDependencies": {
+ "@vue/composition-api": "^1.0.0-rc.1",
+ "vue": "^3.0.0-0 || ^2.6.0"
+ },
+ "peerDependenciesMeta": {
+ "@vue/composition-api": {
+ "optional": true
+ }
+ }
+ },
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
- "dev": true,
"license": "MIT"
},
+ "node_modules/encode-utf8": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmmirror.com/encode-utf8/-/encode-utf8-1.0.3.tgz",
+ "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
+ },
"node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-1.0.2.tgz",
@@ -4202,7 +4265,6 @@
"version": "2.0.5",
"resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
- "dev": true,
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
@@ -4727,7 +4789,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
@@ -5418,6 +5479,14 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/pako": {
"version": "1.0.11",
"resolved": "https://registry.npmmirror.com/pako/-/pako-1.0.11.tgz",
@@ -5452,9 +5521,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
- "dev": true,
"license": "MIT",
- "peer": true,
"engines": {
"node": ">=8"
}
@@ -5620,6 +5687,14 @@
"node": ">=10.4.0"
}
},
+ "node_modules/pngjs": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz",
+ "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
"node_modules/postcss": {
"version": "8.4.38",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz",
@@ -5753,6 +5828,144 @@
"node": ">=6"
}
},
+ "node_modules/qrcode": {
+ "version": "1.5.3",
+ "resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.3.tgz",
+ "integrity": "sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==",
+ "dependencies": {
+ "dijkstrajs": "^1.0.1",
+ "encode-utf8": "^1.0.3",
+ "pngjs": "^5.0.0",
+ "yargs": "^15.3.1"
+ },
+ "bin": {
+ "qrcode": "bin/qrcode"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/qrcode-generator": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmmirror.com/qrcode-generator/-/qrcode-generator-1.4.4.tgz",
+ "integrity": "sha512-HM7yY8O2ilqhmULxGMpcHSF1EhJJ9yBj8gvDEuZ6M+KGJ0YY2hKpnXvRD+hZPLrDVck3ExIGhmPtSdcjC+guuw==",
+ "license": "MIT"
+ },
+ "node_modules/qrcode-vue3": {
+ "version": "1.6.8",
+ "resolved": "https://registry.npmmirror.com/qrcode-vue3/-/qrcode-vue3-1.6.8.tgz",
+ "integrity": "sha512-LtMnwKWi58ZqHbXBcsTF/VxDYhI6RrBIrDQw8fbDVlO8p5tJBZa7TaIaVYLY937vKO2WCEBmOKksGlpm5ccEIg==",
+ "license": "MIT",
+ "dependencies": {
+ "qrcode-generator": "^1.4.4"
+ }
+ },
+ "node_modules/qrcode/node_modules/cliui": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^6.2.0"
+ }
+ },
+ "node_modules/qrcode/node_modules/find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dependencies": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/qrcode/node_modules/locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dependencies": {
+ "p-locate": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/qrcode/node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/qrcode/node_modules/p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dependencies": {
+ "p-limit": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/qrcode/node_modules/wrap-ansi": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/qrcode/node_modules/y18n": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz",
+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="
+ },
+ "node_modules/qrcode/node_modules/yargs": {
+ "version": "15.4.1",
+ "resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz",
+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
+ "dependencies": {
+ "cliui": "^6.0.0",
+ "decamelize": "^1.2.0",
+ "find-up": "^4.1.0",
+ "get-caller-file": "^2.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^4.2.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^18.1.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/qrcode/node_modules/yargs-parser": {
+ "version": "18.1.3",
+ "resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz",
+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
+ "dependencies": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmmirror.com/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -5817,12 +6030,16 @@
"version": "2.1.1",
"resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
+ "node_modules/require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
+ },
"node_modules/resolve": {
"version": "1.22.8",
"resolved": "https://registry.npmmirror.com/resolve/-/resolve-1.22.8.tgz",
@@ -5994,6 +6211,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
+ },
"node_modules/setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmmirror.com/setimmediate/-/setimmediate-1.0.5.tgz",
@@ -6132,7 +6354,6 @@
"version": "4.2.3",
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
- "dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
@@ -6147,7 +6368,6 @@
"version": "6.0.1",
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
- "dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
@@ -6637,6 +6857,11 @@
"node": ">= 8"
}
},
+ "node_modules/which-module": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz",
+ "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ=="
+ },
"node_modules/word-wrap": {
"version": "1.2.5",
"resolved": "https://registry.npmmirror.com/word-wrap/-/word-wrap-1.2.5.tgz",
diff --git a/front/package.json b/front/package.json
index 3bb0017..750160f 100644
--- a/front/package.json
+++ b/front/package.json
@@ -25,7 +25,8 @@
"element-plus": "^2.7.1",
"lodash": "^4.17.21",
"pinia": "^2.1.7",
- "pinia-plugin-persist": "^1.0.0"
+ "pinia-plugin-persist": "^1.0.0",
+ "qrcode": "^1.5.3"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.2.0",
diff --git a/front/src/main/index.js b/front/src/main/index.js
index 399af90..1aac77a 100644
--- a/front/src/main/index.js
+++ b/front/src/main/index.js
@@ -1,4 +1,4 @@
-import { app, shell, BrowserWindow, nativeImage,ipcMain } from 'electron'
+import { app, shell, BrowserWindow, nativeImage, ipcMain } from 'electron'
import * as path from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import axios from 'axios'
@@ -56,8 +56,9 @@ app.whenReady().then(() => {
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
- ipcMain.on('sendMessage', (eve, msg) => {
- axios.post(`http://127.0.0.1:7001/api/upload`, msg)
+ ipcMain.on('sendMessage', async (eve, msg) => {
+ let res = await axios.post(`http://127.0.0.1:7001/api/upload`, msg)
+ mainWindow.webContents.send('reply', res.data)
})
})
diff --git a/front/src/renderer/src/App.vue b/front/src/renderer/src/App.vue
index 1d1a81a..0c76490 100644
--- a/front/src/renderer/src/App.vue
+++ b/front/src/renderer/src/App.vue
@@ -33,6 +33,7 @@