import { toast } from '../../utils/extendApi';
import { getStorage, setStorage } from '../../utils/storage';
import { ComponentWithStore } from 'mobx-miniprogram-bindings';
import { userStore } from '../../stores/userstore';

ComponentWithStore({
  storeBindings: {
    store: userStore,
    fields: ['id', 'identify'],
    actions: ['setId', 'setIdentify']
  },
  data: {
    list: []
  },
  methods: {
    onShow() {
      wx.request({
        url: 'http://172.20.10.2:8600/student-api/student/scorerank',
        method: 'GET',
        header: {
          'content-type': 'application/json'
        },
        success: ({ data }) => {
          this.setData({
            list:data.data
          })
        }
      })
    }
  }
});