田源
2023-09-21 fc94a3e59121707b6f49d0d60c38d9a4d9ac3567
sso单点登录跳转页
已修改2个文件
72 ■■■■ 文件已修改
Source/UBCS-WEB/src/page/login/sso.vue 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/page/login/userlogin.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/page/login/sso.vue
@@ -1,5 +1,5 @@
<template>
  <p>测试</p>
</template>
<script>
@@ -10,56 +10,25 @@
export default {
  name: "sso",
  data() {
    return {
      loginForm:{
        //租户ID
        tenantId: "",
        //部门ID
        deptId: "",
        //角色ID
        roleId: "",
        //用户名
        username: "",
        //密码
        password: "",
        selectInput: '',
        //下拉input数据
        value: '管理组',
        //下拉菜单
        region: [],
        //账号类型
        type: "account",
        //验证码的索引
        key: "",
        //预加载白色背景
        image: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
      },
    }
    return {}
  },
  computed: {
    ...mapGetters(["tagWel", "userInfo"])
  },
  computed: {},
  created() {
    this.onLoad()
  },
  methods: {
    // Onload() {
    //   let name = 'pwdfree'
    //   oaSsos(name).then(res=>{
    //     console.log(res)
    //     if(res.status === 200){
    //       // this.loginForm.tenantId=res.data.tenant_id;
    //       // this.loginForm.username=res.data.user_name;
    //       this.$store.dispatch("LoginBySso").then((res) => {
    //         console.log('res',res)
    //           this.$router.push({path: this.tagWel.value});
    //       })
    //       // console.log(this.tagWel)
    //       // this.$router.push({path: this.tagWel.value});
    //     }
    //   })
    // }
    onLoad() {
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      setTimeout(() => {
        loading.close();
      }, 2000);
    }
  }
}
</script>
Source/UBCS-WEB/src/page/login/userlogin.vue
@@ -300,10 +300,11 @@
  props: [],
  methods: {
    ChandleLogin() {
      this.$store.dispatch("LoginBySso").then((res) => {
        console.log('res', res)
        this.$router.push({path: this.tagWel.value});
      })
      // this.$store.dispatch("LoginBySso").then((res) => {
      //   console.log('res', res)
      //   this.$router.push({path: this.tagWel.value});
      // })
      this.$router.push({path:'/sso'});
    },
    closehandle() {
      removeToken()