guhongwei 3 年 前
コミット
7b3a6343ac
1 ファイル変更26 行追加0 行削除
  1. 26 0
      src/store/organization.js

+ 26 - 0
src/store/organization.js

@@ -48,6 +48,32 @@ const actions = {
     }
     return res;
   },
+  // 关联用户
+  async getList({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.organizationInfo}/getList`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async bind({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.organizationInfo}/bind`, payload);
+    return res;
+  },
+  async bindRemove({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.organizationInfo}/bindRemove`, payload);
+    return res;
+  },
+  async wxLogin({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.organizationInfo}/wxLogin`, payload);
+    if (res.errcode === 0) {
+      localStorage.setItem('token', res.data);
+      let user = jwt.decode(res.data);
+      commit('setUser', user, { root: true });
+    }
+    return res;
+  },
 };
 export default {
   namespaced: true,