终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainWindowViewModel.cs 1.4 KiB

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142
  1. global using CommunityToolkit.Mvvm.ComponentModel;
  2. global using CommunityToolkit.Mvvm.DependencyInjection;
  3. global using CommunityToolkit.Mvvm.Input;
  4. global using BPASmartClient.Helper;
  5. global using System;
  6. global using System.Collections.Generic;
  7. global using System.Linq;
  8. global using System.Text;
  9. global using System.Threading.Tasks;
  10. global using BPASmart.Model;
  11. namespace BPASmart.UserManagement.ViewModel
  12. {
  13. public class MainWindowViewModel:ObservableObject
  14. {
  15. public MainWindowViewModel()
  16. {
  17. Json<LocalUser>.Read();
  18. if (Json<LocalUser>.Data.HighGradeUsers.FirstOrDefault(p => p.UserID == "1") == null)
  19. {
  20. Json<LocalUser>.Data.HighGradeUsers.Insert(0, new UserManager()
  21. {
  22. UserID = "1",
  23. UserName = "admin",
  24. Password = AESHelper.Encrypt("admin") ,
  25. userPower = UserPower.管理员权限
  26. });
  27. }
  28. if (Json<LocalUser>.Data.HighGradeUsers.FirstOrDefault(p => p.UserID == "0") == null)
  29. {
  30. Json<LocalUser>.Data.HighGradeUsers.Insert(0, new UserManager()
  31. {
  32. UserID = "0",
  33. UserName = "developer",
  34. Password = AESHelper.Encrypt("developer"),
  35. userPower = UserPower.开发者权限
  36. });
  37. }
  38. }
  39. }
  40. }