Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PanJiaChen/vue-element-admin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: phoenix110/vue-element-admin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 20, 2018

  1. 修改判断token是否存在的写法。

    当dashboard页面也是有权限存在的时候,当点击画面退出按钮后,会导致store.dispatch('GetInfo')再次调用。原因就是严格模式下,if(getToken())不能判断token不存在的情况。需要使用if (typeof (token) === 'undefined')来进行判断。
    phoenix110 authored Mar 20, 2018
    Configuration menu
    Copy the full SHA
    18697f6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bb9bff0 View commit details
    Browse the repository at this point in the history
  3. 修改判断token是否存在的写法

    [缺陷描述]:
    store.dispatch('GetInfo')重复调用。
    [重现步骤]:
    1.设定dashboard页面也是需要权限才能访问。
    2.进入login页面,正常登录系统。
    3.点击右上角按钮,正常登出系统。
    [期望结果]:
    直接跳转到登录页面。
    [实际结果]:
    store.dispatch('GetInfo')被调用,没有直接跳转到登录页面。
    [原因定位]:
    严格模式下,if(getToken())不能判断token不存在的情况。需要使用if (typeof (token) === 'undefined')来进行判断。
    [修复建议]: 
    if(getToken())
    修改为
    const token = getToken()
    if (typeof (token) !== 'undefined') {
    phoenix110 authored Mar 20, 2018
    Configuration menu
    Copy the full SHA
    7a83041 View commit details
    Browse the repository at this point in the history
Loading