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 router from './router/router' |
| | | import store from './store' |
| | | import md5 from 'js-md5' |
| | | import request from '@/router/axios'; |
| | | import {validatenull} from '@/util/validate' |
| | | import {getToken} from '@/util/auth' |
| | | import NProgress from 'nprogress' // progress bar |
| | | import 'nprogress/nprogress.css' // progress bar style |
| | | import cons from 'consolidate'; |
| | | NProgress.configure({showSpinner: false}); |
| | | const lockPage = store.getters.website.lockPage; //锁屏页 |
| | | router.beforeEach((to, from, next) => { |
| | |
| | | if (meta.isAuth === false) { |
| | | next() |
| | | } else { |
| | | next('/login') |
| | | console.log(to, from); |
| | | next(); |
| | | if (to.path == '/wel') { |
| | | var a = to.query.main; |
| | | if (typeof a == "string") { |
| | | console.log(to.query.main, 'main'); |
| | | 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: '/api/blade-auth/oauth/token', |
| | | // method: 'post', |
| | | // headers: { |
| | | // 'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0', |
| | | // "Tenant-Id": "000000" |
| | | // }, |
| | | // params: data |
| | | // }).then(res => { |
| | | // console.log(res, 'res') |
| | | // }) |
| | | // this.loginForm.username = obj.data.rese; |
| | | // this.loginForm.password = obj.data.admin; |
| | | // this.loginForm.tenantId = obj.data.dip; |
| | | // console.log(this.loginForm1·); |
| | | // const loading = this.$loading({ |
| | | // lock: true, |
| | | // text: "登录中,请稍后。。。", |
| | | // spinner: "el-icon-loading", |
| | | // }); |
| | | // this.$store |
| | | // .dispatch("LoginByUsername", data) |
| | | // .then(() => { |
| | | // this.$router.push({ path: "/wel" }); |
| | | // loading.close(); |
| | | // }) |
| | | // .catch(() => { |
| | | // loading.close(); |
| | | // this.refreshCode(); |
| | | // }); |
| | | |
| | | return true; |
| | | } else { |
| | | console.log("手动登入main不是JSON对象"); |
| | | return false; |
| | | } |
| | | |
| | | } else { |
| | | next('/login'); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | next('/login'); |
| | | } |
| | | } |
| | | }) |
| | |
| | | return new Promise((resolve, reject) => { |
| | | loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => { |
| | | const data = res.data; |
| | | console.log(data, '获取到token'); |
| | | if (data.error_description) { |
| | | Message({ |
| | | message: data.error_description, |
| | |
| | | '/api': { |
| | | //本地服务接口地址 |
| | | // target: 'http://192.168.0.104', |
| | | target: 'http://192.168.109:80', |
| | | //远程演示服务地址,可用于直接启动项目 |
| | | target: 'http://2h3f861221.wicp.vip:58646', |
| | | // target: 'http://2h3f861221.wicp.vip:58646', |
| | | ws: true, |
| | | pathRewrite: { |
| | | '^/api': '/' |