guhongwei 4 år sedan
förälder
incheckning
d762ff3a9d
2 ändrade filer med 8 tillägg och 1 borttagningar
  1. 3 1
      src/views/followbind.vue
  2. 5 0
      src/views/userCenter/user/index.vue

+ 3 - 1
src/views/followbind.vue

@@ -20,6 +20,7 @@
 import NavBar from '@/layout/common/topInfo.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: authUser } = createNamespacedHelpers('authUser');
+const { mapActions: mapMarket } = createNamespacedHelpers('market');
 export default {
   name: 'followbind',
   props: {},
@@ -48,9 +49,10 @@ export default {
   },
   methods: {
     ...authUser(['create']),
+    ...mapMarket({ userFetch: 'fetch', userCreate: 'create', userUpdate: 'update' }),
     async bindBtn() {
       let obj = { ...JSON.parse(JSON.stringify(this.info)), role: '4', openid: this.openid };
-      let res = await this.create(obj);
+      let res = await this.userCreate(obj);
       if (res.errcode == '0') {
         this.$message.success('注册成功');
         WeixinJSBridge.call('closeWindow');

+ 5 - 0
src/views/userCenter/user/index.vue

@@ -48,6 +48,11 @@ export default {
     async searchInfo() {
       if (this.user.role == '4' || this.user.role == '5' || this.user.role == '7') {
         let res = await this.fetch(this.user.userid);
+        if (this.user.userid) {
+          let res = await this.fetch(this.user.userid);
+        } else {
+          let res = await this.fetch(this.user.uid);
+        }
         if (res.errcode === 0) {
           this.$set(this, `form`, res.data);
         }