cyy 1 год назад
Родитель
Сommit
608399f2cd
5 измененных файлов с 453 добавлено и 251 удалено
  1. 67 67
      src/router/index.js
  2. 7 1
      src/router/routes.js
  3. 23 22
      src/setting.js
  4. 152 0
      src/views/platform/bpmn/siginin/outIndex.vue
  5. 204 161
      src/views/system/login/index.vue

+ 67 - 67
src/router/index.js

@@ -1,160 +1,160 @@
-import Vue from "vue";
-import VueRouter from "vue-router";
+import Vue from 'vue'
+import VueRouter from 'vue-router'
 
 
 // 进度条
 // 进度条
-import NProgress from "nprogress";
-import "nprogress/nprogress.css";
+import NProgress from 'nprogress'
+import 'nprogress/nprogress.css'
 
 
-import store from "@/store/index";
-import util from "@/utils/util.js";
-import i18n from "@/utils/i18n"; // Internationalization 国际化
-import { getQueryString, validataWechat } from "@/utils/url"; // 验权
+import store from '@/store/index'
+import util from '@/utils/util.js'
+import i18n from '@/utils/i18n' // Internationalization 国际化
+import { getQueryString, validataWechat } from '@/utils/url' // 验权
 // 验权
 // 验权
-import { getToken, getRefreshToken } from "@/utils/auth";
-import setting from "@/setting.js";
-import { IS_WECHAT_LOGIN } from "@/constant";
+import { getToken, getRefreshToken } from '@/utils/auth'
+import setting from '@/setting.js'
+import { IS_WECHAT_LOGIN } from '@/constant'
 // 路由数据
 // 路由数据
-import routes from "./routes";
+import routes from './routes'
 
 
 // fix vue-router NavigationDuplicated
 // fix vue-router NavigationDuplicated
-const VueRouterPush = VueRouter.prototype.push;
+const VueRouterPush = VueRouter.prototype.push
 VueRouter.prototype.push = function push(location) {
 VueRouter.prototype.push = function push(location) {
-  return VueRouterPush.call(this, location).catch(err => err);
-};
-const VueRouterReplace = VueRouter.prototype.replace;
+  return VueRouterPush.call(this, location).catch(err => err)
+}
+const VueRouterReplace = VueRouter.prototype.replace
 VueRouter.prototype.replace = function replace(location) {
 VueRouter.prototype.replace = function replace(location) {
-  return VueRouterReplace.call(this, location).catch(err => err);
-};
+  return VueRouterReplace.call(this, location).catch(err => err)
+}
 
 
-Vue.use(VueRouter);
+Vue.use(VueRouter)
 
 
 // 导出路由 在 main.js 里使用
 // 导出路由 在 main.js 里使用
 const router = new VueRouter({
 const router = new VueRouter({
   routes
   routes
-});
+})
 
 
 // 不重定向白名单
 // 不重定向白名单
-const whiteList = ["/login", "/register", "/forget", "/authredirect"];
+const whiteList = ['/login', '/register', '/forget', '/authredirect']
 /**
 /**
  * 路由拦截
  * 路由拦截
  * 权限验证
  * 权限验证
  */
  */
