| | |
| | | } |
| | | //单点登录接口 |
| | | 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 |
| | | }) |
| | | } |
| | | |
| | |
| | | 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) |
| | |
| | | |
| | | 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 }); |
| | |
| | | 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"; |
| | | |
| | |
| | | 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() |
| | | }, |