修改页面
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<view>
|
||||
<web-view style="background-color: #fafafa;height: 100vh;" ref="webview" :src="webUrl"></web-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { request,showToast } from '@/api/apiT.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
webUrl:''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
this.feishugetAuth()
|
||||
if(options.code){
|
||||
request({
|
||||
url:'feishu/getAuth',
|
||||
method:'post',
|
||||
data:{
|
||||
code:options.code
|
||||
}
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});
|
||||
if(res.data.code ==0){
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/index/mine',// 替换为你要跳转的页面路径
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
feishugetAuth(){
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const route = currentPage.route; // 页面路径
|
||||
const options = currentPage.options; // 页面参数
|
||||
const fullUrl = `${route}?${Object.keys(options).map(key => `${key}=${options[key]}`).join('&')}`;
|
||||
console.log('当前页面完整 URL:', fullUrl);
|
||||
request({
|
||||
url:'feishu/getinfo',
|
||||
method:'post',
|
||||
}).then(res => {
|
||||
var data = res.data.data;
|
||||
var urls = data.url+fullUrl
|
||||
console.log(data)
|
||||
this.webUrl = 'https://open.feishu.cn/open-apis/authen/v1/authorize?app_id='+data.app_id+'&redirect_uri='+urls+'&scope='+data.scope+'&state='+data.state
|
||||
console.log(this.webUrl)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user