fix bugs 55 2

This commit is contained in:
2025-11-26 16:27:14 +08:00
parent 2221a11f0a
commit 09984c59ff
5 changed files with 45 additions and 21 deletions

View File

@@ -14,9 +14,11 @@ import com.alibaba.sdk.android.oss.internal.OSSAsyncTask;
import com.alibaba.sdk.android.oss.model.PutObjectRequest;
import com.alibaba.sdk.android.oss.model.PutObjectResult;
import com.blankj.utilcode.util.FileUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ThreadUtils;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.utils.Md5Utils;
import com.xscm.moduleutil.utils.SpUtil;
import com.xscm.moduleutil.utils.TimeUtils;
import com.xscm.moduleutil.utils.logger.Logger;
@@ -85,7 +87,7 @@ public class OSSOperUtils {
if (file.getName().contains(".")) {
suffix = file.getName().substring(file.getName().lastIndexOf("."));
}
return AppLog + fileMD5 + TimeUtils.getCurrentDate2() + suffix;
return AppLog+ SpUtil.getUserInfo().getNickname()+"_"+SpUtil.getUserInfo().getUser_id() +"_"+ TimeUtils.getCurrentDate2() +"_" + fileMD5+ suffix;
}
public static OSSOperUtils newInstance() {

View File

@@ -2518,6 +2518,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
addActiveDialogFragment(fragment) // 添加到管理列表
}
} else if (id == R.id.rl_gift) { //礼物
LogUtils.e("RoomGiftDialogFragment_RoomActivity");
val fragment = RoomGiftDialogFragment.show(
mRoomInfoResp, null, roomId, 0, "",
supportFragmentManager

View File

@@ -33,10 +33,12 @@ import io.reactivex.schedulers.Schedulers;
public class SettingPresenter extends BasePresenter<SettingConacts.View> implements SettingConacts.IMePre {
private SettingConacts.View mView;
public SettingPresenter(SettingConacts.View view, Context context) {
super(view, context);
mView = view;
}
@Override
public void clearLoginInfo() {
api.clearLoginInfo(new BaseObserver<String>() {
@@ -47,8 +49,8 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().clearLoginInfo(s);
}
@@ -66,8 +68,8 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
@Override
public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().cancel(s);
}
@@ -101,18 +103,18 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
try {
File file = new File(Application.Companion.getInstance().getAppContent());
if (FileUtils.isFileExists(file.getParent() +"/DataInfo.zip")){
FileUtils.delete(file.getParent() +"/DataInfo.zip");
if (FileUtils.isFileExists(file.getParent() + "/DataInfo.zip")) {
FileUtils.delete(file.getParent() + "/DataInfo.zip");
}
boolean isZip = ZipUtils.zipFile(Application.Companion.getInstance().getAppContent(),
file.getParent() +"/DataInfo.zip");
file.getParent() + "/DataInfo.zip");
if (isZip) {
emitter.onNext(file.getParent() + "/DataInfo.zip");
}else {
} else {
emitter.onNext("");
}
}catch (Exception e){
LogUtils.e("压缩失败",e.toString());
} catch (Exception e) {
LogUtils.e("压缩失败", e.toString());
emitter.onNext("");
}
}
@@ -121,15 +123,15 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
@Override
public void accept(String zipPath) {
String upLogUrl = OSSOperUtils.getAppLogPath(new File(zipPath));
if(!zipPath.isEmpty()){
CosUploadManager.getInstance(Application.getInstance()).upParameters(upLogUrl,zipPath, new CosUploadManager.UploadCallback(){
if (!zipPath.isEmpty()) {
CosUploadManager.getInstance(Application.getInstance()).upParameters(upLogUrl, zipPath, new CosUploadManager.UploadCallback() {
@Override
public void onSuccess(String url) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
api.sendAppLog(upLogUrl,url, new BaseObserver<String>() {
api.sendAppLog(upLogUrl, url, new BaseObserver<String>() {
@Override
@@ -149,21 +151,27 @@ public class SettingPresenter extends BasePresenter<SettingConacts.View> impleme
@Override
public void onFailure(Exception e) {
ToastUtils.showLong("上传失败");
LogUtils.e("上传失败",e.toString());
LogUtils.e("上传失败", e.toString());
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().disLoadings();
}
@Override
public void onFailure1(IllegalStateException e) {
ToastUtils.showLong("上传失败");
LogUtils.e("上传失败",e.toString());
LogUtils.e("上传失败", e.toString());
MvpRef.get().disLoadings();
}
});
}else {
} else {
ToastUtils.showLong("上传失败");
LogUtils.e("压缩失败");
MvpRef.get().disLoadings();
if (MvpRef == null) {
MvpRef = new WeakReference<>(mView);
}
MvpRef.get().disLoadings();
}
}
});

View File

@@ -22,6 +22,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.modulemain.R;
import com.xscm.modulemain.databinding.DialogGiftLotteryBinding;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
@@ -371,6 +372,15 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
private void onClisk(View view) {
int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(id);
} catch (Exception e) {
viewName = "未知View ID: " + id;
}
LogUtils.e("GiftLotteryDFragment","点击了" + viewName );
if (id == R.id.ll_one) {
if (!isDrawing) {
isDrawing = true;

View File

@@ -97,6 +97,10 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
}
public static RoomGiftDialogFragment show(RoomInfoResp roomInfoResp, UserInfo userInfo, String roomId, int jingp, String heart_id, FragmentManager fragmentManager) {
if (roomInfoResp == null && userInfo == null) {
LogUtils.e("RoomGiftDialogFragment_show", "roomInfoResp and userInfo is null");
return null;
}
RoomGiftDialogFragment dialogFragment = new RoomGiftDialogFragment();
Bundle args = new Bundle();
args.putSerializable("roomInfoResp", roomInfoResp);
@@ -812,7 +816,6 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
if (mBinding.tvBbQs != null) {
mBinding.tvBbQs.setVisibility(View.GONE);
mBinding.cz.setVisibility(View.VISIBLE);
MvpPre.wallet();
}
}
}