-router.beforeEach(async (to, from, next) => {
+router.beforeEach(async(to, from, next) => {
   // 进度条
   // 进度条
-  NProgress.start();
+  NProgress.start()
   // 这里将cookie里是否存有token作为验证是否登录的条件
   // 这里将cookie里是否存有token作为验证是否登录的条件
-  const hasToken = getToken();
-  if (hasToken && hasToken !== "undefined") {
+  const hasToken = getToken()
+  if (hasToken && hasToken !== 'undefined') {
     // 从cookie 获取用户token
     // 从cookie 获取用户token
     // 登录 锁定 401没权限  403禁止访问
     // 登录 锁定 401没权限  403禁止访问
     if (
     if (
-      to.name === "locking" ||
-      to.name === "login" ||
-      to.name === "error401" ||
-      to.name === "error403" ||
-      to.name === "nomenu"
+      to.name === 'locking' ||
+      to.name === 'login' ||
+      to.name === 'error401' ||
+      to.name === 'error403' ||
+      to.name === 'nomenu'
     ) {
     ) {
-      next();
+      next()
     } else {
     } else {
       // 判断是否有帐号信息
       // 判断是否有帐号信息
       if (util.isEmpty(store.getters.userInfo)) {
       if (util.isEmpty(store.getters.userInfo)) {
         store
         store
-          .dispatch("ibps/user/load")
+          .dispatch('ibps/user/load')
           .then(res => {
           .then(res => {
             // 拉取用户信息,避免刷新用户丢失
             // 拉取用户信息,避免刷新用户丢失
-            next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
+            next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
           })
           })
           .catch(e => {
           .catch(e => {
-            NProgress.done(); // 结束Progress
+            NProgress.done() // 结束Progress
             // 前台登出
             // 前台登出
             store
             store
-              .dispatch("ibps/account/fedLogout")
+              .dispatch('ibps/account/fedLogout')
               .then(() => {
               .then(() => {
-                next({ name: "login" });
+                next({ name: 'login' })
               })
               })
               .catch(err => {
               .catch(err => {
-                console.error(err);
-              });
-          });
+                console.error(err)
+              })
+          })
       } else {
       } else {
         // 动态改变权限,判断是否有菜单权限,或者刷新页面
         // 动态改变权限,判断是否有菜单权限,或者刷新页面
         if (to.matched.length === 0) {
         if (to.matched.length === 0) {
           // 不能匹配的路由
           // 不能匹配的路由
           return next({
           return next({
-            path: "401",
+            path: '401',
             replace: true,
             replace: true,
             query: { noGoBack: true }
             query: { noGoBack: true }
-          });
+          })
         } else {
         } else {
-          next();
+          next()
         }
         }
       }
       }
       // end
       // end
     }
     }
   } else {
   } else {
-    const isWechat = validataWechat();
+    const isWechat = validataWechat()
     if (isWechat && IS_WECHAT_LOGIN && !from.name) {
     if (isWechat && IS_WECHAT_LOGIN && !from.name) {
       // 微信登陆
       // 微信登陆
-      const redirect = getQueryString("redirect");
-      const code = getQueryString("code");
+      const redirect = getQueryString('redirect')
+      const code = getQueryString('code')
       store
       store
-        .dispatch("ibps/account/loginByWechat", {
+        .dispatch('ibps/account/loginByWechat', {
           form: { code: code }
           form: { code: code }
         })
         })
         .then(() => {
         .then(() => {
-          if (redirect && redirect !== "login") {
-            next({ path: redirect });
+          if (redirect && redirect !== 'login') {
+            next({ path: redirect })
           } else {
           } else {
-            next();
+            next()
           }
           }
         })
         })
         .catch(e => {
         .catch(e => {
-          NProgress.done(); // 结束Progress
+          NProgress.done() // 结束Progress
           if (whiteList.indexOf(to.path) !== -1) {
           if (whiteList.indexOf(to.path) !== -1) {
             // 在免登录白名单,直接进入
             // 在免登录白名单,直接进入
-            next();
+            next()
           } else {
           } else {
-            next(`/login?redirect=${to.path}`); // 否则全部重定向到登录页
+            next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
           }
           }
-        });
+        })
     } else {
     } else {
       // 判断refresh tonken是否过期
       // 判断refresh tonken是否过期
-      const refreshToken = getRefreshToken();
+      const refreshToken = getRefreshToken()
       if (util.isNotEmpty(refreshToken)) {
       if (util.isNotEmpty(refreshToken)) {
         // 刷新tonken
         // 刷新tonken
         await store
         await store
-          .dispatch("ibps/account/refreshToken")
+          .dispatch('ibps/account/refreshToken')
           .then(() => {
           .then(() => {
-            next();
+            next()
           })
           })
           .catch(err => {
           .catch(err => {
-            console.error(err);
-          });
+            console.error(err)
+          })
       } else {
       } else {
         // 在免登录白名单,直接进入
         // 在免登录白名单,直接进入
         if (setting.whiteRouterList.indexOf(to.path) !== -1) {
         if (setting.whiteRouterList.indexOf(to.path) !== -1) {
-          next();
+          next()
         } else {
         } else {
           // 没有登录的时候跳转到登录界面
           // 没有登录的时候跳转到登录界面
           // 携带上登陆成功之后需要跳转的页面完整路径
           // 携带上登陆成功之后需要跳转的页面完整路径
           next({
           next({
-            name: "login",
+            name: 'login',
             query: {
             query: {
               redirect: to.fullPath
               redirect: to.fullPath
             }
             }
-          });
-          NProgress.done();
+          })
+          NProgress.done()
         }
         }
       }
       }
     }
     }
   }
   }
-});
+})
 
 
 router.afterEach(to => {
 router.afterEach(to => {
   // 进度条
   // 进度条
-  NProgress.done();
+  NProgress.done()
   // 更改标题
   // 更改标题
-  i18n.setTitle(to.meta.name || to.name, to.meta.title);
-});
+  i18n.setTitle(to.meta.name || to.name, to.meta.title)
+})
 
 
-export default router;
+export default router

