first commit

This commit is contained in:
Mauve
2026-09-08 17:20:27 +08:00
commit a7f2e0ca01
752 changed files with 111259 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
<template>
<view class="container">
<web-view :src="url"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
//url:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=code&client_id=b4ba794c-cd0d-4033-924e-ace80b93d045&redirect_uri=https://hostcrmapp.mgm.mo/sso_callback/login&scope=openid%20profile%20email&response_mode=query",
//url:"https://adserver.willtechmacau.com/adfs/ls/?wa=wsignout1.0&wtrealm=hostcrmapp&wreply=https://hostcrmapp.mgm.mo/sso_callback/logout",
url:"https://adfs.mgm.mo/adfs/ls/?wa=wsignout1.0&wtrealm=mgm_mobilecrm_app&wreply=https://hostcrmapp.mgm.mo/sso_callback/logout",
//url:"",
intervalId:null,
newUrl:'',
siteData:null
}
},
onLoad(options) {
if (options && options.url) {
this.url = options.url;
}
this.listenUrl()
},
onShow() {
//console.log("azureLogin.vue:onShow()");
/*setTimeout(()=> {
this.checkArguments();
}, 10000);*/
this.siteData = uni.getStorageSync("siteData");
},
methods: {
listenUrl() {
var that = this;
var count = 0;
this.intervalId = setInterval(() => {
var currentUrl = that.getCurrentUrl();
that.newUrl = currentUrl;
//var code = that.getCurrentQueryString(currentUrl, 'SAMLResponse');
//uni.$u.toast(that.newUrl,10000);
//console.log('获取到的code:', code)
if(currentUrl.indexOf('/logout')!=-1){
clearInterval(that.intervalId);
//uni.removeStorageSync("adfs_cookie");
uni.removeStorageSync("userData");
uni.removeStorageSync("token");
uni.removeStorageSync("idToken");
uni.removeStorageSync("clientId");
uni.redirectTo({
url:'/pages/login/login'
});
}
}, 1000);
},
getCurrentQueryString(url, name) {
var queryString = url.substring(url.indexOf('?'));
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = queryString.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
},
getCurrentUrl(){
var pages = getCurrentPages();
var page = pages[pages.length - 1];
var currentWebview = page.$getAppWebview();
var url = currentWebview.children()[0].getURL();
console.log("=======当前地址======", url);
return url;
}
}
}
</script>
<style>
</style>