|
|
@@ -85,8 +85,8 @@ const userInfoModulesPinia = userInfoModules(); |
|
|
|
|
|
|
|
//#region 选择图片
|
|
|
|
const uploadState = ref(1); //上传状态
|
|
|
|
const showImgUrl = ref(null); //回显路径
|
|
|
|
const showImgUrl2 = ref(null); //回显路径
|
|
|
|
const showImgUrl = ref(null); //回显路径 压缩
|
|
|
|
const showImgUrl2 = ref(null); //回显路径 未压缩
|
|
|
|
const showImgData = ref(null); //上传数据
|
|
|
|
function chooseImage() {
|
|
|
|
// 调用uni.chooseImage方法选择图片
|
|
|
@@ -100,7 +100,7 @@ function chooseImage() { |
|
|
|
if (userInfoModulesPinia.platForm != 1) {
|
|
|
|
uni.compressImage({
|
|
|
|
src: res.tempFilePaths[0],
|
|
|
|
quality: 80,
|
|
|
|
quality: 40,
|
|
|
|
success: (res2) => {
|
|
|
|
showImgUrl.value = res2.tempFilePath;
|
|
|
|
},
|
|
|
@@ -140,10 +140,12 @@ async function toCloseStyle() { |
|
|
|
}
|
|
|
|
uploadState.value = 3;
|
|
|
|
|
|
|
|
console.log(showImgUrl.value);
|
|
|
|
console.log(showImgUrl2.value.path);
|
|
|
|
// 人脸识别接口
|
|
|
|
uni.uploadFile({
|
|
|
|
url: "https://test.metavatar.cc/C/api/userDigital/checkPhoto", //上传图片api
|
|
|
|
filePath: showImgUrl.value,
|
|
|
|
filePath: showImgUrl2.value.path,
|
|
|
|
name: "file",
|
|
|
|
formData: {
|
|
|
|
user: "test",
|
|
|
@@ -161,7 +163,7 @@ async function toCloseStyle() { |
|
|
|
// 上传接口
|
|
|
|
uni.uploadFile({
|
|
|
|
url: "https://test.metavatar.cc/C/api/upload/awsImgUpload", //上传图片api
|
|
|
|
filePath: showImgUrl.value,
|
|
|
|
filePath: showImgUrl2.value.path,
|
|
|
|
name: "file",
|
|
|
|
formData: {
|
|
|
|
user: "test",
|
|
|
@@ -202,7 +204,11 @@ async function toCloseStyle() { |
|
|
|
});
|
|
|
|
},
|
|
|
|
fail: () => {
|
|
|
|
uploadState.value = 4;
|
|
|
|
uploadState.value = 1;
|
|
|
|
uni.showToast({
|
|
|
|
title: "网络被数字人偷走了, 请稍后重试",
|
|
|
|
icon: "none",
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|