Browse Source

1.添加修改密码接口

2.添加appsocket数据重置
20241218TB223FC(测试jar包)
wangwanlei 8 months ago
parent
commit
63a4be3f35

+ 13
- 1
app/src/main/java/com/xhly/manageapp/ManageApplication.kt View File

@@ -236,6 +236,16 @@ class ManageApplication : MultiDexApplication() {
236 236
             }
237 237
         }
238 238
 
239
+
240
+        /**
241
+         *禁止手动切换桌面 true: 禁止手动切换桌面;false: 允许手动切换桌面
242
+         */
243
+        fun disallowSwitchLauncher_v3(enableFlag: Boolean) {
244
+            if (ModelNameUtils.IS_LianxX505f()) {
245
+                csdkManager?.disallowSwitchLauncher_v3(enableFlag)
246
+            }
247
+        }
248
+
239 249
         /**
240 250
          * 设置运行时权限
241 251
          */
@@ -512,7 +522,7 @@ class ManageApplication : MultiDexApplication() {
512 522
                 )
513 523
             )
514 524
             //允许运行时权限,禁止状态栏下拉,屏蔽底部虚拟键。
515
-            setRuntimePermissions(true)
525
+           // setRuntimePermissions(true)
516 526
             disableStatusBarPanel(true)
517 527
             hideHomeSoftKey(true)
518 528
             hideMenuSoftKey(true)
@@ -526,6 +536,8 @@ class ManageApplication : MultiDexApplication() {
526 536
                 csdkManager?.setPackageEnabled("com.xhly.easystud", true)
527 537
                 setUrlWhiteListEnable(false)
528 538
                 disableStatusBarPanel(false)
539
+                hideHomeSoftKey(false)
540
+                hideMenuSoftKey(false)
529 541
             }
530 542
             csdkManager?.urlWhiteListRead()?.forEach {
531 543
                 LogShow("白名单有"+it.toString())

+ 1
- 0
app/src/main/java/com/xhly/manageapp/service/websocket/AppSocket.kt View File

@@ -66,6 +66,7 @@ object AppSocket : SocketClient() {
66 66
         socketUserBean.usertype = 2
67 67
         socketUserBean.username = Const.USERNAME
68 68
         socketUserBean.userid = ManageApplication.getDeviceInfo()
69
+        socketUserBean.schoolid=Const.SCHOOLID
69 70
         webData.body = socketUserBean
70 71
         WebSocketHelper.getInstance().sendSocketString(GsonUtils.parseClassToJson(webData))
71 72
     }

+ 3
- 0
app/src/main/java/com/xhly/manageapp/ui/login/activity/LoginActivity.kt View File

@@ -31,6 +31,7 @@ import com.xhly.manageapp.bean.log.LogdOperateBean
31 31
 import com.xhly.manageapp.bean.user.UserBean
32 32
 import com.xhly.manageapp.contentprovider.ZSpProvider
33 33
 import com.xhly.manageapp.databinding.ActivityLoginBinding
34
+import com.xhly.manageapp.service.websocket.AppSocket
34 35
 import com.xhly.manageapp.ui.login.viewmodel.LoginViewModel
35 36
 import com.xhly.manageapp.ui.main.activity.MainActivity
36 37
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
@@ -154,6 +155,8 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {
154 155
         spUtils.saveJson(Const.USERINFO,userBean)
155 156
         val parseClassToJson = GsonUtils.parseClassToJson(userBean)
156 157
         ZSpProvider.save(this,Const.USERINFO,parseClassToJson)
158
+        AppSocket.onDestroy()
159
+        AppSocket.startSocket(ManageApplication.instance)
157 160
         startIntentActivity(MainActivity().javaClass)
158 161
         finish()
159 162
     }

+ 4
- 2
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt View File

@@ -323,7 +323,9 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
323 323
                             val userBean = spUtils.getFromJson(
324 324
                                 Const.USERINFO, UserBean().javaClass
325 325
                             ) as UserBean
326
-                             viewModel.postEditPwd(userBean.userid,newCode,oldCode)
326
+                            val appVersionCode =
327
+                                SystemUtil.getAppVersionCode(this@MainActivity, packageName)
328
+                            viewModel.postEditPwd(userBean.userid,newCode,oldCode,appVersionCode)
327 329
                         } catch (e: Exception) {
328 330
 
329 331
                         }
