import Taro from "@tarojs/taro";
import { createSlice } from "@reduxjs/toolkit";

// 全局变量
const globalStoreReducer = createSlice({
  name: "globalStore", // store的名字
  initialState: {
    domain: "https://flossom.yq-h5.cn/prod-api/hzwx", // 请求地址
    // domain: "http://192.168.10.147:8080/hzwx", // 请求地址
    // 是否首次进入首页
    isShowIndexFlag: false,
  },
  reducers: {
    setIndexFlag(state, { payload }) {
      state.isShowIndexFlag = payload;
    },
  },
});

export const { setToken, setIndexFlag } = globalStoreReducer.actions;
export default globalStoreReducer.reducer;
