ludc
2023-09-25 d461ab496723b4fdd04fe9df3e61eebe43caf72c
Merge remote-tracking branch 'origin/master'
已修改4个文件
31 ■■■■ 文件已修改
Source/UBCS-WEB/src/api/system/user.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/config/Decrypt.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/page/login/sso.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/page/login/userlogin.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/api/system/user.js
@@ -161,12 +161,15 @@
}
//单点登录接口
export const ssoLogin =(empCode) => {
  const params = new URLSearchParams();
  console.log(empCode);
  params.append('empCode', empCode);
  return request({
    url: '/api/ubcs-code/passwordFree/ssoLogin',
    method: 'get',
    params:{
      empCode
    }
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: params
  })
}
Source/UBCS-WEB/src/config/Decrypt.js
@@ -12,10 +12,11 @@
  const decryptedStr = decrypt.toString(enc.Utf8);
  return decryptedStr;
}
//加密 Vue 代码
// const plaintext = 'your plaintext';
// const key = 'your encryption key';
// const iv = 'your initialization vector';
//
// const encrypted = CryptoJS.AES.encrypt(plaintext, key, { iv: iv });
// const ciphertext = encrypted.toString();
// console.log('ciphertext',ciphertext)
Source/UBCS-WEB/src/page/login/sso.vue
@@ -23,7 +23,10 @@
  methods: {
    onLoad() {
      this.PathString=this.$route.query.empCode;
      //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 });
Source/UBCS-WEB/src/page/login/userlogin.vue
@@ -75,7 +75,7 @@
import {mapGetters} from "vuex";
import {info} from "@/api/system/tenant";
import {getTopUrl} from "@/util/util";
import {oaSsos, updatePassword} from "@/api/system/user.js"
import { updatePassword} from "@/api/system/user.js"
import {removeToken} from "@/util/auth";
import md5 from "js-md5";
@@ -300,17 +300,13 @@
  props: [],
  methods: {
    ChandleLogin() {
      // this.$store.dispatch("LoginBySso").then((res) => {
      //   console.log('res', res)
      //   this.$router.push({path: this.tagWel.value});
      // })
      this.$router.push({path:'/sso'});
      this.$router.push({ path: '/sso' });
    },
    closehandle() {
      removeToken()
    },
    delok() {
      //点击取消或者x 清除token关闭弹窗 清除token后会自动重新获取用户信息 这里没有重新调用方法,因为下面逻辑有点绕,怕重新掉有bug直接清除token重新获取用户信息
      //点击取消或者x 清除token关闭弹窗 清除token后会自动重新获取用户信息
      this.dialogFormVisible = false;
      removeToken()
    },