jbb преди 2 години
родител
ревизия
b2199639c9
променени са 5 файла, в които са добавени 20 реда и са изтрити 4 реда
  1. 1 1
      public/index.html
  2. 2 0
      src/components/page/GlobalHeader.vue
  3. 6 0
      src/components/tools/UserMenu.vue
  4. 7 0
      src/main.js
  5. 4 3
      src/store/modules/user.js

+ 1 - 1
public/index.html

@@ -272,7 +272,7 @@
     // window._CONFIG['domianURL'] = 'http://106.15.206.14:8087/jeecg-boot';// 测试服务器
     // window._CONFIG['domianURL'] = 'http://220.191.168.86:18087/jeecg-boot';// 森语外网
     // window._CONFIG['domianURL'] = 'http://172.18.91.36:8081/jeecg-boot';// 博物馆oa
-    window._CONFIG['casPrefixUrl'] = 'http://cas.example.org:8443/cas';
+    window._CONFIG['casPrefixUrl'] = 'http://220.191.168.86:18005/cas';
     window._CONFIG['onlinePreviewDomainURL'] = 'http://fileview.jeecg.com/onlinePreview'
     window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/static';
     window._CONFIG['pdfDomainURL'] =  window._CONFIG['domianURL'] + '/sys/common/pdf/pdfPreviewIframe';

+ 2 - 0
src/components/page/GlobalHeader.vue

@@ -25,6 +25,8 @@
       </span>
 
       <user-menu :theme="theme" />
+      <a href="http://220.191.168.86:18004/"  target="_blank" style="color:white;float: right;">切换单证系统</a>
+
     </div>
     <!-- 顶部导航栏模式 -->
     <div v-else :class="['top-nav-header-index', theme]">

+ 6 - 0
src/components/tools/UserMenu.vue

@@ -125,6 +125,12 @@
       let lists = []
       this.searchMenus(lists,this.permissionMenuList)
       this.searchMenuOptions=[...lists]
+    },
+     mounted() {
+        let depart = this.userInfo().orgCode
+        if (!depart) {
+          this.updateCurrentDepart()
+        }
     },
     computed: {
       ...mapState({

+ 7 - 0
src/main.js

@@ -44,6 +44,7 @@ import JeecgComponents from '@/components/jeecg/index'
 import KFormDesign from 'k-form-design'
 // 将自动注册所有组件为全局组件
 import dataV from '@jiaminghi/data-view'
+import SSO from '@/cas/sso.js'
 
 require('@jeecg/antd-online-214')
 require('@jeecg/antd-online-214/dist/OnlineForm.css')
@@ -70,6 +71,11 @@ Vue.prototype.getAction = getAction
 
 
 Vue.use(dataV)
+
+SSO.init(() => {
+    main()
+  })
+function main() {
 new Vue({
     router,
     store,
@@ -93,3 +99,4 @@ new Vue({
     },
     render: h => h(App)
 }).$mount('#app')
+}

+ 4 - 3
src/store/modules/user.js

@@ -201,9 +201,10 @@ const user = {
         Vue.ls.remove(ACCESS_TOKEN)
         //console.log('logoutToken: '+ logoutToken)
         logout(logoutToken).then(() => {
-          //var sevice = "http://"+window.location.host+"/";
-          //var serviceUrl = encodeURIComponent(sevice);
-          //window.location.href = window._CONFIG['casPrefixUrl']+"/logout?service="+serviceUrl;
+            console.log(process.env.VITE_GLOB_APP_OPEN_SSO)
+            let sevice = 'http://' + window.location.host + '/'
+            let serviceUrl = encodeURIComponent(sevice)
+            window.location.href = process.env.VUE_APP_CAS_BASE_URL + '/logout?service=' + serviceUrl
           resolve()
         }).catch(() => {
           resolve()