Skip to content

Commit

Permalink
Merge pull request #65 from Kabuda-czh/fix-guildmanage-undefined
Browse files Browse the repository at this point in the history
🐞 fix: error res value
  • Loading branch information
Kabuda-czh authored Jul 13, 2023
2 parents e596d97 + 478e6af commit bbdaae3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugins/kbot/client/components/GroupAddValid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: Kabuda-czh
* @Date: 2023-07-04 10:31:52
* @LastEditors: Kabuda-czh
* @LastEditTime: 2023-07-04 13:04:17
* @LastEditTime: 2023-07-13 13:08:04
* @FilePath: \KBot-App\plugins\kbot\client\components\GroupAddValid.vue
* @Description:
*
Expand Down Expand Up @@ -146,7 +146,7 @@ async function getGroupAddValid() {
dialogLoading.value = true
await fetchGetAddValid(props.groupId).then((res: IValidRes) => {
const list: IValidList[] = []
for (const key in res.validObject) {
for (const key in res?.validObject || {}) {
list.push({
question: key,
answer: res.validObject[key],
Expand Down
10 changes: 5 additions & 5 deletions plugins/kbot/client/components/GroupViolation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: Kabuda-czh
* @Date: 2023-07-04 10:31:36
* @LastEditors: Kabuda-czh
* @LastEditTime: 2023-07-04 13:06:03
* @LastEditTime: 2023-07-13 13:05:25
* @FilePath: \KBot-App\plugins\kbot\client\components\GroupViolation.vue
* @Description:
*
Expand Down Expand Up @@ -161,17 +161,17 @@ const columns = reactive<Column<any>[]>([
async function getViolationList() {
dialogLoading.value = true
await fetchGetViolationList(props.groupId).then((res: IViolationRes) => {
const violations = res.violations.map((item) => {
const violations = res?.violations?.map((item) => {
return {
label: item,
value: item,
}
})
}) || []
defaultViolationList.value = violations
violationList.value = violations.slice(0)

violationCount.value = res.count || 3
violationHandleWay.value = res.handleWay || 'mute'
violationCount.value = res?.count || 3
violationHandleWay.value = res?.handleWay || 'mute'
})
dialogLoading.value = false
}
Expand Down

0 comments on commit bbdaae3

Please sign in to comment.