Setting.tsx 629 B

1234567891011121314151617181920212223
  1. import Buttons from "@/components/Buttons";
  2. import { clear, logout } from "@/services/user";
  3. import { View,Text,Button } from "@tarojs/components";
  4. import { useDispatch } from "react-redux";
  5. export default function Page(){
  6. const dispatch = useDispatch();
  7. function logoutF() {
  8. dispatch(logout() as any);
  9. }
  10. function clearF() {
  11. dispatch(clear() as any);
  12. }
  13. return <View>
  14. <Buttons title='退出登录' onClick={logoutF} style={{ width: 289, marginBottom: 30 }} />
  15. <Buttons title='注销账号' onClick={clearF} style={{ width: 289, marginBottom: 30 }} />
  16. </View>
  17. }