调整第三方登录逻辑

This commit is contained in:
wushaocheng
2022-09-27 18:40:48 +08:00
parent e5b4b11cbb
commit f66e5cbfc2
24 changed files with 98 additions and 206 deletions

View File

@@ -11,7 +11,7 @@ public class XChatConstants {
/**
* 包名(各种缓存目录的根目录)
*/
public static final String XCHAT_DIR_NAME = "com.mango.yinyou";
public static final String XCHAT_DIR_NAME = "com.mango.peko";
/**
* sp名字
@@ -138,7 +138,7 @@ public class XChatConstants {
/**
* 分享房间 URL
*/
public static final String SHARE_ROOM_URL = "/yinyou/modules/share_room/index.html?shareUid=";
public static final String SHARE_ROOM_URL = "/peko/modules/share_room/index.html?shareUid=";
/**
* 分享家族文本
@@ -153,7 +153,7 @@ public class XChatConstants {
/**
* 分享家族 URL
*/
public static final String SHARE_FAMILY_URL = "/yinyou/modules/share/share_family.html";
public static final String SHARE_FAMILY_URL = "/peko/modules/share/share_family.html";
/**
* 分享群组文本
@@ -168,17 +168,17 @@ public class XChatConstants {
/**
* 分享群组 URL
*/
public static final String SHARE_TEAM_URL = "/yinyou/modules/share/share_family.html";
public static final String SHARE_TEAM_URL = "/peko/modules/share/share_family.html";
/**
* 分享群组 URL
*/
public static final String SHARE_WORLD_DYNAMIC_URL = "/yinyou/modules/world/share-page/index.html";
public static final String SHARE_WORLD_DYNAMIC_URL = "/peko/modules/world/share-page/index.html";
/**
* 游戏排行榜 URL
*/
public static final String GAME_ROOK = "/yinyou/modules/erbanRank/game_rank.html?type=week";
public static final String GAME_ROOK = "/peko/modules/erbanRank/game_rank.html?type=week";
/**
* 系统消息那个用户的UID
@@ -200,7 +200,7 @@ public class XChatConstants {
/**
* 登录页面「如何登录」对应的 H5 页面
*/
public static final String LOGIN_ERBAN_ACCOUNT_URL = "/yinyou/modules/rule/login_tips.html";
public static final String LOGIN_ERBAN_ACCOUNT_URL = "/peko/modules/rule/login_tips.html";
public static final String ROOM_INTRODUCTION = "可点击房间话题查看本房间公告";
public static final String DATING_TIPS_OPEN = "相亲玩法已开启,请点击主持人麦位选择主持人";
@@ -242,13 +242,13 @@ public class XChatConstants {
/**
* Referer (DEBUG)
*/
public static final String KEY_REFERER_DEBUG = "http://api.uat.lecheng163.com/";
public static final String KEY_REFERER_DEBUG = "https://beta.api.pekolive.com/";
/**
* Referer (RELEASE)
*/
public static final String KEY_REFERER_RELEASE = "https://api.lecheng163.com/";
public static final String APP_MARK = "yinyou";
public static final String APP_MARK = "peko";
/**
* 聊天室文本消息易盾反垃圾业务id
*/

View File

@@ -59,42 +59,42 @@ public class UriProvider {
* @return -
*/
public static String getRoomBg() {
return IM_SERVER_URL.concat("/yinyou/modules/noble/roomBgList.html");
return IM_SERVER_URL.concat("/peko/modules/noble/roomBgList.html");
}
/**
* 贵族介绍页
*/
public static String getNobleIntro() {
return IM_SERVER_URL.concat("/yinyou/modules/nobles/intro.html");
return IM_SERVER_URL.concat("/peko/modules/nobles/intro.html");
}
/**
* 贵族介绍页
*/
public static String getRanking() {
return IM_SERVER_URL.concat("/yinyou/modules/rank/index.html#/rank");
return IM_SERVER_URL.concat("/peko/modules/rank/index.html#/rank");
}
/**
* 帮助页
*/
public static String getHelp() {
return IM_SERVER_URL.concat("/yinyou/modules/rule/guide.html");
return IM_SERVER_URL.concat("/peko/modules/rule/guide.html");
}
/**
* 等级界面
*/
public static String getUserLevelUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/level/index.html");
return JAVA_WEB_URL.concat("/peko/modules/level/index.html");
}
/**
* 邀请好友
*/
public static String getShareUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/inviteCode/index.html");
return JAVA_WEB_URL.concat("/peko/modules/inviteCode/index.html");
}
@@ -102,7 +102,7 @@ public class UriProvider {
* 等级界面
*/
public static String getUserCharmLevelUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/charm/index.html");
return JAVA_WEB_URL.concat("/peko/modules/charm/index.html");
}
@@ -112,7 +112,7 @@ public class UriProvider {
* @return
*/
public static String getErbanTopMessageUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/headNews/index.html");
return JAVA_WEB_URL.concat("/peko/modules/headNews/index.html");
}
/**
@@ -121,7 +121,7 @@ public class UriProvider {
* @return
*/
public static String getRelatedToMeHeadLineUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/headNews/index.html?atMe=1");
return JAVA_WEB_URL.concat("/peko/modules/headNews/index.html?atMe=1");
}
/**
@@ -130,7 +130,7 @@ public class UriProvider {
* @return
*/
public static String getCreateFamilyUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/family/create.html");
return JAVA_WEB_URL.concat("/peko/modules/family/create.html");
}
/**
@@ -139,7 +139,7 @@ public class UriProvider {
* @return
*/
public static String getFamilyInstructionUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/family/handbook.html");
return JAVA_WEB_URL.concat("/peko/modules/family/handbook.html");
}
/**
@@ -148,7 +148,7 @@ public class UriProvider {
* @return
*/
public static String getFamilyCurrencyHelpUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/family/faq.html");
return JAVA_WEB_URL.concat("/peko/modules/family/faq.html");
}
/**
@@ -157,7 +157,7 @@ public class UriProvider {
* @return
*/
public static String getReportWallUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/inform/inform-list.html");
return JAVA_WEB_URL.concat("/peko/modules/inform/inform-list.html");
}
/**
@@ -166,7 +166,7 @@ public class UriProvider {
* @return
*/
public static String getPublicChatHallHelpUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/inform/help.html");
return JAVA_WEB_URL.concat("/peko/modules/inform/help.html");
}
/**
@@ -175,7 +175,7 @@ public class UriProvider {
* @return
*/
public static String getUserProtocolUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/protocol.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/protocol.html");
}
/**
@@ -184,14 +184,14 @@ public class UriProvider {
* @return
*/
public static String getUserReportUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/inform/index.html");
return JAVA_WEB_URL.concat("/peko/modules/inform/index.html");
}
/**
* 话题-说明
*/
public static String getMiniWorldRuleUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/world-rule/index.html");
return JAVA_WEB_URL.concat("/peko/modules/world-rule/index.html");
}
/**
@@ -200,7 +200,7 @@ public class UriProvider {
* @return
*/
public static String getTutuRealNamePage() {
return JAVA_WEB_URL.concat("/yinyou/modules/identity/new.html");
return JAVA_WEB_URL.concat("/peko/modules/identity/new.html");
}
/**
@@ -209,7 +209,7 @@ public class UriProvider {
* @return
*/
public static String getMyIncomeUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/myincome/index.html#/MyIncome");
return JAVA_WEB_URL.concat("/peko/modules/myincome/index.html#/MyIncome");
}
/**
@@ -218,7 +218,7 @@ public class UriProvider {
* @return
*/
public static String getRechargeAgreementUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/rechargeAgreement.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/rechargeAgreement.html");
}
/**
@@ -227,7 +227,7 @@ public class UriProvider {
* @return
*/
public static String getMentoringRelationshipGuide() {
return JAVA_WEB_URL.concat("/yinyou/modules/strategy/strategy.html");
return JAVA_WEB_URL.concat("/peko/modules/strategy/strategy.html");
}
/**
@@ -236,11 +236,11 @@ public class UriProvider {
* @return
*/
public static String getMentorRankingList() {
return JAVA_WEB_URL.concat("/yinyou/modules/strategy/teacher-list.html");
return JAVA_WEB_URL.concat("/peko/modules/strategy/teacher-list.html");
}
public static String getCommnunityNorms() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/community-norms.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/community-norms.html");
}
/**
@@ -249,7 +249,7 @@ public class UriProvider {
* @return
*/
public static String getPrivacyAgreement() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/privacy-wap.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/privacy-wap.html");
}
public static String getLinkUrl(String linkUrl) {
@@ -263,28 +263,28 @@ public class UriProvider {
* 个人魅力榜
*/
public static String getPersonalCharismaRank() {
return JAVA_WEB_URL.concat("/yinyou/modules/charm/index.html");
return JAVA_WEB_URL.concat("/peko/modules/charm/index.html");
}
/**
* 宝箱帮助
*/
public static String getBoxHelp() {
return JAVA_WEB_URL.concat("/yinyou/modules/rank/index.html#/wishingWellRule");
return JAVA_WEB_URL.concat("/peko/modules/rank/index.html#/wishingWellRule");
}
/**
* 宝箱记录
*/
public static String getBoxHistory() {
return JAVA_WEB_URL.concat("/yinyou/modules/rank/index.html#/wishingWellRecord");
return JAVA_WEB_URL.concat("/peko/modules/rank/index.html#/wishingWellRecord");
}
/**
* 获取宝箱钥匙
*/
public static String getBoxKey() {
return JAVA_WEB_URL.concat("/yinyou/activity/explore/index.html");
return JAVA_WEB_URL.concat("/peko/activity/explore/index.html");
}
/**
@@ -293,7 +293,7 @@ public class UriProvider {
* @return
*/
public static String getRedPacketRule() {
return JAVA_WEB_URL.concat("yinyou/modules/rule/red-packet-rule.html");
return JAVA_WEB_URL.concat("peko/modules/rule/red-packet-rule.html");
}
@@ -303,7 +303,7 @@ public class UriProvider {
* @return
*/
public static String getDatingRule() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/dating.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/dating.html");
}
/**
@@ -312,7 +312,7 @@ public class UriProvider {
* @return
*/
public static String getGameShareUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/game/index.html");
return JAVA_WEB_URL.concat("/peko/modules/game/index.html");
}
/**
@@ -321,7 +321,7 @@ public class UriProvider {
* @return
*/
public static String getLinkAccountUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/game/bindAccount.html");
return JAVA_WEB_URL.concat("/peko/modules/game/bindAccount.html");
}
/**
@@ -330,7 +330,7 @@ public class UriProvider {
* @return
*/
public static String getLinkRoomUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/associateAccount/index.html");
return JAVA_WEB_URL.concat("/peko/modules/associateAccount/index.html");
}
@@ -338,7 +338,7 @@ public class UriProvider {
* 房间排行榜
*/
public static String getRoomRanking() {
return IM_SERVER_URL.concat("/yinyou/modules/room_rank/index.html?roomUid=" + AvRoomDataManager.get().getRoomUid());
return IM_SERVER_URL.concat("/peko/modules/room_rank/index.html?roomUid=" + AvRoomDataManager.get().getRoomUid());
}
/**
@@ -347,7 +347,7 @@ public class UriProvider {
* @return
*/
public static String getSDKPermissionUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/sdk.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/sdk.html");
}
/**
@@ -356,112 +356,112 @@ public class UriProvider {
* @return
*/
public static String getDeivcePermissionUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/permissions.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/permissions.html");
}
/**
* 隐私协议-个人信息
*/
public static String getPersonalInfoUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/personal-info.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/personal-info.html");
}
/**
* 隐私指引
*/
public static String getPrivacyUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/privacy-wap.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/privacy-wap.html");
}
/**
* 贵族中心帮助页
*/
public static String getVipHelpUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/introduction-patrician.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/introduction-patrician.html");
}
/**
* Cp装扮
*/
public static String getCpDecorationUrl() {
return JAVA_WEB_URL.concat("/yinyou/activity/act-nameplate-cp/index.html");
return JAVA_WEB_URL.concat("/peko/activity/act-nameplate-cp/index.html");
}
/**
* 用户充值协议
*/
public static String getChargeAgreementUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/rechargeAgreement.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/rechargeAgreement.html");
}
/**
* 用户注册服务协议
*/
public static String getRegistrationAgreementUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/protocol.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/protocol.html");
}
/**
* 直播服务协议
*/
public static String getLiveServiceAgreementUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/live-protocol.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/live-protocol.html");
}
/**
* 社区规范
*/
public static String getCommunitySpecificationUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/community-norms.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/community-norms.html");
}
/**
* 账号注销协议
*/
public static String getCancellationAgreementUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/logout-agreement.html");
return JAVA_WEB_URL.concat("/peko/modules/rule/logout-agreement.html");
}
/**
* 开通粉丝团
*/
public static String getFansTeamOpenUrl(long roomUid) {
return JAVA_WEB_URL.concat("/yinyou/modules/fans_club/nameplate.html?roomUid=" + roomUid);
return JAVA_WEB_URL.concat("/peko/modules/fans_club/nameplate.html?roomUid=" + roomUid);
}
/**
* 粉丝团排行
*/
public static String getFansTeamRankUrl(long roomUid) {
return JAVA_WEB_URL.concat("/yinyou/modules/fans_club/fans_rank.html?roomUid=" + roomUid);
return JAVA_WEB_URL.concat("/peko/modules/fans_club/fans_rank.html?roomUid=" + roomUid);
}
/**
* 我的粉丝团
*/
public static String getFansTeamMyFansUrl(long roomUid) {
return JAVA_WEB_URL.concat("/yinyou/modules/fans_club/myfans.html?roomUid=" + roomUid);
return JAVA_WEB_URL.concat("/peko/modules/fans_club/myfans.html?roomUid=" + roomUid);
}
/**
* 粉丝团规则
*/
public static String getFansTeamRuleUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/fans_club/rule.html");
return JAVA_WEB_URL.concat("/peko/modules/fans_club/rule.html");
}
/**
* 个播小时榜
*/
public static String getSingleRoomHourRankUrl(long roomUid) {
return JAVA_WEB_URL.concat("/yinyou/modules/room_rank/hourRank.html?roomUid=" + roomUid);
return JAVA_WEB_URL.concat("/peko/modules/room_rank/hourRank.html?roomUid=" + roomUid);
}
/**
* 牌照房小时榜
*/
public static String getRoomHourRankUrl(long roomUid) {
return JAVA_WEB_URL.concat("/yinyou/modules/room_rank/hourRankLicense.html?roomUid=" + roomUid);
return JAVA_WEB_URL.concat("/peko/modules/room_rank/hourRankLicense.html?roomUid=" + roomUid);
}
@@ -469,14 +469,14 @@ public class UriProvider {
* 周星榜
*/
public static String getWeekStarUrl() {
return JAVA_WEB_URL.concat("/yinyou/modules/weekStar/newWeekStar.html");
return JAVA_WEB_URL.concat("/peko/modules/weekStar/newWeekStar.html");
}
/**
* 幸运礼物说明
*/
public static String getLuckyGiftRule(int giftID) {
return JAVA_WEB_URL.concat("/yinyou/modules/rule/luckyGiftRule.html?giftID=" + giftID);
return JAVA_WEB_URL.concat("/peko/modules/rule/luckyGiftRule.html?giftID=" + giftID);
}
/**
@@ -485,28 +485,28 @@ public class UriProvider {
* @return
*/
public static String getLiveAgreement() {
return JAVA_WEB_URL.concat("/yinyou/activity/activemodel/index.html?code=ZBGG");
return JAVA_WEB_URL.concat("/peko/activity/activemodel/index.html?code=ZBGG");
}
/**
* 航海帮助
*/
public static String getRadishHelp() {
return JAVA_WEB_URL.concat("/yinyou/activity/act-sail/play_explain.html");
return JAVA_WEB_URL.concat("/peko/activity/act-sail/play_explain.html");
}
/**
* 航海记录
*/
public static String getRadishHistory() {
return JAVA_WEB_URL.concat("/yinyou/activity/act-sail/win_record.html");
return JAVA_WEB_URL.concat("/peko/activity/act-sail/win_record.html");
}
/**
* 获取航海钥匙
*/
public static String getRadishKey() {
return JAVA_WEB_URL.concat("/yinyou/activity/act-sail/more.html");
return JAVA_WEB_URL.concat("/peko/activity/act-sail/more.html");
}
}

