Jelajahi Sumber

修改重置密码

YY 2 tahun lalu
induk
melakukan
f4dc56b9e7

+ 0 - 2
src/store/index.js

@@ -22,7 +22,6 @@ import config from './module/system/config';
 import platformAct from './module/system/platformAct';
 import goodsJoinAct from './module/system/goodsJoinAct';
 import admins from './module/system/admin';
-import emailResetPwd from './module/system/emailResetPwd';
 
 import shop from './module/shop/shop';
 import selfShop from './module/shop/selfShop';
@@ -72,6 +71,5 @@ export default new Vuex.Store({
     getBill,
     outBill,
     admins,
-    emailResetPwd,
   },
 });

+ 4 - 0
src/store/module/system/admin.js

@@ -22,6 +22,10 @@ const actions = {
     const res = await this.$axios.$post(`${api.url}`, payload);
     return res;
   },
+  async email({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.url}/emailResetPwd`, payload);
+    return res;
+  },
   async fetch({ commit }, payload) {
     const res = await this.$axios.$get(`${api.url}/${payload}`);
     return res;

+ 0 - 44
src/store/module/system/emailResetPwd.js

@@ -1,44 +0,0 @@
-import Vue from 'vue';
-import Vuex from 'vuex';
-const _ = require('lodash');
-Vue.use(Vuex);
-const api = {
-  url: '/point/v1/api/admin/emailResetPwd',
-};
-
-const state = () => ({});
-const mutations = {};
-
-const actions = {
-  async query({ commit }, { skip = 0, limit, ...info } = {}) {
-    const res = await this.$axios.$get(`${api.url}`, {
-      skip,
-      limit,
-      ...info,
-    });
-    return res;
-  },
-  async create({ commit }, payload) {
-    const res = await this.$axios.$post(`${api.url}`, payload);
-    return res;
-  },
-  async fetch({ commit }, payload) {
-    const res = await this.$axios.$get(`${api.url}/${payload}`);
-    return res;
-  },
-  async update({ commit }, payload) {
-    const id = _.get(payload, 'id', _.get(payload, '_id'));
-    const res = await this.$axios.$post(`${api.url}/${id}`, payload);
-    return res;
-  },
-  async delete({ commit }, payload) {
-    const res = await this.$axios.$delete(`${api.url}/${payload}`);
-    return res;
-  },
-};
-export default {
-  namespaced: true,
-  state,
-  mutations,
-  actions,
-};

+ 3 - 3
src/views/login.vue

@@ -45,7 +45,7 @@
 const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: maU } = createNamespacedHelpers('admin');
-const { mapActions: emailResetPwd } = createNamespacedHelpers('emailResetPwd');
+const { mapActions: admins } = createNamespacedHelpers('admins');
 
 export default {
   name: 'login',
@@ -66,7 +66,7 @@ export default {
   created() {},
   methods: {
     ...maU(['login']),
-    ...emailResetPwd({ pwdCreate: 'create' }),
+    ...admins(['query', 'delete', 'fetch', 'update', 'create', 'email']),
     onSubmit(formName) {
       this.$refs[formName].validate(async (valid) => {
         if (valid) {
@@ -95,7 +95,7 @@ export default {
           cancelButtonText: '取消',
           type: 'warning',
         }).then(async () => {
-          const res = await this.pwdCreate({ account: this.form.account });
+          const res = await this.email({ account: this.form.account });
           if (this.$checkRes(res)) {
             this.$message({ type: `success`, message: `重置密码成功` });
           }

+ 2 - 2
src/views/platmanag/storeAcc/detail.vue

@@ -89,7 +89,7 @@ export default {
     ...methodsUtil,
     ...role({ roleQuery: 'query' }),
     ...emailResetPwd({ pwdCreate: 'create' }),
-    ...admins(['query', 'delete', 'fetch', 'update', 'create']),
+    ...admins(['query', 'delete', 'fetch', 'update', 'create', 'email']),
     // 重置
     async search({ skip = 0, limit = this.limit, ...others } = {}) {
       others.shop = this.id;
@@ -124,7 +124,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning',
       }).then(async () => {
-        const res = await this.pwdCreate({ account: data.account });
+        const res = await this.email({ account: data.account });
         if (this.$checkRes(res)) {
           this.$message({ type: `success`, message: `重置密码成功` });
           this.search();