Commit d52b827d by 展昭

update

parent 7892dc5f
const setBarHeight = {
mounted() {
try {
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
null,
function (response) {
console.log("getBarHeight来自 ios/android的回传数据: ", response);
if (response) {
const barHeight = response.statusBarHeight;
const conHeight = 46 + barHeight;
document
.getElementsByClassName("iosStyle")[0]
.setAttribute(
"style",
"padding-top:" + barHeight + "px !important"
);
document
.getElementsByClassName("container")[0]
.setAttribute(
"style",
"padding-top:" + conHeight + "px !important"
);
}
}
);
} catch (err) {
console.log("getBarHeight is error");
}
}
}
......
......@@ -54,8 +54,8 @@ Vue.prototype.setPageNavState = function () {
const VConsole = require('vconsole')
const my_console = new VConsole();
// const VConsole = require('vconsole')
// const my_console = new VConsole();
......
......@@ -167,7 +167,7 @@ export default {
[Icon.name]: Icon,
TabHeader
},
mixins: [setBarHeight],
data() {
return {
title: "人事服务",
......@@ -418,6 +418,36 @@ export default {
}
}
},
getBarHeight() {
try {
window.WebViewJavascriptBridge.callHandler(
"getBarHeight",
null,
function(response) {
console.log("getBarHeight来自 ios/android的回传数据: ", response);
if (response) {
const barHeight = response.statusBarHeight;
const conHeight = 46 + barHeight;
document
.getElementsByClassName("iosStyle")[0]
.setAttribute(
"style",
"padding-top:" + barHeight + "px !important"
);
document
.getElementsByClassName("container")[0]
.setAttribute(
"style",
"padding-top:" + conHeight + "px !important"
);
}
}
);
} catch (err) {
console.log("getBarHeight is error");
}
},
closeWebView() {
try {
window.WebViewJavascriptBridge.callHandler(
......@@ -440,6 +470,7 @@ export default {
this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.loadPeriodData();
this.payUrl = await this.loadPayUrl();
this.getBarHeight();
}
};
</script>
......
<template>
<div></div>
<div class="callback">{{errMessage}}</div>
</template>
<script>
......@@ -15,6 +15,11 @@ const oidc_config = JSON.parse(process.env.VUE_APP_OIDC_CONFIG);
export default {
name: "OidcCallback",
data() {
return {
errMessage: "应用未授权该用户"
};
},
methods: {
...mapActions(["oidcSignInCallback", "getOidcUser"]),
async getToken(access_token, appid, redirectPath) {
......@@ -42,12 +47,13 @@ export default {
}
},
err => {
console.log("err=", err);
console.log("123err=", err);
this.errMessage = err.error_description;
}
)
.catch(err => {
console.log("err=", err);
this.$router.push("/oidc-callback-error"); // Handle errors any way you want
//this.$router.push("/oidc-callback-error"); // Handle errors any way you want
});
}
},
......@@ -61,7 +67,7 @@ export default {
})
.catch(err => {
console.error(err);
this.$router.push("/oidc-callback-error"); // Handle errors any way you want
//this.$router.push("/oidc-callback-error"); // Handle errors any way you want
});
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment