zhuf 3 weken geleden
bovenliggende
commit
a903105994
1 gewijzigde bestanden met toevoegingen van 6 en 15 verwijderingen
  1. 6 15
      public/refer.html

+ 6 - 15
public/refer.html

@@ -39,16 +39,6 @@
   <script>
     const debug = localStorage.getItem('debug')
 
-    const hrefMap = {
-      // 公文管理
-      'gwgl': { ju: '/ju/#/gwglxt', xiao: '/xiao/#/gwglxt' },
-      // 设备采购
-      'sbcg': { ju: '/ju/#/sbcgsq', xiao: '/xiao/#/sbcgsq' },
-      // 组织机构
-      'zzjg': { ju: '/ju/#/zzjgyqx', xiao: '/xiao/#/zzjgyqx' },
-      // 教师档案
-      'jsda': { ju: '/xiao/#/jzggl', xiao: '/xiao/#/jzggl' },
-    }
 
     const search = decodeURIComponent(location.search)
     const searchMap = new URLSearchParams(search)
@@ -77,7 +67,7 @@
     function login(data) {
       return new Promise((resolve, reject) => {
         const xhr = new XMLHttpRequest()
-        xhr.open('POST', `https://openapi.bozedu.net/user/main/detail`, true)
+        xhr.open('POST', `http://10.100.101.120:90/user/main/detail`, true)
         xhr.onreadystatechange = function () {
           if (xhr.readyState === 4) {
             if (xhr.status === 200) {
@@ -94,7 +84,7 @@
     }
 
     if (token) {
-      fetch('https://openapi.bozedu.net/jlt/set/detail', {
+      fetch('http://10.100.101.120:90/jlt/set/detail', {
         method: 'POST',
         headers: {
           'Content-Type': 'application/x-www-form-urlencoded'
@@ -125,14 +115,15 @@
           const userInfo = res.data
           localStorage.setItem('userInfo', JSON.stringify(res.data))
 
-          const role = parseInt(userInfo.user_role_id) < 72 ? 'ju' : 'xiao'
+          // const role = parseInt(userInfo.user_role_id) < 72 ? 'ju' : 'xiao'
+          const role = apppath.includes('ju') ? 'ju' : 'xiao'
           sessionStorage.setItem('role', role)
-          console.log('jump to : ', origin + hrefMap[apppath][role])
+          console.log('jump to : ', apppath)
           if (debug) {
             alert('debug mode')
           }
 
-          window.open(origin + hrefMap[apppath][role], '_self')
+          window.open(apppath, '_self')
 
         } else {
           alert(res.msg)