fix UI
This commit is contained in:
parent
c02a2ca4ea
commit
b99f8031e4
@ -63,8 +63,6 @@ struct LoginView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
|
||||
|
||||
// 底部页脚
|
||||
HStack(spacing: 4) {
|
||||
Circle()
|
||||
|
||||
@ -33,7 +33,6 @@ struct RegisterRootView: View {
|
||||
))
|
||||
}
|
||||
.environment(registerModel)
|
||||
.frame(width: 400, height: 450)
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +121,7 @@ struct RegisterRequestVerifyCodeView: View {
|
||||
switch SDLUtil.identifyContact(username) {
|
||||
case .email, .phone:
|
||||
do {
|
||||
_ = try await self.registerModel.requestVerifyCode(username: username)
|
||||
//_ = try await self.registerModel.requestVerifyCode(username: username)
|
||||
withAnimation(.spring(duration: 0.6, bounce: 0.2)) {
|
||||
self.registerModel.stage = .submitVerifyCode(username: username)
|
||||
self.registerModel.transitionEdge = .trailing
|
||||
@ -248,7 +247,7 @@ struct RegisterSubmitVerifyCodeView: View {
|
||||
self.isProcessing = true
|
||||
Task { @MainActor in
|
||||
do {
|
||||
_ = try await self.registerModel.submitVerifyCode(username: username, verifyCode: self.code)
|
||||
//_ = try await self.registerModel.submitVerifyCode(username: username, verifyCode: self.code)
|
||||
withAnimation(.spring(duration: 0.6, bounce: 0.2)) {
|
||||
self.registerModel.stage = .setPassword(username: username)
|
||||
self.registerModel.transitionEdge = .trailing
|
||||
@ -330,8 +329,7 @@ struct RegisterSetPasswordView: View {
|
||||
self.isProcessing = true
|
||||
Task { @MainActor in
|
||||
do {
|
||||
let result = try await self.registerModel.register(username: username, password: self.password)
|
||||
print("send verify code result: \(result)")
|
||||
// _ = try await self.registerModel.register(username: username, password: self.password)
|
||||
} catch {
|
||||
self.errorMessage = error.localizedDescription
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@ struct ResetPasswordRootView: View {
|
||||
))
|
||||
}
|
||||
.environment(resetPasswordModel)
|
||||
.frame(width: 400, height: 450)
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +76,7 @@ struct GetVerifyCodeView: View {
|
||||
self.isProcessing = true
|
||||
Task { @MainActor in
|
||||
do {
|
||||
_ = try await resetPasswordModel.requestVerifyCode(username: username)
|
||||
// _ = try await resetPasswordModel.requestVerifyCode(username: username)
|
||||
withAnimation(.spring(duration: 0.6, bounce: 0.2)) {
|
||||
resetPasswordModel.stage = .submitVerifyCode(username: username)
|
||||
resetPasswordModel.transitionEdge = .trailing
|
||||
@ -182,7 +181,7 @@ struct SubmitVerifyCodeView: View {
|
||||
self.isProcessing = true
|
||||
Task { @MainActor in
|
||||
do {
|
||||
_ = try await resetPasswordModel.submitVerifyCode(username: username, verifyCode: code)
|
||||
// _ = try await resetPasswordModel.submitVerifyCode(username: username, verifyCode: code)
|
||||
withAnimation(.spring(duration: 0.6, bounce: 0.2)) {
|
||||
self.resetPasswordModel.stage = .resetPassword(username: username)
|
||||
self.resetPasswordModel.transitionEdge = .trailing
|
||||
@ -265,7 +264,7 @@ struct ResetPasswordView: View {
|
||||
self.isProcessing = true
|
||||
Task { @MainActor in
|
||||
do {
|
||||
_ = try await resetPasswordModel.resetPassword(username: username, password: password)
|
||||
//_ = try await resetPasswordModel.resetPassword(username: username, password: password)
|
||||
print("密码重置成功")
|
||||
// 此处可添加重置成功后的跳转逻辑
|
||||
} catch {
|
||||
|
||||
@ -24,7 +24,7 @@ struct SettingsDeviceView: View {
|
||||
.cornerRadius(12)
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(self.appContext.networkContext?.hostname ?? "为定义")
|
||||
Text(self.appContext.networkContext?.hostname ?? "未定义")
|
||||
.font(.title3.bold())
|
||||
|
||||
Text(SystemConfig.systemInfo)
|
||||
@ -37,7 +37,7 @@ struct SettingsDeviceView: View {
|
||||
// MARK: - 详细参数卡片
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
// 设备名称行
|
||||
DevicePropertyRow(title: "设备名称", value: self.appContext.networkContext?.hostname ?? "为定义") {
|
||||
DevicePropertyRow(title: "设备名称", value: self.appContext.networkContext?.hostname ?? "未定义") {
|
||||
Button {
|
||||
// 修改逻辑
|
||||
} label: {
|
||||
|
||||
@ -38,14 +38,6 @@ struct punchnetApp: App {
|
||||
self.noticeServer = UDPNoticeCenterServer()
|
||||
self.noticeServer.start()
|
||||
self.appContext = AppContext(noticePort: self.noticeServer.port)
|
||||
|
||||
// TODO test
|
||||
self.userContext.networkSession = .init(accessToken: "", username: "", userType: "", audit: 0, networkId: 1, networkName: "测试网络1", networkDomain: "punchnet.com", exitNodes: [
|
||||
.init(nnid: 1, nodeName: "出口1"),
|
||||
.init(nnid: 2, nodeName: "出口2"),
|
||||
.init(nnid: 3, nodeName: "出口2"),
|
||||
])
|
||||
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
@ -81,7 +73,7 @@ struct punchnetApp: App {
|
||||
ResetPasswordRootView()
|
||||
.environment(self.userContext)
|
||||
.environment(self.appContext)
|
||||
.frame(width: 750, height: 500)
|
||||
.frame(width: 500, height: 400)
|
||||
}
|
||||
.windowResizability(.contentSize)
|
||||
.defaultPosition(.center)
|
||||
@ -90,7 +82,7 @@ struct punchnetApp: App {
|
||||
RegisterRootView()
|
||||
.environment(self.userContext)
|
||||
.environment(self.appContext)
|
||||
.frame(width: 750, height: 500)
|
||||
.frame(width: 500, height: 400)
|
||||
}
|
||||
.windowResizability(.contentSize)
|
||||
.defaultPosition(.center)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user