@@ -674,7 +676,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
674 676
                 data.doEvent = EventLog.USBDISCONNECTEVENT
675 677
                 viewModel.eventLog(data)
676 678
             }
677
-            Const.APPSTOREKEY->{
679
+            Const.ACCOUNTLOGINOUT->{
678 680
                 loginOut()
679 681
             }
680 682
         }

+ 2
- 1
app/src/main/java/com/xhly/manageapp/ui/main/viewmodel/MainViewModel.kt View File

@@ -198,12 +198,13 @@ class MainViewModel : BaseViewModel() {
198 198
     /**
199 199
      * 修改密码
200 200
      */
201
-    fun postEditPwd(userid:Long, loginpwd:String, oldpwd:String){
201
+    fun postEditPwd(userid:Long, loginpwd:String, oldpwd:String,rversion:Long){
202 202
         launchUI {
203 203
             val map=HashMap<String,Any>()
204 204
             map["userid"] = userid
205 205
             map["loginpwd"] =loginpwd
206 206
             map["oldpwd"] = oldpwd
207
+            map["rversion"]=rversion
207 208
             val postEditPwd = loginService.postEditPwd(map)
208 209
             if (postEditPwd.code==0){
209 210
               UIEvent(Const.ACCOUNTLOGINOUT).post()

+ 2
- 2
corelib/src/main/java/com/xhly/corelib/Const.kt View File

@@ -11,10 +11,10 @@ object Const {
11 11
     var USERNAME = ""
12 12
 
13 13
     //学校id
14
-    var SCHOOLID:Long? = 0L
14
+    var SCHOOLID:Long? = null
15 15
 
16 16
     //班级id
17
-    var CLASSID :Long?= 0L
17
+    var CLASSID :Long?= null
18 18
 
19 19
     //标记上次打开的包名,当连续打开同一包名时,不认为打开多次
20 20
     var LASTPKGNAME = ""

+ 0
- 16
corelib/src/main/java/com/xhly/corelib/utils/SystemUtil.java View File

@@ -265,22 +265,6 @@ public class SystemUtil {
265 265
             LocationManager systemService = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
266 266
                   String bestProvider = "";
267 267
             List<String> providers = systemService.getProviders(true);
268
-          /*  if (providers.contains(LocationManager.GPS_PROVIDER)) {
269
-                bestProvider = LocationManager.GPS_PROVIDER;
270
-            } else if (providers.contains(LocationManager.NETWORK_PROVIDER)) {
271
-                bestProvider = LocationManager.NETWORK_PROVIDER;
272
-            } else {
273
-                return data;
274
-            }*/
275
-           /* Criteria criteria = new Criteria();
276
-            criteria.setAltitudeRequired(false);
277
-            criteria.setBearingRequired(false);
278
-            criteria.setAccuracy(Criteria.ACCURACY_FINE);
279
-            criteria.setCostAllowed(true);
280
-             bestProvider = systemService.getBestProvider(criteria, true)
281
-              data = systemService.getLastKnownLocation(bestProvider);
282
-             ;*/
283
-
284 268
             if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED &&
285 269
                     ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
286 270
                 for (String provider : providers) {

+ 1
- 1
websocket/src/main/java/com/xhly/websocket/bean/WebSocketUserBean.kt View File

@@ -3,7 +3,7 @@ package com.xhly.websocket.bean
3 3
 class WebSocketUserBean {
4 4
     var userid: String? = ""
5 5
     var username: String? = ""
6
-
6
+    var schoolid:Long?=null
7 7
     //1是管理员,2是学生
8 8
     var usertype = 1
9 9
 }

Loading…
Cancel
Save