+ 7 - 1
src/router/routes.js

@@ -360,6 +360,12 @@ const frameCustom = [
         meta: { title: '签到' },
         meta: { title: '签到' },
         component: _import('/platform/bpmn/siginin/index')
         component: _import('/platform/bpmn/siginin/index')
       },
       },
+      {
+        path: 'siginin/outIndex',
+        name: 'outSiginin',
+        meta: { title: '签到' },
+        component: _import('/platform/bpmn/siginin/outIndex')
+      },
       {
       {
         path: 'report/oralReport',
         path: 'report/oralReport',
         name: 'oralReport',
         name: 'oralReport',
@@ -404,7 +410,7 @@ const frameCustom = [
       },
       },
       {
       {
         path: 'shiftTransferApplication/staList',
         path: 'shiftTransferApplication/staList',
-        name: 'mySchedule',
+        name: 'shiftTransferApplication',
         meta: { title: '调班申请' },
         meta: { title: '调班申请' },
         component: _import('/platform/bpmn/shiftTransferApplication/staList')
         component: _import('/platform/bpmn/shiftTransferApplication/staList')
       }
       }

+ 23 - 22
src/setting.js

@@ -1,40 +1,41 @@
-import { version } from "../package";
+import { version } from '../package'
 
 
 export default {
 export default {
-  title: "深圳金源信通科技有限公司",
+  title: '深圳金源信通科技有限公司',
   // 版本
   // 版本
   releases: {
   releases: {
     version: version,
     version: version,
-    api: "", // 更新版本的api
+    api: '' // 更新版本的api
   },
   },
   system: {
   system: {
-    size: "small",
-    language: "zh-CN",
+    size: 'small',
+    language: 'zh-CN',
     languageList: [
     languageList: [
-      { value: "zh-CN", label: "简体中文" },
-      { value: "zh-TW", label: "繁体中文" },
-      { value: "en", label: "English" },
-      { value: "ja", label: "日本語" },
-    ],
+      { value: 'zh-CN', label: '简体中文' },
+      { value: 'zh-TW', label: '繁体中文' },
+      { value: 'en', label: 'English' },
+      { value: 'ja', label: '日本語' }
+    ]
   },
   },
   whiteRouterList: [
   whiteRouterList: [
-    "/login",
-    "/register",
-    "/forget",
-    "/tenantRegister",
-    "/tenantForget",
-    "/authredirect",
-    "/ziliao",
-    "/sealCompleted",
-    "/fileView",
+    '/login',
+    '/register',
+    '/forget',
+    '/tenantRegister',
+    '/tenantForget',
+    '/authredirect',
+    '/ziliao',
+    '/sealCompleted',
+    '/fileView',
+    '/bpmn/siginin/outIndex'
   ],
   ],
   // 全局key
   // 全局key
-  globalKey: "ibps-app-" + version,
+  globalKey: 'ibps-app-' + version,
   /**
   /**
    * @type {string | array} 'production' | ['production', 'development']
    * @type {string | array} 'production' | ['production', 'development']
    * @description Need show err logs component.
    * @description Need show err logs component.
    * The default is only used in the production env
    * The default is only used in the production env
    * If you want to also use it in dev, you can pass ['production', 'development']
    * If you want to also use it in dev, you can pass ['production', 'development']
    */
    */
-  errorLog: "production",
-};
+  errorLog: 'production'
+}

+ 152 - 0
src/views/platform/bpmn/siginin/outIndex.vue

@@ -0,0 +1,152 @@
+<template>
+  <div ref="outSideRootClass" class="outSideRootClass20240918">
+    <van-sticky>
+      <van-nav-bar
+        :title="'签到'"
+        :left-text="$t('common.button.back')"
+        left-arrow
+        @click-left="$router.push({ name: 'login' })"
+      />
+    </van-sticky>
+    <van-field
+      v-model="xingMing"
+      required
+      label="姓名:"
+      placeholder="请输入姓名"
+      label-width="3em"
+      clearable
+    />
+    <van-field
+      v-model="keShi"
+      label="科室:"
+      placeholder="请输入科室"
+      label-width="3em"
+      clearable
+    />
+    <van-field
+      v-model="zhiWu"
+      label="职务:"
+      placeholder="请输入职务"
+      label-width="3em"
+      clearable
+    />
+    <ibps-signature
+      v-model="qianMing"
+      label="签名"
+      class="qianMing"
+      placeholder=" "
+    />
+    <div class="qdBtn">
+      <van-button
+        type="success"
+        class="btn btn-back-color"
+        @click="onSubmit"
+      >
+        签到
+      </van-button>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      xingMing: '',
+      keShi: '',
+      zhiWu: '',
+      qianMing: ''
+    }
+  },
+  mounted() {
+    this.$refs.outSideRootClass.style.height = document.documentElement.clientHeight + 'px'
+  },
+  methods: {
+    onSubmit() {
+      if (this.xingMing === '') {
+        this.$toast({
+          duration: 2000, // 持续展示 toast
+          message: '请输入姓名'
+        })
+      } else if (this.keShi === '') {
+        this.$toast({
+          duration: 2000, // 持续展示 toast
+          message: '请输入科室'
+        })
+      } else if (this.zhiWu === '') {
+        this.$toast({
+          duration: 2000, // 持续展示 toast
+          message: '请输入职务'
+        })
+      } else if (this.qianMing === '') {
+        this.$toast({
+          duration: 2000, // 持续展示 toast
+          message: '请输入签名'
+        })
+      } else {
+        const paramWhere = {
+          ren_yuan_xing_min: this.xingMing,
+          wai_bu_ren_yuan_q: this.qianMing,
+          xiang_guan_xin_xi: JSON.stringify({ keShi: this.keShi, zhiWu: this.zhiWu })
+        }
+        const addParams = {
+          tableName: 't_qdxxb',
+          paramWhere
+        }
+        this.$common.request('add', addParams).then(res => {
+          const { cont } = res.variables || {}
+          if (cont.length) {
+            this.$toast({
+              duration: 2000, // 持续展示 toast
+              message: '签到成功'
+            })
+            setTimeout(() => {
+              this.$router.push({ name: 'login' })
+            }, 2000)
+          }
+        })
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.outSideRootClass20240918{
+  background-color: #f8f8f8;
+  overflow-y: scroll;
+  overflow-x: hidden;
+  .qdBtn{
+    text-align: center;
+    .btn {
+      width: 90%;
+      padding: 15px;
+      border-radius: 5px;
+    }
+    .btn-back-color {
+      background-color: #1989fa !important;
+      border: none;
+    }
+  }
+
+  ::v-deep .qianMing .van-cell--borderless {
+    padding-left: 8px;
+  }
+  ::v-deep .qianMing .van-cell .van-field__label {
+    display: flex;
+    align-items: center;
+    justify-content: left;
+    font-size: 14px;
+    color: #646566;
+  }
+  ::v-deep .qianMing .van-cell .van-field__label::before {
+    content: '';
+    width: 5px;
+    height: 14px;
+    background-color: #2979ff;
+    border-radius: 2px;
+    margin-right: 5px;
+  }
+}
+.outSideRootClass20240918::-webkit-scrollbar{
+  width: 0;
+}
+</style>

+ 204 - 161
src/views/system/login/index.vue

@@ -11,15 +11,34 @@
       </div>
       </div>
       <div class="ibps-p">
       <div class="ibps-p">
         <van-form ref="form" @submit="handleLogin" @failed="onFailed">
         <van-form ref="form" @submit="handleLogin" @failed="onFailed">
-          <van-field v-model="loginForm.username" :placeholder="$t('system.login.usernamePlaceholder')"
-            :rules="usernameRules" name="username" icon-prefix="ibps-icon" left-icon="user-circle-o" clearable />
-          <van-field v-model="loginForm.password" :type="passwordType"
-            :placeholder="$t('system.login.passwordPlaceholder')" :rules="[{ required: true, message: ' ' }]"
-            :right-icon="passwordType==='password'?'eye-slash':'eye'" name="password" icon-prefix="ibps-icon"
-            left-icon="lock" clearable @click-right-icon="showPassword" />
-          <van-field v-if="enabledValidCode" v-model="loginForm.captcha"
-            :placeholder="$t('system.login.codePlaceholder')" :rules="[{ required: true, message: ' ' }]" name="captcha"
-            icon-prefix="ibps-icon" left-icon="qrcode" clearable>
+          <van-field
+v-model="loginForm.username"
+:placeholder="$t('system.login.usernamePlaceholder')"
+            :rules="usernameRules"
+name="username"
+icon-prefix="ibps-icon"
+left-icon="user-circle-o"
+clearable />
+          <van-field
+v-model="loginForm.password"
+:type="passwordType"
+            :placeholder="$t('system.login.passwordPlaceholder')"
+:rules="[{ required: true, message: ' ' }]"
+            :right-icon="passwordType==='password'?'eye-slash':'eye'"
+name="password"
+icon-prefix="ibps-icon"
+            left-icon="lock"
+clearable
+@click-right-icon="showPassword" />
+          <van-field
+v-if="enabledValidCode"
+v-model="loginForm.captcha"
+            :placeholder="$t('system.login.codePlaceholder')"
+:rules="[{ required: true, message: ' ' }]"
+name="captcha"
+            icon-prefix="ibps-icon"
+left-icon="qrcode"
+clearable>
             <template #button>
             <template #button>
               <img :src="code.src" class="login-code-img" @click="refreshCode">
               <img :src="code.src" class="login-code-img" @click="refreshCode">
             </template>
             </template>
@@ -31,6 +50,9 @@
           </div>
           </div>
         </van-form>
         </van-form>
         <switch-environment v-if="$nodeEnv === 'development'" class="ibps-mt ibps-text-center" type="link" />
         <switch-environment v-if="$nodeEnv === 'development'" class="ibps-mt ibps-text-center" type="link" />
+        <div v-if="outSideSingInShow" class="outSideSingInClass">
+          <span @click="goOutSideSingIn()">非内部人员签到</span>
+        </div>
       </div>
       </div>
       <div class="copyright">
       <div class="copyright">
         {{ $t('common.company') }}©{{ $t('common.copyright') }}
         {{ $t('common.company') }}©{{ $t('common.copyright') }}
@@ -40,170 +62,191 @@
 </template>
 </template>
 
 
 <script>
 <script>
-  import { mapActions } from 'vuex'
-  import Utils from '@/utils/util'
-  import '@/assets/styles/pages/login.scss'
-  import SwitchEnvironment from '@/views/system/switch-environment'
+import { mapActions } from 'vuex'
+import Utils from '@/utils/util'
+import '@/assets/styles/pages/login.scss'
+import SwitchEnvironment from '@/views/system/switch-environment'
 
 
-  const loginForm = process.env.NODE_ENV === 'development'
-    ? {
-      username: 'shekou',
-      password: 'szjbd168'
-    } : {
-      username: '',
-      password: ''
+const loginForm = process.env.NODE_ENV === 'development'
+  ? {
+    username: 'shekou',
+    password: 'szjbd168'
+  } : {
+    username: '',
+    password: ''
+  }
+export default {
+  components: {
+    SwitchEnvironment
+  },
+  data() {
+    return {
+      passwordType: 'password',
+      loginForm: {
+        username: loginForm.username,
+        password: loginForm.password,
+        requestId: '',
+        captcha: ''
+      },
+      // redirect: undefined,
+      redirect: null,
+      isRegOpen: false,
+      enabledValidCode: false,
+      code: {
+        src: '',
+        value: '',
+        len: 5,
+        type: 'src'
+      },
+      usernameRules: [{ required: true, message: ' ' }],
+      outSideSingInShow: false
     }
     }
-  export default {
-    components: {
-      SwitchEnvironment
-    },
-    data() {
-      return {
-        passwordType: 'password',
-        loginForm: {
-          username: loginForm.username,
-          password: loginForm.password,
-          requestId: '',
-          captcha: ''
-        },
-        // redirect: undefined,
-        redirect: null,
-        isRegOpen: false,
-        enabledValidCode: false,
-        code: {
-          src: '',
-          value: '',
-          len: 5,
-          type: 'src'
-        },
-        usernameRules: [{ required: true, message: ' ' }]
-      }
-    },
-    watch: {
-      $route: {
-        handler: function (route) {
-          // if (route.query.codeId) {
-          // this.redirect = '/dashboard'
-          // this.redirect = `${route.path}?codeId=${route.query.codeId}`;
-          // } else {
-          this.redirect = route.query && route.query.redirect
-          // }
-        },
-        immediate: true
-      }
-    },
+  },
+  watch: {
+    $route: {
+      handler: function(route) {
+        // if (route.query.codeId) {
+        // this.redirect = '/dashboard'
+        // this.redirect = `${route.path}?codeId=${route.query.codeId}`;
+        // } else {
+        this.redirect = route.query && route.query.redirect
+        if (this.redirect && this.redirect.indexOf('/bpmn/siginin/index?codeId=') !== -1) {
+          this.outSideSingInShow = true
+        }
+        // }
+      },
+      immediate: true
+    }
+  },
 
 
-    created() {
-      this.isRegisterOpen()
-      this.loadValidCode(true)
-    },
-    mounted() {
-      // 注销退出清空验证码
-      this.loginForm.captcha = ''
-      // 注销退出清空请求ID
-      this.loginForm.requestId = ''
+  created() {
+    this.isRegisterOpen()
+    this.loadValidCode(true)
+  },
+  mounted() {
+    // 注销退出清空验证码
+    this.loginForm.captcha = ''
+    // 注销退出清空请求ID
+    this.loginForm.requestId = ''
+  },
+  methods: {
+    ...mapActions('ibps/account', [
+      'login',
+      'getCaptcha',
+      'getRegisterOpen'
+    ]),
+    isRegisterOpen() {
+      this.getRegisterOpen().then((data) => {
+        this.isRegOpen = data.data
+        if (this.isRegOpen) {
+          this.usernameRules = [
+            { required: true, message: ' ' },
+            { validator: this.validateMobile, message: ' ' }
+          ]
+        } else {
+          this.usernameRules = [{ required: true, message: ' ' }]
+        }
+      }).catch((e) => { })
     },
     },
-    methods: {
-      ...mapActions('ibps/account', [
-        'login',
-        'getCaptcha',
-        'getRegisterOpen'
-      ]),
-      isRegisterOpen() {
-        this.getRegisterOpen().then((data) => {
-          this.isRegOpen = data.data
-          if (this.isRegOpen) {
-            this.usernameRules = [
-              { required: true, message: ' ' },
-              { validator: this.validateMobile, message: ' ' }
-            ]
+    validateMobile(value) {
+      if (Utils.isEmpty(value)) {
+        return false
+      } else {
+        const isPhone = /^1(3|4|5|6|7|8|9)\d{9}$/
+        if (value.length === 11) {
+          if (!isPhone.test(value)) {
+            return false
           } else {
           } else {
-            this.usernameRules = [{ required: true, message: ' ' }]
+            return true
           }
           }
-        }).catch((e) => { })
-      },
-      validateMobile(value) {
-        if (Utils.isEmpty(value)) {
-          return false
         } else {
         } else {
-          const isPhone = /^1(3|4|5|6|7|8|9)\d{9}$/
-          if (value.length === 11) {
-            if (!isPhone.test(value)) {
-              return false
-            } else {
-              return true
-            }
+          if (!isPhone.test(value)) {
+            return false
           } else {
           } else {
-            if (!isPhone.test(value)) {
-              return false
-            } else {
-              return false
-            }
+            return false
           }
           }
         }
         }
-      },
-      // 获取验证码
-      loadValidCode(isBackfill) {
-        this.getCaptcha({ params: { requestId: this.loginForm.requestId } }).then((data) => {
-          // 返回状态501,说明系统没有开启验证码
-          if (data.state === 501) {
-            this.enabledValidCode = false
-          } else {
-            this.enabledValidCode = true
-            this.code.src = data.data
-            this.loginForm.requestId = data.variables.requestId
-          }
-          this.initValidCode()
-          if (isBackfill) {
-            this.loginForm.code = this.code.value
-          }
-        }).catch((e) => {
-
-        })
-      },
-      refreshCode() {
-        this.loadValidCode()
-      },
-      showPassword() {
-        this.passwordType === 'text'
-          ? (this.passwordType = 'password')
-          : (this.passwordType = 'text')
-      },
-      onFailed({ values }) {
-        if (this.enabledValidCode && this.$utils.isEmpty(values.captcha)) {
-          this.$toast(this.$t('system.login.codeCorrect'))
-          return
-        }
-
-        if (this.$utils.isNotEmpty(values.username) && this.isRegOpen) {
-          this.$toast(this.$t('system.login.mobileCorrect'))
+      }
+    },
+    // 获取验证码
+    loadValidCode(isBackfill) {
+      this.getCaptcha({ params: { requestId: this.loginForm.requestId }}).then((data) => {
+        // 返回状态501,说明系统没有开启验证码
+        if (data.state === 501) {
+          this.enabledValidCode = false
         } else {
         } else {
-          this.$toast(this.$t('system.login.usernamePasswordCorrect'))
+          this.enabledValidCode = true
+          this.code.src = data.data
+          this.loginForm.requestId = data.variables.requestId
         }
         }
-      },
-      handleLogin() {
-        this.login({
-          form: this.loginForm
-        }).then(() => {
-          // let path = '/'
-          // if (this.redirect) {
-          //   path = '/dashboard'
-          // }
-          let redirectPath = this.redirect || '/';
-          this.$router.push({ path: redirectPath })
-        }).catch((err) => {
-          // 验证码错误自动清空&密码输入错误3次后触发验证码填写模块
-          if (err && err.state === 6020104) {
-            this.loginForm.captcha = ''
-            this.enabledValidCode = true
-            this.refreshCode()
-          }
-          if (err && err.state && this.enabledValidCode) {
-            this.loginForm.captcha = ''
-            this.refreshCode()
-          }
-        })
+        this.initValidCode()
+        if (isBackfill) {
+          this.loginForm.code = this.code.value
+        }
+      }).catch((e) => {
+
+      })
+    },
+    refreshCode() {
+      this.loadValidCode()
+    },
+    showPassword() {
+      this.passwordType === 'text'
+        ? (this.passwordType = 'password')
+        : (this.passwordType = 'text')
+    },
+    onFailed({ values }) {
+      if (this.enabledValidCode && this.$utils.isEmpty(values.captcha)) {
+        this.$toast(this.$t('system.login.codeCorrect'))
+        return
+      }
+
+      if (this.$utils.isNotEmpty(values.username) && this.isRegOpen) {
+        this.$toast(this.$t('system.login.mobileCorrect'))
+      } else {
+        this.$toast(this.$t('system.login.usernamePasswordCorrect'))
       }
       }
+    },
+    handleLogin() {
+      this.login({
+        form: this.loginForm
+      }).then(() => {
+        // let path = '/'
+        // if (this.redirect) {
+        //   path = '/dashboard'
+        // }
+        const redirectPath = this.redirect || '/'
+        this.$router.push({ path: redirectPath })
+      }).catch((err) => {
+        // 验证码错误自动清空&密码输入错误3次后触发验证码填写模块
+        if (err && err.state === 6020104) {
+          this.loginForm.captcha = ''
+          this.enabledValidCode = true
+          this.refreshCode()
+        }
+        if (err && err.state && this.enabledValidCode) {
+          this.loginForm.captcha = ''
+          this.refreshCode()
+        }
+      })
+    },
+    goOutSideSingIn() {
+      const redirectPath = this.redirect.replace('index', 'outIndex')
+      this.$router.push({ path: redirectPath })
     }
     }
   }
   }
-</script>
+}
+</script>
+<style lang="scss" scoped>
+.outSideSingInClass{
+  text-align: center;
+  font-size: 12px;
+  color: #409EFF;
+  margin-top: 20px;
+  // text-decoration: underline;
+  span{
+    padding: 0 4px 1px 4px;
+    border-bottom: 1px solid #409EFF;
+  }
+}
+</style>