上一篇文章中Salesforce学习 Mobile(一)Publisher for Community Cloud,我们利用【Publisher Playground】进行手机端登录验证,在VisualforcePage中有下边一段关于是否是【Publisher】的判断,如果不是【Publisher Playground】登录的情况下,应该跳转到一个error画面,今天来完善一下这个功能。
if(this.deviceWrapper.appType == 'Publisher') {
destinationURL += 'TopPageMobile';
return Auth.SessionManagement.finishLoginFlow(destinationURL);
} else {
// TODO
destinationURL += 'XXXXXXX';
return Auth.SessionManagement.finishLoginFlow(destinationURL);
}
otherApplicationMobileLoginError.html
<template>
<div class="slds-text-align--center" style="margin-top: 150px;height: 400px;">
<p class="character_font">【登录错误】</p>
<p>请使用Publisher Playground重新登录</p>
<br />
<br />
<lightning-button label="前画面返回" name="cancle" onclick={handleButton} class="slds-m-left_x-small"></lightning-button>
</div>
</template>
otherApplicationMobileLoginError.js
import { LightningElement } from 'lwc';
export default class OtherApplicationMobileLoginError extends LightningElement {
handleButton() {
window.history.back();
return false;
}
}
把做成的Lwc拖到这个CommunityPage上
if(this.deviceWrapper.appType == 'Publisher') {
destinationURL += 'TopPageMobile';
return Auth.SessionManagement.finishLoginFlow(destinationURL);
} else {
destinationURL += 'TopPageMobileOtherAppLoginError';
return Auth.SessionManagement.finishLoginFlow(destinationURL);
}
使用手机浏览器登录↓↓↓
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。