panhui пре 3 година
родитељ
комит
3777582f27
1 измењених фајлова са 12 додато и 2 уклоњено
  1. 12 2
      src/components/BindAccound.vue

+ 12 - 2
src/components/BindAccound.vue

@@ -101,8 +101,18 @@ export default {
             this.$http.post('/bindGame/bind', form).then(res => {
                 if (!this.checkRoleId) {
                     this.$toast.clear();
-                    this.showRoles = true;
-                    this.roleItems = res.roleItems;
+                    // res.roleItems=res.roleItems.filter(item=>{
+                    //     return
+                    // })
+                    if (res.roleItems.length === 0) {
+                        this.$dialog.alert({
+                            title: '角色列表为空',
+                            message: '当前没有可选择的角色,请赶快打开王者创建吧'
+                        });
+                    } else {
+                        this.showRoles = true;
+                        this.roleItems = res.roleItems;
+                    }
                 } else {
                     this.$toast.success('绑定成功');
                     this.$emit('update');