ludc
2023-09-26 1707976c2f30199565c2ddbea0e2c33edd4688a9
Source/UBCS-WEB/src/page/login/sso.vue
@@ -1,38 +1,41 @@
<template>
</template>
<script>
import {oaSsos} from "@/api/system/user.js"
import {ssoLogin} from "@/api/system/user.js"
import {mapGetters} from "vuex";
import {setStore} from "@/util/store";
export default {
  name: "sso",
  data() {
    return {}
    return {
      PathString:'',
    }
  },
  computed: {},
  computed: {
    ...mapGetters(["tagWel"])
  },
  created() {
    this.onLoad()
  },
  methods: {
    onLoad() {
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      setTimeout(() => {
        loading.close();
      }, 2000);
      //URL传递参数时 会将字符串中的 %2B 也就是+号转换为空格。
      this.PathString = decodeURIComponent(this.$route.query.empCode.replace(/\s/g, '+'));
      //console.log(this.$route);
      //console.log(this.PathString);
      this.$store.dispatch("LoginBySso", { PathString: this.PathString }).then((res) => {
        console.log('res', res)
        this.$router.push({ path: this.tagWel.value });
      })
    }
  }
}
</script>
<style scoped>
</style>
</style>