Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/zhba_regulatory
5 files modified
1 files deleted
| | |
| | | <template> |
| | | <basic-container> |
| | | <iframe :src="src" |
| | | class="iframe" |
| | | ref="iframe"></iframe> |
| | | <iframe :src="src" class="iframe" ref="iframe"></iframe> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | name: "AvueIframe", |
| | | data() { |
| | | return { |
| | | urlPath: this.getUrlPath() //iframe src 路径 |
| | | urlPath: this.getUrlPath(), //iframe src 路径 |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | routerPath: function () { |
| | | // 监听routerPath变化,改变src路径 |
| | | this.urlPath = this.getUrlPath(); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["screen"]), |
| | |
| | | return this.$route.query.src |
| | | ? this.$route.query.src.replace("$", "#") |
| | | : this.urlPath; |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 显示等待框 |
| | |
| | | load() { |
| | | this.show(); |
| | | var flag = true; //URL是否包含问号 |
| | | if (this.$route.query.src !== undefined && this.$route.query.src.indexOf("?") === -1) { |
| | | if ( |
| | | this.$route.query.src !== undefined && |
| | | this.$route.query.src.indexOf("?") === -1 |
| | | ) { |
| | | flag = false; |
| | | } |
| | | var list = []; |
| | |
| | | let url = window.location.href; |
| | | url = url.replace("/myiframe", ""); |
| | | return url; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | * 全站权限配置 |
| | | * |
| | | */ |
| | | import md5 from 'js-md5' |
| | | import request from '@/router/axios'; |
| | | import { Message } from 'element-ui' |
| | | |
| | | |
| | | import router from './router/router' |
| | | import store from './store' |
| | | import {validatenull} from '@/util/validate' |
| | |
| | | if (meta.isAuth === false) { |
| | | next() |
| | | } else { |
| | | next('/login') |
| | | // console.log(to, from); |
| | | next(); |
| | | if (to.path == '/wel') { |
| | | var a = to.query.securitySupervisionSystem; |
| | | if (typeof a == "string") { |
| | | console.log(to.query.securitySupervisionSystem, 'securitySupervisionSystem'); |
| | | // console.log("有main"); |
| | | |
| | | var obj = JSON.parse(a); |
| | | console.log(obj, "obj"); |
| | | if (typeof obj == "object" && obj) { |
| | | // console.log("自动登入"); |
| | | var data = { |
| | | tenantId: obj.data.dip, |
| | | username: obj.data.rese, |
| | | password: md5(obj.data.sap), |
| | | grant_type: 'password', |
| | | scope: 'all', |
| | | type: 'account' |
| | | }; |
| | | // console.log(data, "自动ssss"); |
| | | request({ |
| | | url: 'http://192.168.109:80/blade-auth/oauth/token', |
| | | method: 'post', |
| | | headers: { |
| | | 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0', |
| | | "Tenant-Id": "000000" |
| | | }, |
| | | params: data |
| | | }).then(res => { |
| | | const data = res.data; |
| | | if (data.error_description) { |
| | | Message({ |
| | | message: data.error_description, |
| | | type: 'error' |
| | | }) |
| | | } else { |
| | | store.commit('SET_TOKEN', data.access_token); |
| | | store.commit('SET_REFRESH_TOKEN', data.refresh_token); |
| | | store.commit('SET_TENANT_ID', data.tenant_id); |
| | | store.commit('SET_USER_INFO', data); |
| | | store.commit('DEL_ALL_TAG'); |
| | | store.commit('CLEAR_LOCK'); |
| | | } |
| | | }) |
| | | return true; |
| | | } else { |
| | | // console.log("手动登入main不是JSON对象"); |
| | | return false; |
| | | } |
| | | |
| | | } else { |
| | | next('/login'); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | next('/login'); |
| | | } |
| | | } |
| | | }) |
| | |
| | | LoginByUsername({commit}, userInfo) { |
| | | return new Promise((resolve, reject) => { |
| | | loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => { |
| | | console.log(res, 'res'); |
| | | const data = res.data; |
| | | console.log(data, 'data'); |
| | | if (data.error_description) { |
| | | Message({ |
| | | message: data.error_description, |
| | |
| | | commit('SET_USER_INFO', data); |
| | | commit('DEL_ALL_TAG'); |
| | | commit('CLEAR_LOCK'); |
| | | console.log(data.access_token, data.refresh_toke, data.tenant_id, data, 'usedatas'); |
| | | } |
| | | resolve(); |
| | | }).catch(error => { |
| | |
| | | proxy: { |
| | | '/api': { |
| | | //本地服务接口地址 |
| | | // target: 'http://192.168.0.104', |
| | | // target: 'http://192.168.0.109:1', |
| | | //远程演示服务地址,可用于直接启动项目 |
| | | target: 'http://2h3f861221.wicp.vip:58646', |
| | | ws: true, |