From 621ce56da2be6f4589e0f84110ab5fc27295a83d Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Wed, 29 Aug 2018 09:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20vuex=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=B9=B6=E4=B8=94=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 852291ea8b976be25e156f53ce0b81faef742913 [formerly 852291ea8b976be25e156f53ce0b81faef742913 [formerly 852291ea8b976be25e156f53ce0b81faef742913 [formerly 852291ea8b976be25e156f53ce0b81faef742913 [formerly e6a9f047da58f161e6bccd8838524b7245a0e76b [formerly 9307a072e2187be9106f82f8d3340c7e6f927910]]]]] Former-commit-id: 352a2e620fc06b1beb9bbdcfefacb1a7e37ae55f Former-commit-id: 7d55b4293f852eeb95c236ceb5d934d71afe0627 Former-commit-id: 2532af0dc63f6f5cd84ce055bbb1fb286d36216f [formerly 104ffc097898b5825fa71dd6242d6d1733971d1f] Former-commit-id: f342740b49ba9a6c1aaf1b4cbcc6e22203d671b3 Former-commit-id: be20972bb932dc5e2ff35c617c7a55ce570e31b9 Former-commit-id: e3e8d3adbe3d832c212d56095ccce7efcce8a519 Former-commit-id: f57d76130736d2ba8a7c099602c92ff9817b8702 Former-commit-id: f29cdf9cbc9f6523cea164ebc13c01c80d493043 --- docs/zh/sys-vuex/README.md.REMOVED.git-id | 2 +- src/store/modules/d2admin/modules/account.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/zh/sys-vuex/README.md.REMOVED.git-id b/docs/zh/sys-vuex/README.md.REMOVED.git-id index a901b125..209db591 100644 --- a/docs/zh/sys-vuex/README.md.REMOVED.git-id +++ b/docs/zh/sys-vuex/README.md.REMOVED.git-id @@ -1 +1 @@ -33948f39bdcc1391fd42429bd95b3b98c167fb23 \ No newline at end of file +bbc8c6b753f56e87bba30fa4d54dfce9db8fdbc3 \ No newline at end of file diff --git a/src/store/modules/d2admin/modules/account.js b/src/store/modules/d2admin/modules/account.js index aafbf581..84fcf6b0 100644 --- a/src/store/modules/d2admin/modules/account.js +++ b/src/store/modules/d2admin/modules/account.js @@ -10,8 +10,18 @@ export default { * @param {Object} param vm {Object} vue 实例 * @param {Object} param username {String} 用户账号 * @param {Object} param password {String} 密码 + * @param {Object} param route {Object} 登陆成功后定向的路由对象 */ - login ({ commit }, { vm, username, password }) { + login ({ + commit + }, { + vm, + username, + password, + route = { + name: 'index' + } + }) { // 开始请求登录接口 AccountLogin({ username, @@ -32,9 +42,7 @@ export default { // 用户登陆后从持久化数据加载一系列的设置 commit('load') // 跳转路由 - vm.$router.push({ - name: 'index' - }) + vm.$router.push(route) }) .catch(err => { console.group('登陆结果')