会员
This commit is contained in:
@@ -35,4 +35,20 @@ export function delUser(id) {
|
||||
url: '/back/user/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户标签
|
||||
export function getUserTags(userId) {
|
||||
return request({
|
||||
url: '/back/user/tags/' + userId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取当前登录用户的标签
|
||||
export function getMyTags() {
|
||||
return request({
|
||||
url: '/back/user/myTags',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, updateUserStatus } from "@/api/user/user";
|
||||
import { listUser, updateUserStatus, getUserTags } from "@/api/user/user";
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
@@ -119,6 +119,20 @@ export default {
|
||||
listUser(this.queryParams).then(response => {
|
||||
this.userList = response.rows;
|
||||
this.total = response.total;
|
||||
|
||||
// 获取每个用户的播放标签
|
||||
this.userList.forEach(user => {
|
||||
getUserTags(user.userId).then(tagResponse => {
|
||||
if (tagResponse.code === 200 && tagResponse.data) {
|
||||
this.$set(user, 'playTag', tagResponse.data);
|
||||
} else {
|
||||
this.$set(user, 'playTag', '暂无标签');
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$set(user, 'playTag', '获取失败');
|
||||
});
|
||||
});
|
||||
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user