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
             }
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
                 )
522
                 )
513
             )
523
             )
514
             //允许运行时权限,禁止状态栏下拉,屏蔽底部虚拟键。
524
             //允许运行时权限,禁止状态栏下拉,屏蔽底部虚拟键。
515
-            setRuntimePermissions(true)
525
+           // setRuntimePermissions(true)
516
             disableStatusBarPanel(true)
526
             disableStatusBarPanel(true)
517
             hideHomeSoftKey(true)
527
             hideHomeSoftKey(true)
518
             hideMenuSoftKey(true)
528
             hideMenuSoftKey(true)
526
                 csdkManager?.setPackageEnabled("com.xhly.easystud", true)
536
                 csdkManager?.setPackageEnabled("com.xhly.easystud", true)
527
                 setUrlWhiteListEnable(false)
537
                 setUrlWhiteListEnable(false)
528
                 disableStatusBarPanel(false)
538
                 disableStatusBarPanel(false)
539
+                hideHomeSoftKey(false)
540
+                hideMenuSoftKey(false)
529
             }
541
             }
530
             csdkManager?.urlWhiteListRead()?.forEach {
542
             csdkManager?.urlWhiteListRead()?.forEach {
531
                 LogShow("白名单有"+it.toString())
543
                 LogShow("白名单有"+it.toString())

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

66
         socketUserBean.usertype = 2
66
         socketUserBean.usertype = 2
67
         socketUserBean.username = Const.USERNAME
67
         socketUserBean.username = Const.USERNAME
68
         socketUserBean.userid = ManageApplication.getDeviceInfo()
68
         socketUserBean.userid = ManageApplication.getDeviceInfo()
69
+        socketUserBean.schoolid=Const.SCHOOLID
69
         webData.body = socketUserBean
70
         webData.body = socketUserBean
70
         WebSocketHelper.getInstance().sendSocketString(GsonUtils.parseClassToJson(webData))
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
 import com.xhly.manageapp.bean.user.UserBean
31
 import com.xhly.manageapp.bean.user.UserBean
32
 import com.xhly.manageapp.contentprovider.ZSpProvider
32
 import com.xhly.manageapp.contentprovider.ZSpProvider
33
 import com.xhly.manageapp.databinding.ActivityLoginBinding
33
 import com.xhly.manageapp.databinding.ActivityLoginBinding
34
+import com.xhly.manageapp.service.websocket.AppSocket
34
 import com.xhly.manageapp.ui.login.viewmodel.LoginViewModel
35
 import com.xhly.manageapp.ui.login.viewmodel.LoginViewModel
35
 import com.xhly.manageapp.ui.main.activity.MainActivity
36
 import com.xhly.manageapp.ui.main.activity.MainActivity
36
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
37
 import com.xhly.manageapp.utils.CurrentAppSharedPreferencesUtils
154
         spUtils.saveJson(Const.USERINFO,userBean)
155
         spUtils.saveJson(Const.USERINFO,userBean)
155
         val parseClassToJson = GsonUtils.parseClassToJson(userBean)
156
         val parseClassToJson = GsonUtils.parseClassToJson(userBean)
156
         ZSpProvider.save(this,Const.USERINFO,parseClassToJson)
157
         ZSpProvider.save(this,Const.USERINFO,parseClassToJson)
158
+        AppSocket.onDestroy()
159
+        AppSocket.startSocket(ManageApplication.instance)
157
         startIntentActivity(MainActivity().javaClass)
160
         startIntentActivity(MainActivity().javaClass)
158
         finish()
161
         finish()
159
     }
162
     }

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

323
                             val userBean = spUtils.getFromJson(
323
                             val userBean = spUtils.getFromJson(
324
                                 Const.USERINFO, UserBean().javaClass
324
                                 Const.USERINFO, UserBean().javaClass
325
                             ) as UserBean
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
                         } catch (e: Exception) {
329
                         } catch (e: Exception) {
328
 
330
 
329
                         }
331
                         }
674
                 data.doEvent = EventLog.USBDISCONNECTEVENT
676
                 data.doEvent = EventLog.USBDISCONNECTEVENT
675
                 viewModel.eventLog(data)
677
                 viewModel.eventLog(data)
676
             }
678
             }
677
-            Const.APPSTOREKEY->{
679
+            Const.ACCOUNTLOGINOUT->{
678
                 loginOut()
680
                 loginOut()
679
             }
681
             }
680
         }
682
         }

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

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
         launchUI {
202
         launchUI {
203
             val map=HashMap<String,Any>()
203
             val map=HashMap<String,Any>()
204
             map["userid"] = userid
204
             map["userid"] = userid
205
             map["loginpwd"] =loginpwd
205
             map["loginpwd"] =loginpwd
206
             map["oldpwd"] = oldpwd
206
             map["oldpwd"] = oldpwd
207
+            map["rversion"]=rversion
207
             val postEditPwd = loginService.postEditPwd(map)
208
             val postEditPwd = loginService.postEditPwd(map)
208
             if (postEditPwd.code==0){
209
             if (postEditPwd.code==0){
209
               UIEvent(Const.ACCOUNTLOGINOUT).post()
210
               UIEvent(Const.ACCOUNTLOGINOUT).post()

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

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

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

265
             LocationManager systemService = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
265
             LocationManager systemService = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
266
                   String bestProvider = "";
266
                   String bestProvider = "";
267
             List<String> providers = systemService.getProviders(true);
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
             if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED &&
268
             if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED &&
285
                     ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
269
                     ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
286
                 for (String provider : providers) {
270
                 for (String provider : providers) {

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

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

Loading…
Cancel
Save