Commit d52b827d by 展昭

update

parent 7892dc5f
const setBarHeight = { const setBarHeight = {
mounted() { 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 () { ...@@ -54,8 +54,8 @@ Vue.prototype.setPageNavState = function () {
const VConsole = require('vconsole') // const VConsole = require('vconsole')
const my_console = new VConsole(); // const my_console = new VConsole();
......
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
[Icon.name]: Icon, [Icon.name]: Icon,
TabHeader TabHeader
}, },
mixins: [setBarHeight],
data() { data() {
return { return {
title: "人事服务", title: "人事服务",
...@@ -418,6 +418,36 @@ export default { ...@@ -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() { closeWebView() {
try { try {
window.WebViewJavascriptBridge.callHandler( window.WebViewJavascriptBridge.callHandler(
...@@ -440,6 +470,7 @@ export default { ...@@ -440,6 +470,7 @@ export default {
this.globalNavLeftArrowClick(this.navLeftArrowClick); this.globalNavLeftArrowClick(this.navLeftArrowClick);
await this.loadPeriodData(); await this.loadPeriodData();
this.payUrl = await this.loadPayUrl(); this.payUrl = await this.loadPayUrl();
this.getBarHeight();
} }
}; };
</script> </script>
......
<template> <template>
<div></div> <div class="callback">{{errMessage}}</div>
</template> </template>
<script> <script>
...@@ -15,6 +15,11 @@ const oidc_config = JSON.parse(process.env.VUE_APP_OIDC_CONFIG); ...@@ -15,6 +15,11 @@ const oidc_config = JSON.parse(process.env.VUE_APP_OIDC_CONFIG);
export default { export default {
name: "OidcCallback", name: "OidcCallback",
data() {
return {
errMessage: "应用未授权该用户"
};
},
methods: { methods: {
...mapActions(["oidcSignInCallback", "getOidcUser"]), ...mapActions(["oidcSignInCallback", "getOidcUser"]),
async getToken(access_token, appid, redirectPath) { async getToken(access_token, appid, redirectPath) {
...@@ -42,12 +47,13 @@ export default { ...@@ -42,12 +47,13 @@ export default {
} }
}, },
err => { err => {
console.log("err=", err); console.log("123err=", err);
this.errMessage = err.error_description;
} }
) )
.catch(err => { .catch(err => {
console.log("err=", 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 { ...@@ -61,7 +67,7 @@ export default {
}) })
.catch(err => { .catch(err => {
console.error(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