前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Salesforce学习 Mobile(二)Publisher for Community Cloud

Salesforce学习 Mobile(二)Publisher for Community Cloud

原创
作者头像
repick
修改2021-03-22 14:23:01
3860
修改2021-03-22 14:23:01
举报
文章被收录于专栏:Salesforce

上一篇文章中Salesforce学习 Mobile(一)Publisher for Community Cloud,我们利用【Publisher Playground】进行手机端登录验证,在VisualforcePage中有下边一段关于是否是【Publisher】的判断,如果不是【Publisher Playground】登录的情况下,应该跳转到一个error画面,今天来完善一下这个功能。

代码语言:javascript
复制
if(this.deviceWrapper.appType == 'Publisher') {
    destinationURL += 'TopPageMobile';
    return Auth.SessionManagement.finishLoginFlow(destinationURL);
} else {
    // TODO
    destinationURL += 'XXXXXXX';
    return Auth.SessionManagement.finishLoginFlow(destinationURL);
}

1.显示用Lwc做成

otherApplicationMobileLoginError.html

代码语言:javascript
复制
<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

代码语言:javascript
复制
import { LightningElement } from 'lwc';

export default class OtherApplicationMobileLoginError extends LightningElement {
    handleButton() {
        window.history.back();
        return false;
    }
}

2.CommunityPage做成

把做成的Lwc拖到这个CommunityPage上

3.跳转逻辑改修

代码语言:javascript
复制
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 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.显示用Lwc做成
  • 2.CommunityPage做成
  • 3.跳转逻辑改修
  • 效果展示:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档