zs 2 éve
szülő
commit
d602bdd2fd
3 módosított fájl, 27 hozzáadás és 17 törlés
  1. 7 7
      src/views/order/index.vue
  2. 14 9
      src/views/password/index.vue
  3. 6 1
      src/views/shop/index.vue

+ 7 - 7
src/views/order/index.vue

@@ -16,7 +16,7 @@
 <script>
 import { order_type } from '@common/src/layout/site';
 import { mapState, createNamespacedHelpers } from 'vuex';
-// const { mapActions } = createNamespacedHelpers('program');
+const { mapActions } = createNamespacedHelpers('program');
 export default {
   name: 'index',
   props: {},
@@ -60,13 +60,13 @@ export default {
   },
   mounted() {},
   methods: {
-    // ...mapActions(['query', 'fetch', 'delete']),
+    ...mapActions(['query', 'fetch', 'delete']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
-      // let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
-      // if (this.$checkRes(res)) {
-      //   this.$set(this, `list`, res.data);
-      //   this.$set(this, `total`, res.total);
-      // }
+      let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      if (this.$checkRes(res)) {
+        // this.$set(this, `list`, res.data);
+        // this.$set(this, `total`, res.total);
+      }
     },
     btSearch(query) {
       this.$set(this, `searchInfo`, query);

+ 14 - 9
src/views/password/index.vue

@@ -10,7 +10,7 @@
 
 <script>
 import { mapState, createNamespacedHelpers } from 'vuex';
-// const { mapActions: user } = createNamespacedHelpers('user');
+const { mapActions } = createNamespacedHelpers('admin');
 export default {
   name: 'index',
   props: {},
@@ -40,23 +40,28 @@ export default {
       },
     };
   },
-  async created() {
-    await this.search();
+  created() {
+    this.search();
   },
   methods: {
-    // ...user({ usRp: 'rp' }),
-    //查询
-    async search() {},
+    ...mapActions(['fetch', 'resetPwd']),
+    async search() {
+      let res = await this.fetch(this.user._id);
+      if (this.$checkRes(res)) {
+        this.$set(this, `form`, res.data);
+      }
+    },
     // 保存
     async toSave({ data }) {
-      // let res = await this.uRp(data.password);
-      // this.$checkRes(res, '操作成功', res.errmsg);
+      let res = await this.resetPwd(data);
+      this.$checkRes(res, '操作成功', res.errmsg);
       this.logout();
     },
     // 退出登录
     logout() {
       localStorage.removeItem('token');
-      window.location.href = 'http://localhost:8005/login';
+      window.location.href = 'http://localhost:8001/login';
+      // window.location.href = `${process.env.VUE_APP_HOST}`;
     },
   },
   computed: {

+ 6 - 1
src/views/shop/index.vue

@@ -33,8 +33,13 @@ export default {
       ],
     };
   },
-  created() {},
+  created() {
+    this.search();
+  },
   methods: {
+    search() {
+      console.log('1');
+    },
     // 提交保存
     onSubmit() {},
   },