Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions FakeX/pages/detail/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@

onLoad(options) {
this.id = options.id
this.src = "http://127.0.0.1:35226/__tmp__/" + this.id + ".jpg"
this.src = "http://tmp/" + this.name
// this.src = uni.chooseImage({
// src = imgSrc
// })
console.log("id: "+ this.id)

// 从服务器获取指定 id 的图片
Expand All @@ -218,14 +221,28 @@
console.log(this.$store.state)
console.log(this.$store.state['sharedValue'])
console.log(this.$store.state.userID)
uni.request({

if (this.$store.state.userID !== undefined) {
userid = this.$store.state.userID;
}
else {
userid = 'test'
}

console.log(userid)

uni.request({
// 从服务器请求相应图片数据
url: 'http://122.9.8.215:5000/multitrace',
method:'GET',
data:
{
id: this.id,
// userid: this.$store.state.userID,
},
formData: {
user: userid,
},


// 请求成功
Expand All @@ -243,6 +260,7 @@
// real_possibility: 0-1
this.real_possibility = (dataObj.real_possibility)*100

this.name = dataObj.name

console.log(this.flag)
console.log(dataObj['flag'])
Expand Down
4 changes: 2 additions & 2 deletions FakeX/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<navigator url="" open-type="navigate" >单图检测</navigator>
</li>
<li @click="navigateFun(1)">
<image src="@/static/0351.png"></image>
<image src="@/static/0353.png"></image>
<navigator url="" open-type="navigate" >多图检测</navigator>
</li>
<li @click="navigateFun(2)">
<image src="@/static/0353.png"></image>
<image src="@/static/0351.png"></image>
<navigator url="" open-type="navigate" >视频检测</navigator>
</li>
</ul>
Expand Down
17 changes: 14 additions & 3 deletions FakeX/pages/upload/uploadImage/uploadImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@

<!--标题结果-->
<u-row customStyle="margin-bottom: 10px; margin-top: 10px">
<text style="font-size:30px; font-weight: bold; line-height:50rpx;" >
{{ fileList2[0].flag === 1 ? '危险' : '安全' }}
</text>
<u--text size = "30" bold = "true" :text = "flag_text">
</u--text>
</u-row>

<text>
Expand Down Expand Up @@ -204,6 +203,8 @@
return {
rate: 80.57,

flag_text : "Real",

// 提交图片列表,通过 this 指针访问
fileList1: [],

Expand Down Expand Up @@ -361,6 +362,7 @@

uploadFilePromise(cur_obj) {
let url = cur_obj.url;
console.log("url", url);
// console.log(url);
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
Expand Down Expand Up @@ -391,6 +393,15 @@
// real_possibility: 0-1
cur_obj['real_possibility'] = dataObj.real_possibility

if(cur_obj['flag'] == 1) {
this.flag_text = "Real"
} else {
this.flag_text = "AIGC"
}

console.log("flag", cur_obj['flag'])
console.log("flag type", typeof cur_obj['flag'])

},

// 上传失败
Expand Down
12 changes: 9 additions & 3 deletions FakeX/pages/upload/uploadMultiImage/uploadMultiImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<u-cell
:title="`${item['flag_text']}`"
value="详细报告"
:label="`真实率:${item['real_possibility']}`"
:label="`真实率:${item['real_possibility']}%`"
:isLink="true"
@click="onTapCell(item['hash'])"
>
Expand Down Expand Up @@ -292,15 +292,21 @@
// 将 res.data 中的信息保存到 fileList 中
const dataObj = JSON.parse(res.data);

const index = dataObj.result.findIndex(item => /id/i.test(item.name));

console.log(dataObj)
console.log(dataObj['result'][0]['flag'])
console.log(dataObj['result'][0]['real_possibility'])
// flag = 0/1
cur_obj['flag'] = dataObj['result'][0]['flag']
cur_obj['flag'] = dataObj['result'][index]['flag']
// // merged_minor: 详细分类 + 百分比
// cur_obj['merged_minor'] = dataObj.merged_minor
// real_possibility: 0-1
cur_obj['real_possibility'] = dataObj['result'][0].real_possibility
// 获取原始数据
const realPossibility = (dataObj['result'][index].real_possibility)*100;

// 保留前4位有效数字并赋值给 cur_obj
cur_obj['real_possibility'] = parseFloat(realPossibility.toFixed(4));

},

Expand Down
Binary file modified FakeX/static/guidance1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified FakeX/static/support.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading