Commit dd6a90e2 by xiexiaoqin
parents 286393b2 38cb4896
...@@ -201,19 +201,11 @@ export function getOutlookUrl(data) { ...@@ -201,19 +201,11 @@ export function getOutlookUrl(data) {
method: "POST", method: "POST",
data: "", data: "",
url: `/microsoft/getThirdLoginUrl?state=${data}`, url: `/microsoft/getThirdLoginUrl?state=${data}`,
type: 'binding' type: "binding"
}); });
} }
// 发送给后端outlook code
export function authorizationCodeReplacementToken(data) { // 获取绑定的app
return $http({
method: "get",
data: data,
url: `/microsoft/authorizationCodeReplacementToken`,
type: 'binding'
});
}
// 发送给后端outlook code
export function getThirdUserPlatForm(data) { export function getThirdUserPlatForm(data) {
return $http({ return $http({
method: "get", method: "get",
...@@ -235,17 +227,7 @@ export function getZoomUrl(data) { ...@@ -235,17 +227,7 @@ export function getZoomUrl(data) {
return $http({ return $http({
method: "get", method: "get",
data: "", data: "",
url: "/zoom/auth", url: `/zoom/auth?orgId=${data.orgId}&userId=${data.userId}`,
type: 'binding' type: "binding"
});
}
//
export function sendZoomCode(data) {
return $http({
method: "get",
data: data,
url: "/zoom/notice",
type: 'binding'
}); });
} }
...@@ -2,7 +2,7 @@ import { setGlobalStore } from "dd-store"; ...@@ -2,7 +2,7 @@ import { setGlobalStore } from "dd-store";
import exampleStore from "./stores/exampleStore"; import exampleStore from "./stores/exampleStore";
import { checkFullScren } from "./utils/checkFullScren"; import { checkFullScren } from "./utils/checkFullScren";
setGlobalStore(exampleStore); setGlobalStore(exampleStore);
import login from './api/login'; import login from "./api/login";
App({ App({
onLaunch(options) { onLaunch(options) {
......
.relatedAppPage {
height: 100vh;
background: #FFFFFF;
}
.platformMsg {
display: flex;
padding: 34rpx 32rpx;
align-items: center;
}
.platformImg {
width: 60rpx;
height: 60rpx;
margin-right: 24rpx;
}
.outlook {
background: url(../../assests/outlookLogo.png) center /100% 100%;
}
.zoom {
background: url(../../assests/zoomLogo.png) center /100% 100%;
}
.unBinding {
width: 686rpx;
height: 96rpx;
margin: 22rpx auto;
border-radius: 48rpx;
border: 2rpx solid rgba(222, 222, 222, 1);
text-align: center;
line-height: 0.96rem;
font-size: 34rpx;
color: rgba(242, 86, 67, 1);
}
\ No newline at end of file
<web-view id="web-view-1" src="{{url}}" onMessage="test"> <view class="relatedAppPage">
</web-view> <view class="platformMsg" a:if="{{platform === 'outlook'}}">
\ No newline at end of file <view class="platformImg {{platform}}">
</view>
<view class="platformName">
{{appName}}
</view>
</view>
<view class="platformMsg" a:if="{{platform === 'zoom'}}">
<view class="platformImg {{platform}}">
</view>
<view class="platformName">
{{zoom}}
</view>
</view>
<view class="unBinding" onTap="bindApp">
关联{{platform}}
</view>
</view>
<selectpopup showSelectPopup="{{showSelectPopup}}" selectPopupList="{{selectPopupList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
\ No newline at end of file
import { import {
getOutlookUrl, getOutlookUrl,
getZoomUrl, getZoomUrl,
authorizationCodeReplacementToken,
sendZoomCode,
getThirdUserPlatForm getThirdUserPlatForm
} from "../../api/request"; } from "../../api/request";
import "dingtalk-jsapi/entry/mobile"; import "dingtalk-jsapi/entry/mobile";
...@@ -12,27 +10,14 @@ create.Page({ ...@@ -12,27 +10,14 @@ create.Page({
data: { data: {
$data: null, $data: null,
url: "", url: "",
platform: "" platform: "",
appName: ""
}, },
onLoad(e) { onLoad(e) {
this.setData({ this.setData({
platform: e.platform platform: e.platform,
appName: e.platform
}); });
this.webViewContext = dd.createWebViewContext("web-view-1");
if (e.platform === "outlook") {
let data = `${getApp().globalData.userid},${dd.corpId}`;
getOutlookUrl(data).then(res => {
openLink({
url: res.data.data
});
});
} else if (e.platform === "zoom") {
getZoomUrl("").then(res => {
this.setData({
url: res.data.data
});
});
}
}, },
onShow() { onShow() {
const interval = setInterval(() => { const interval = setInterval(() => {
...@@ -54,43 +39,23 @@ create.Page({ ...@@ -54,43 +39,23 @@ create.Page({
}); });
}, 1000); }, 1000);
}, },
test(e) { bindApp() {
const code = e.detail.code;
const state = e.detail.state;
if (this.data.platform === "outlook") { if (this.data.platform === "outlook") {
const data = { let data = `${getApp().globalData.userid},${dd.corpId}`;
code: code, getOutlookUrl(data).then(res => {
state: state openLink({
}; url: res.data.data
authorizationCodeReplacementToken(data).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = {
name: res.data.data,
platform: this.data.platform
};
this.update();
dd.navigateBack({
delta: 1
}); });
}
}); });
} else if (this.data.platform === "zoom") { } else if (this.data.platform === "zoom") {
const data = { let data = {
code: code,
userId: getApp().globalData.userid, userId: getApp().globalData.userid,
orgId: dd.corpId orgId: dd.corpId
}; };
sendZoomCode(data).then(res => { getZoomUrl(data).then(res => {
if (res.data.data) { openLink({
this.$store.data.relatedAppNeedUpdate = { url: res.data.data
name: res.data.data,
platform: this.data.platform
};
this.update();
dd.navigateBack({
delta: 1
}); });
}
}); });
} }
} }
......
{} {
\ No newline at end of file "usingComponents": {
"selectpopup": "../../components/selectPopup/selectPopup"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment