Commit d7616288 by liang ce

调试zoom流程

parent 353d6790
......@@ -201,19 +201,11 @@ export function getOutlookUrl(data) {
method: "POST",
data: "",
url: `/microsoft/getThirdLoginUrl?state=${data}`,
type: 'binding'
type: "binding"
});
}
// 发送给后端outlook code
export function authorizationCodeReplacementToken(data) {
return $http({
method: "get",
data: data,
url: `/microsoft/authorizationCodeReplacementToken`,
type: 'binding'
});
}
// 发送给后端outlook code
// 获取绑定的app
export function getThirdUserPlatForm(data) {
return $http({
method: "get",
......@@ -235,17 +227,7 @@ export function getZoomUrl(data) {
return $http({
method: "get",
data: "",
url: "/zoom/auth",
type: 'binding'
});
}
//
export function sendZoomCode(data) {
return $http({
method: "get",
data: data,
url: "/zoom/notice",
type: 'binding'
url: `/zoom/auth?orgId=${data.orgId}&userId=${data.userId}`,
type: "binding"
});
}
......@@ -2,7 +2,7 @@ import { setGlobalStore } from "dd-store";
import exampleStore from "./stores/exampleStore";
import { checkFullScren } from "./utils/checkFullScren";
setGlobalStore(exampleStore);
import login from './api/login';
import login from "./api/login";
App({
onLaunch(options) {
......@@ -23,9 +23,9 @@ App({
userid: "",
name: "",
userInfo: "",
// globalUrl: "https://gateway-beta.mingwork.com", //beta地址
// globalUrl2: "https://third-authentication-beta.mingwork.com"
globalUrl: "https://gateway2.mingwork.com", // 线上地址
globalUrl2: "https://third-authentication.mingwork.com" //线上地址
globalUrl: "https://gateway-beta.mingwork.com", //beta地址
globalUrl2: "https://third-authentication-beta.mingwork.com"
// globalUrl: "https://gateway2.mingwork.com", // 线上地址
// globalUrl2: "https://third-authentication.mingwork.com" //线上地址
}
});
.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">
</web-view>
\ No newline at end of file
<view class="relatedAppPage">
<view class="platformMsg" a:if="{{platform === 'outlook'}}">
<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 {
getOutlookUrl,
getZoomUrl,
authorizationCodeReplacementToken,
sendZoomCode,
getThirdUserPlatForm
} from "../../api/request";
import "dingtalk-jsapi/entry/mobile";
......@@ -12,27 +10,14 @@ create.Page({
data: {
$data: null,
url: "",
platform: ""
platform: "",
appName: ""
},
onLoad(e) {
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() {
const interval = setInterval(() => {
......@@ -54,43 +39,23 @@ create.Page({
});
}, 1000);
},
test(e) {
const code = e.detail.code;
const state = e.detail.state;
bindApp() {
if (this.data.platform === "outlook") {
const data = {
code: code,
state: state
};
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
let data = `${getApp().globalData.userid},${dd.corpId}`;
getOutlookUrl(data).then(res => {
openLink({
url: res.data.data
});
}
});
} else if (this.data.platform === "zoom") {
const data = {
code: code,
let data = {
userId: getApp().globalData.userid,
orgId: dd.corpId
};
sendZoomCode(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
getZoomUrl(data).then(res => {
openLink({
url: res.data.data
});
}
});
}
}
......
{}
\ 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