Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Commit 32627d8

Browse files
feat: support no uid
1 parent 51c803c commit 32627d8

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/components/Awsl.vue

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<template>
22
<el-container>
33
<el-header>
4-
<el-select v-model="uid" @change="chaneUid()" placeholder="请选择来源">
4+
<el-select
5+
v-model="uid"
6+
@change="chaneUid()"
7+
placeholder="请选择来源"
8+
clearable
9+
>
510
<el-option
611
:key="producer.uid"
712
v-for="producer in producers"
@@ -96,9 +101,11 @@ export default {
96101
},
97102
methods: {
98103
async fetchData(limit, offset) {
99-
let res = await axios.get(
100-
"/list?limit=" + limit + "&offset=" + offset + "&uid=" + this.uid
101-
);
104+
let url = "/list?limit=" + limit + "&offset=" + offset;
105+
if (this.uid) {
106+
url = url + "&uid=" + this.uid;
107+
}
108+
let res = await axios.get(url);
102109
let pic_infos = res.data.map((item) => {
103110
let pic_info = item.pic_info;
104111
return {
@@ -120,13 +127,17 @@ export default {
120127
type: "error",
121128
});
122129
}
123-
this.uid = this.producers[0].uid;
124-
let res = await axios.get("/list_count?uid=" + this.uid);
130+
this.uid = "";
131+
let res = await axios.get("/list_count");
125132
this.total = res.data;
126133
this.fetchData(40, 0);
127134
},
128135
async chaneUid() {
129-
let res = await axios.get("/list_count?uid=" + this.uid);
136+
let url = "/list_count";
137+
if (this.uid) {
138+
url = url + "?uid=" + this.uid;
139+
}
140+
let res = await axios.get(url);
130141
this.total = res.data;
131142
this.pic_infos = [];
132143
this.fetchData(40, 0);

0 commit comments

Comments
 (0)