Browse Source

fix 创建优惠券+注册用户身份

ChengYuXuan 5 years ago
parent
commit
4ce6cc3153
2 changed files with 4 additions and 3 deletions
  1. 1 1
      src/views/Register.vue
  2. 3 2
      src/views/admin/CouponCreate.vue

+ 1 - 1
src/views/Register.vue

@@ -66,7 +66,7 @@ export default {
       showSuccessDialog: false,
       showFailDialog: false,
       msg: "",
-      roles: ["teacher", "student"],
+      roles: ["teacher", "student","admin"],
     };
   },
   methods: {

+ 3 - 2
src/views/admin/CouponCreate.vue

@@ -137,8 +137,8 @@ export default {
     submit() {
       const payload = {
         ...this.couponInfo,
-        type: this.typeList[this.typeList_.indexOf(this.couponInfo.deliver)],
-        scope: this.scopeList[this.scopeList_.indexOf(this.couponInfo.scope)],
+        type: this.typeList_[this.typeList.indexOf(this.couponInfo.type)],
+        scope: this.scopeList_[this.scopeList.indexOf(this.couponInfo.scope)],
         metadata: JSON.stringify(this.meta),
       };
       console.log(payload);
@@ -148,6 +148,7 @@ export default {
           this.showSuccessDialog = true;
           setTimeout(() => {
             this.showSuccessDialog = false;
+            this.$router.go(-1)
           }, 1000);
         } else {
           this.showFailDialog = true;