|
|
@ -17,23 +17,16 @@ struct ContentView: View { |
|
|
|
@EnvironmentObject var user:User |
|
|
|
@EnvironmentObject var user:User |
|
|
|
|
|
|
|
|
|
|
|
@State var selection=2 |
|
|
|
@State var selection=2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
var body: some View { |
|
|
|
TabView(selection: self.$selection) { |
|
|
|
TabView(selection: self.$selection) { |
|
|
|
if self.user.access_token==nil{ |
|
|
|
if (self.user.access_token != nil){ |
|
|
|
IndexView().tabItem { VStack { |
|
|
|
IndexView().tabItem { VStack { |
|
|
|
Image("house") |
|
|
|
Image("house") |
|
|
|
Text("首页") |
|
|
|
Text("首页") |
|
|
|
.foregroundColor(Color.black) |
|
|
|
.foregroundColor(Color.black) |
|
|
|
} }.tag(1).hidden() |
|
|
|
} }.tag(1) |
|
|
|
}else{ |
|
|
|
|
|
|
|
IndexView().tabItem { VStack { |
|
|
|
|
|
|
|
Image("house") |
|
|
|
|
|
|
|
Text("首页") |
|
|
|
|
|
|
|
.foregroundColor(Color.black) |
|
|
|
|
|
|
|
} }.tag(1) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LoginView().tabItem { VStack { |
|
|
|
LoginView().tabItem { VStack { |
|
|
|