|
|
@@ -198,7 +198,6 @@ export default {
|
|
|
sysId: null,
|
|
|
systemType: "1", //系统类型
|
|
|
addressInfo: {}, //当前登录信息
|
|
|
- locationIp:'',//当前ip
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -304,7 +303,22 @@ export default {
|
|
|
window.location.href =
|
|
|
process.env.CONSOLE_BASE_URL + "/#/index?token=" + token;
|
|
|
// alert(res.data);
|
|
|
- } else {
|
|
|
+ }else if (this.sysId === 3) {
|
|
|
+ Cookies.set("user", this.loginForm.account);
|
|
|
+ let userId = this.loginForm.account;
|
|
|
+ let data ={
|
|
|
+ userId: userId,
|
|
|
+ token: res.data
|
|
|
+ }
|
|
|
+ let jsonStr = JSON.stringify(data);
|
|
|
+ let token = CryptoJS.AES.encrypt(
|
|
|
+ jsonStr,
|
|
|
+ "token"
|
|
|
+ ).toString();
|
|
|
+ window.location.href =process.env.CONSOLE_KHGX_URL + "?token=" + token;
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
this.getUser();
|
|
|
Cookies.set("token", res.data); // 放置token到Cookie
|
|
|
// this.submitLocation();
|
|
|
@@ -312,8 +326,7 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
let userId = sessionStorage.getItem("user");
|
|
|
let data = {
|
|
|
- // ...this.addressInfo,
|
|
|
- ip:this.locationIp,
|
|
|
+ ...this.addressInfo,
|
|
|
userId,
|
|
|
systemType: this.systemType,
|
|
|
};
|
|
|
@@ -343,8 +356,7 @@ export default {
|
|
|
submitLocation() {
|
|
|
let location = {
|
|
|
systemType: this.systemType,
|
|
|
- // ...this.addressInfo,
|
|
|
- ip:this.locationIp,
|
|
|
+ ...this.addressInfo,
|
|
|
};
|
|
|
this.$api.login.uploadLocationInfo(location).then((res) => {
|
|
|
if (res.code !== 200) {
|
|
|
@@ -492,10 +504,9 @@ export default {
|
|
|
this.refreshCaptcha();
|
|
|
/**获取当前登录的ip地址 */
|
|
|
getUserIP((ip) => {
|
|
|
- this.locationIp=ip
|
|
|
- // getAddressLocation(ip, (info) => {
|
|
|
- // this.addressInfo = ip;
|
|
|
- // });
|
|
|
+ getAddressLocation(ip, (info) => {
|
|
|
+ this.addressInfo = info;
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
computed: {
|