瀏覽代碼

登录加上【标准】登录类型

yuhan 7 月之前
父節點
當前提交
806bcd0bbe
共有 3 個文件被更改,包括 9 次插入9 次删除
  1. 2 2
      src/permission.js
  2. 2 2
      src/store/modules/user.js
  3. 5 5
      src/views/user/Login.vue

+ 2 - 2
src/permission.js

@@ -33,7 +33,7 @@ router.beforeEach((to, from, next) => {
   // param.token = cookie.get('EIToken')
   // param.username = cookie.get('WISEUser')
   var loginType = cookie.get('EIName')
-  if(loginType === 'SSO'){
+  if(loginType === 'sso'){
     store.dispatch('TzLogin').then(response => {
       // 有EIToken
       // console.log('pppppppppresult', response)
@@ -98,7 +98,7 @@ router.beforeEach((to, from, next) => {
       }
     })
   }
-  if(loginType === 'SYSTEM' || !loginType){
+  if(loginType === 'system' || !loginType){
     if (Vue.ls.get(ACCESS_TOKEN)) {
       /* has token */
       if (to.path === '/user/login' || to.path === OAUTH2_LOGIN_PAGE_PATH) {

+ 2 - 2
src/store/modules/user.js

@@ -92,7 +92,7 @@ const user = {
             commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname, welcome: welcome() })
             commit('SET_AVATAR', userInfo.avatar)
 
-            cookie.set('EIName', 'SYSTEM')
+            cookie.set('EIName', 'system')
 
             resolve(response)
           }else{
@@ -245,7 +245,7 @@ const user = {
             commit('SET_NAME', { username: userInfo.username,realname: userInfo.realname, welcome: welcome() })
             commit('SET_AVATAR', userInfo.avatar)
 
-            cookie.set('EIName', 'SSO')
+            cookie.set('EIName', 'sso')
 
             resolve(response)
           }else{

+ 5 - 5
src/views/user/Login.vue

@@ -4,10 +4,10 @@
     <div class="sign-text">登录到 联锁管理平台</div>
     <a-form-model class="user-layout-login" @keyup.enter.native="handleSubmit">
       <a-tabs :activeKey="customActiveKey" :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"  @change="handleTabClick" class="u-login-tabs">
-        <a-tab-pane key="SSO" tab="SSO">
+        <a-tab-pane key="sso" tab="SSO">
           <login-sso ref="ssologin" @validateFail="validateFail" @success="requestSuccess" @fail="requestFailed"></login-sso>
         </a-tab-pane>
-        <a-tab-pane key="SYSTEM" tab="标准">
+        <a-tab-pane key="system" tab="标准">
           <login-account ref="alogin" @validateFail="validateFail" @success="requestSuccess" @fail="requestFailed"></login-account>
         </a-tab-pane>
 
@@ -66,7 +66,7 @@ export default {
     },
     data () {
       return {
-        customActiveKey: 'SSO',
+        customActiveKey: 'sso',
         rememberMe: true,
         loginBtn: false,
         requiredTwoStepCaptcha: false,
@@ -102,7 +102,7 @@ export default {
       //登录
       handleSubmit () {
         this.loginBtn = true;
-        if (this.customActiveKey === 'SSO') {
+        if (this.customActiveKey === 'sso') {
           //SSO单点登录
           this.$refs.ssologin.handleLogin(this.rememberMe)
         } else {
@@ -127,7 +127,7 @@ export default {
           duration: 4,
         });
         //账户密码登录错误后更新验证码
-        // if(this.customActiveKey === 'SSO' && description.indexOf('密码错误')>0){
+        // if(this.customActiveKey === 'sso' && description.indexOf('密码错误')>0){
         //   this.$refs.alogin.handleChangeCheckCode()
         // }
         this.loginBtn = false;