View File

@@ -113,9 +113,9 @@ public class AuthModel extends BaseModel implements IAuthModel {
*/
private static final int TYPE_LOGIN_NORMAL = 1;
private static final int TYPE_LOGIN_BIND_QQ = 2;
public static final int TYPE_GOOGLE_LOGIN = 5;
public static final int TYPE_LINE_LOGIN = 6;
public static final int TYPE_FACEBOOK_LOGIN = 7;
public static final int TYPE_GOOGLE_LOGIN = 8;
public static final int TYPE_LINE_LOGIN = 9;
public static final int TYPE_FACEBOOK_LOGIN = 10;
/**
* 校验验证码
*/
@@ -328,7 +328,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
}
/**
* 微信登录
* facebook登录
*
* @return
*/
@@ -375,7 +375,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
})
.flatMap(platform -> {
String openid = platform.getDb().getUserId();
String unionid = platform.getDb().get("unionid");
String unionid = platform.getDb().getUserId();
String avatar = thirdUserInfo.getUserIcon();
if (avatar != null && avatar.equals("null")) {
avatar = null;
@@ -395,7 +395,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
}
/**
* QQ登录
* line
*
* @return
*/
@@ -417,7 +417,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
if (i == Platform.ACTION_USER_INFOR) {
String openid = platform.getDb().getUserId();
String unionid = platform.getDb().get("unionid");
String unionid = platform.getDb().getUserId();
Logger.i("openid:" + openid + " unionid:" + unionid + platform.getDb().getUserIcon());
thirdUserInfo = new ThirdUserInfo();
@@ -487,7 +487,7 @@ public class AuthModel extends BaseModel implements IAuthModel {
public void onComplete(Platform platform, int i, HashMap<String, Object> hashMap) {
if (i == Platform.ACTION_USER_INFOR) {
String openid = platform.getDb().getUserId();
String unionid = platform.getDb().get("unionid");
String unionid = platform.getDb().getUserId();
Logger.i("openid:" + openid + " unionid:" + unionid + platform.getDb().getUserIcon());
thirdUserInfo = new ThirdUserInfo();

View File

@@ -149,12 +149,6 @@ public final class UserModel extends BaseModel implements IUserModel {
UserInfo userInfo = userResult.getData();
//用户信息不全的情况下,currentUserInfo并不会被保存,这里单独保存下预填写的邀请码...
preFillInviteCode = userInfo.getPrefillInviteCode();
//如果没有绑定手机号,提醒去绑定手机号
if (userInfo.getDefUser() != 4 && !userInfo.isBindPhone()) {
EventBus.getDefault().post(new NeedBindPhoneEvent());
SingleToastUtil.showToast("第三方登录需绑定手机号喔~");
return Single.error(new Throwable("need bind phone"));
}
//首次注册需要完善昵称和头像
if (TextUtils.isEmpty(userInfo.getNick()) || TextUtils.isEmpty(userInfo.getAvatar())) {
EventBus.getDefault().post(new NeedCompleteInfoEvent());

View File

@@ -1,34 +0,0 @@
package com.yizhuan.xchat_android_core.utils;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
/**
* emoji表情
* Created by lvzebiao on 2019/2/25.
*/
public class EmojiUtil {
/**
* 判断该字符串是否是我们APP的暗号口令
* 只是简单判断,完整的逻辑,交给后端完成
* //连续匹配到5个emoji + 换行 + 5个emoji则通过
*/
public static boolean isTutuAppEmojiPwd(String emojiText) {
try {
String oneEmojiP = "([\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\ud83e\udc00-\ud83e\udfff]" +
"|[\u2100-\u32ff]|[\u0030-\u007f][\u20d0-\u20ff]|[\u0080-\u00ff])";
String regx = oneEmojiP + "{5}\n" + oneEmojiP + "{5}";
Pattern p = Pattern.compile(regx);
Matcher matcher = p.matcher(emojiText);
return matcher.find();
} catch (Exception ex) {
ex.printStackTrace();
}
return false;
}
}