瀏覽代碼

修复添加分享类型参数时,可能没有正确添加的问题

zengjiebin 7 年之前
父節點
當前提交
8fa7b61c39
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      app/src/main/java/com/sheep/gamegroup/util/share/ShareLinkConfig.java

+ 6 - 5
app/src/main/java/com/sheep/gamegroup/util/share/ShareLinkConfig.java

@@ -22,6 +22,7 @@ import com.sheep.gamegroup.util.StringUtils;
 import com.sheep.gamegroup.util.TestUtil;
 import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.util.ZipChannelUtil;
+import com.sheep.gamegroup.util.js.BaseActWeb;
 import com.sheep.gamegroup.util.viewHelper.CacheImageUtil;
 import com.sheep.jiuyan.samllsheep.R;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -385,19 +386,19 @@ public class ShareLinkConfig {
         if(url == null){
             return null;
         }
-        if (url.contains("&type="))
+        if (url.contains("&type=") || url.contains("?type="))
             return url;
         switch (type) {
             case ShareLinkConfig.WX:
             case ShareLinkConfig.WEIXIN_CIRCLE:
-                return url + "&type=1";
+                return BaseActWeb.addUrlQuery(url,"type","1");
             case ShareLinkConfig.QQ:
             case ShareLinkConfig.QZONE:
-                return url + "&type=2";
+                return BaseActWeb.addUrlQuery(url,"type","2");
             case ShareLinkConfig.FACE_TO_FACE:
-                return url + "&type=4";
+                return BaseActWeb.addUrlQuery(url, "type", "4");
             default:
-                return url + "&type=5";
+                return BaseActWeb.addUrlQuery(url,"type","5");
         }
     }
     public final static String FACE_TO_FACE = "face_to_face";