|
@@ -51,7 +51,7 @@
|
|
import { ACCESS_TOKEN, USER_NAME, USER_INFO } from "@/common/util/constants";
|
|
import { ACCESS_TOKEN, USER_NAME, USER_INFO } from "@/common/util/constants";
|
|
import { mapActions } from "vuex";
|
|
import { mapActions } from "vuex";
|
|
import configService from "@/common/service/config.service.js";
|
|
import configService from "@/common/service/config.service.js";
|
|
-import {AesEncryption, getLoginCipher} from "@/common/util/cipher.js";
|
|
|
|
|
|
+import { AesEncryption, getLoginCipher } from "@/common/util/cipher.js";
|
|
//import FlvJs from "flv.js";
|
|
//import FlvJs from "flv.js";
|
|
import api from "@/api/api";
|
|
import api from "@/api/api";
|
|
export default {
|
|
export default {
|
|
@@ -77,8 +77,8 @@ export default {
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad: function (option) {
|
|
onLoad: function (option) {
|
|
- console.log("=======option.ticket======"+JSON.stringify(option.ticket));
|
|
|
|
- this.loginCas(option.ticket)
|
|
|
|
|
|
+ console.log("=======option.ticket======" + JSON.stringify(option.ticket));
|
|
|
|
+ this.loginCas(option.ticket);
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
var that = this;
|
|
var that = this;
|
|
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
|
|
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
|
|
@@ -125,10 +125,13 @@ export default {
|
|
username: this.userName,
|
|
username: this.userName,
|
|
password: this.password,
|
|
password: this.password,
|
|
};
|
|
};
|
|
- // 加密
|
|
|
|
- const loginCipher = getLoginCipher()
|
|
|
|
- const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
|
|
|
|
- loginParams.password = encryption.encryptByAES(loginParams.password)
|
|
|
|
|
|
+ // 加密
|
|
|
|
+ const loginCipher = getLoginCipher();
|
|
|
|
+ const encryption = new AesEncryption({
|
|
|
|
+ key: loginCipher.key,
|
|
|
|
+ iv: loginCipher.iv,
|
|
|
|
+ });
|
|
|
|
+ loginParams.password = encryption.encryptByAES(loginParams.password);
|
|
this.loading = true;
|
|
this.loading = true;
|
|
this.mLogin(loginParams)
|
|
this.mLogin(loginParams)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
@@ -158,51 +161,54 @@ export default {
|
|
this.loading = false;
|
|
this.loading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
-
|
|
|
|
- loginCas(value) {
|
|
|
|
- var than = this;
|
|
|
|
-
|
|
|
|
- // this.$tip.success(configService.apiUrl);
|
|
|
|
- var ser = configService.apiUrl;
|
|
|
|
- ser = ser.replace(9999, 8092);
|
|
|
|
- // this.$tip.success(ser);
|
|
|
|
- new Promise((resolve, reject) => {
|
|
|
|
- api
|
|
|
|
- .validateCasLogin("", "?ticket=" + value + "&service=" + encodeURIComponent(ser))
|
|
|
|
- .then((response) => {
|
|
|
|
- // than.$tip.success("登录成功1");
|
|
|
|
-
|
|
|
|
- // if (response.data.code == 200) {
|
|
|
|
- // uni.setStorageSync(ACCESS_TOKEN, response.data.result.token);
|
|
|
|
- // } else {
|
|
|
|
- // }
|
|
|
|
- const result = response.data.result;
|
|
|
|
- const userInfo = result.userInfo;
|
|
|
|
- uni.setStorageSync(ACCESS_TOKEN, result.token);
|
|
|
|
- uni.setStorageSync(USER_INFO, userInfo);
|
|
|
|
- console.log("userInfo=" + userInfo);
|
|
|
|
- than.$store.commit("SET_TOKEN", result.token);
|
|
|
|
- console.log("result.token=" + result.token);
|
|
|
|
- than.$store.commit("SET_DICT", result.sysAllDictItems);
|
|
|
|
- than.$store.commit("SET_AVATAR", userInfo.avatar);
|
|
|
|
- than.$store.commit("SET_NAME", {
|
|
|
|
- username: userInfo.username,
|
|
|
|
- realname: userInfo.realname,
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- // than.$tip.success("loginCas=");
|
|
|
|
- than.getPermissionList();
|
|
|
|
- })
|
|
|
|
- .catch((error) => {
|
|
|
|
- debugger;
|
|
|
|
- console.log("catch===>response", error);
|
|
|
|
- // uni.navigateTo({
|
|
|
|
- // url: "/pages/home/home",
|
|
|
|
- // });
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ loginCas(value) {
|
|
|
|
+ var than = this;
|
|
|
|
+
|
|
|
|
+ // this.$tip.success(configService.apiUrl);
|
|
|
|
+ var ser = configService.apiUrl;
|
|
|
|
+ ser = ser.replace(9999, 8092);
|
|
|
|
+ // this.$tip.success(ser);
|
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
|
+ api
|
|
|
|
+ .validateCasLogin(
|
|
|
|
+ "",
|
|
|
|
+ "?ticket=" + value + "&service=" + encodeURIComponent(ser)
|
|
|
|
+ )
|
|
|
|
+ .then((response) => {
|
|
|
|
+ // than.$tip.success("登录成功1");
|
|
|
|
+
|
|
|
|
+ // if (response.data.code == 200) {
|
|
|
|
+ // uni.setStorageSync(ACCESS_TOKEN, response.data.result.token);
|
|
|
|
+ // } else {
|
|
|
|
+ // }
|
|
|
|
+ const result = response.data.result;
|
|
|
|
+ const userInfo = result.userInfo;
|
|
|
|
+ uni.setStorageSync(ACCESS_TOKEN, result.token);
|
|
|
|
+ uni.setStorageSync(USER_INFO, userInfo);
|
|
|
|
+ console.log("userInfo=" + userInfo);
|
|
|
|
+ than.$store.commit("SET_TOKEN", result.token);
|
|
|
|
+ console.log("result.token=" + result.token);
|
|
|
|
+ than.$store.commit("SET_DICT", result.sysAllDictItems);
|
|
|
|
+ than.$store.commit("SET_AVATAR", userInfo.avatar);
|
|
|
|
+ than.$store.commit("SET_NAME", {
|
|
|
|
+ username: userInfo.username,
|
|
|
|
+ realname: userInfo.realname,
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // than.$tip.success("loginCas=");
|
|
|
|
+ than.getPermissionList();
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ debugger;
|
|
|
|
+ console.log("catch===>response", error);
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
+ // url: "/pages/home/home",
|
|
|
|
+ // });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
//获取权限菜单
|
|
//获取权限菜单
|
|
getPermissionList() {
|
|
getPermissionList() {
|
|
new Promise((resolve, reject) => {
|
|
new Promise((resolve, reject) => {
|
|
@@ -299,7 +305,7 @@ export default {
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
this.$tip.success("登录成功!");
|
|
this.$tip.success("登录成功!");
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
- url: "/pages/index/index",
|
|
|
|
|
|
+ url: "/pages/inedx/inedx",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
this.$tip.error(res.data.message);
|
|
this.$tip.error(res.data.message);
|
|
@@ -324,11 +330,10 @@ export default {
|
|
console.log("changeloginType====");
|
|
console.log("changeloginType====");
|
|
var tourl = configService.apiUrl;
|
|
var tourl = configService.apiUrl;
|
|
tourl = tourl.replace(9999, 8092);
|
|
tourl = tourl.replace(9999, 8092);
|
|
- // this.$tip.success("tourl="+tourl);
|
|
|
|
|
|
+ // this.$tip.success("tourl="+tourl);
|
|
var rastourl =
|
|
var rastourl =
|
|
- "https://id.shendong.com.cn/default" +
|
|
|
|
- "/login?service=" + tourl;
|
|
|
|
- // rastourl ="http://182.92.126.35:8092/?ticket=234";
|
|
|
|
|
|
+ "https://id.shendong.com.cn/default" + "/login?service=" + tourl;
|
|
|
|
+ // rastourl ="http://182.92.126.35:8092/?ticket=234";
|
|
console.log("===========" + rastourl);
|
|
console.log("===========" + rastourl);
|
|
this.openBrowser(rastourl);
|
|
this.openBrowser(rastourl);
|
|
// window.location.href='/pages/index/index?ticket=123'
|
|
// window.location.href='/pages/index/index?ticket=123'
|
|
@@ -337,7 +342,7 @@ export default {
|
|
openBrowser(url) {
|
|
openBrowser(url) {
|
|
// 使用uni.navigateTo打开内置浏览器
|
|
// 使用uni.navigateTo打开内置浏览器
|
|
console.log("----url---------------" + url);
|
|
console.log("----url---------------" + url);
|
|
- // this.$tip.success("url="+url);
|
|
|
|
|
|
+ // this.$tip.success("url="+url);
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: "/pages/webview/webview?url=" + encodeURIComponent(url),
|
|
url: "/pages/webview/webview?url=" + encodeURIComponent(url),
|
|
});
|
|
});
|
|
@@ -376,17 +381,11 @@ export default {
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
.input-placeholder,
|
|
.input-placeholder,
|
|
.zai-input {
|
|
.zai-input {
|
|
color: #94afce;
|
|
color: #94afce;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
.zai-btn {
|
|
.zai-btn {
|
|
background: #ff65a3;
|
|
background: #ff65a3;
|
|
color: #fff;
|
|
color: #fff;
|