添加了授权
This commit is contained in:
25
Mods/工业数据采集与分析应用分享/Scripts/IDIS_License.cs
Normal file
25
Mods/工业数据采集与分析应用分享/Scripts/IDIS_License.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using BITKit;
|
||||
using BITKit.Auth;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IDIS.Entities.License;
|
||||
public partial class IDIS_License : EntityComponent
|
||||
{
|
||||
[Export] private PackedScene initialScene;
|
||||
[Export] private Control licenseNode;
|
||||
|
||||
private IAuthService _authService;
|
||||
public override void OnAwake()
|
||||
{
|
||||
_authService = Entity.ServiceProvider.GetRequiredService<IAuthService>();
|
||||
_authService.OnAuthorized += OnAuthorized;
|
||||
}
|
||||
private async void OnAuthorized(string obj)
|
||||
{
|
||||
await BITApp.SwitchToMainThread();
|
||||
GetParent().AddChild(initialScene.Instantiate());
|
||||
licenseNode.QueueFree();
|
||||
}
|
||||
}
|
@@ -218,7 +218,6 @@ layout_mode = 2
|
||||
[node name="Button5" type="Button" parent="Layout/UX TabView Service/Horizontal Layout/导航栏/MarginContainer/Layout"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"SideTab"
|
||||
toggle_mode = true
|
||||
button_group = SubResource("ButtonGroup_qfatg")
|
||||
text = "返回"
|
||||
icon = ExtResource("9_78wam")
|
||||
|
Reference in New Issue
Block a user