|
@@ -37,6 +37,7 @@
|
|
|
<p>请等待浏览器跳转到新页面</p>
|
|
|
</div>
|
|
|
<script>
|
|
|
+ const debug = localStorage.getItem('debug')
|
|
|
|
|
|
const hrefMap = {
|
|
|
// 公文管理
|
|
@@ -93,9 +94,32 @@
|
|
|
}
|
|
|
|
|
|
if (token) {
|
|
|
- login({
|
|
|
- token,
|
|
|
- api: 'json'
|
|
|
+ fetch('https://openapi.bozedu.net/jlt/set/detail', {
|
|
|
+ method: 'POST',
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
+ },
|
|
|
+ body: JSON.stringify({
|
|
|
+ js_code,
|
|
|
+ token,
|
|
|
+ client: 'web',
|
|
|
+ api: 'json',
|
|
|
+ site: 'qqyxt'
|
|
|
+ })
|
|
|
+ }).then(res => res.json()).then(res => {
|
|
|
+ if (res.code === '1') {
|
|
|
+ const data = res.data
|
|
|
+ const _ = data.one_info
|
|
|
+ sessionStorage.setItem('js_title', _.js_title)
|
|
|
+ } else {
|
|
|
+ // alert(res.msg)
|
|
|
+ console.error('no data from /jlt/set/detail')
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ return login({
|
|
|
+ token,
|
|
|
+ api: 'json'
|
|
|
+ })
|
|
|
}).then(res => {
|
|
|
if (res.code === '1') {
|
|
|
const userInfo = res.data
|
|
@@ -104,15 +128,36 @@
|
|
|
const role = parseInt(userInfo.user_role_id) < 72 ? 'ju' : 'xiao'
|
|
|
sessionStorage.setItem('role', role)
|
|
|
console.log('jump to : ', origin + hrefMap[apppath][role])
|
|
|
+ if (debug) {
|
|
|
+ alert('debug mode')
|
|
|
+ }
|
|
|
+
|
|
|
window.open(origin + hrefMap[apppath][role], '_self')
|
|
|
+
|
|
|
} else {
|
|
|
alert(res.msg)
|
|
|
}
|
|
|
})
|
|
|
+ // login({
|
|
|
+ // token,
|
|
|
+ // api: 'json'
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.code === '1') {
|
|
|
+ // const userInfo = res.data
|
|
|
+ // localStorage.setItem('userInfo', JSON.stringify(res.data))
|
|
|
+
|
|
|
+ // const role = parseInt(userInfo.user_role_id) < 72 ? 'ju' : 'xiao'
|
|
|
+ // sessionStorage.setItem('role', role)
|
|
|
+ // console.log('jump to : ', origin + hrefMap[apppath][role])
|
|
|
+ // window.open(origin + hrefMap[apppath][role], '_self')
|
|
|
+ // } else {
|
|
|
+ // alert(res.msg)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
} else {
|
|
|
window.history.back()
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
-</html>
|
|
|
+</html>
|