You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
48 lines
1.0 KiB
import { toast } from '../../utils/extendApi';
|
|
import { getStorage, clearStorage, } from '../../utils/storage';
|
|
import { ComponentWithStore } from 'mobx-miniprogram-bindings';
|
|
import { userStore } from '../../stores/userstore';
|
|
|
|
ComponentWithStore({
|
|
storeBindings: {
|
|
store: userStore,
|
|
fields: ['id'],
|
|
actions: ['setId']
|
|
},
|
|
data:{
|
|
name:'',
|
|
identify:getStorage('identify'),
|
|
school:'',
|
|
no:'',
|
|
score:'',
|
|
},
|
|
methods: {
|
|
onLoad(){
|
|
wx.request({
|
|
url: `http://172.20.10.2:8600/student-api/student/common/getUserInfo/${this.data.id}`,
|
|
method:'GET',
|
|
header: {
|
|
'content-type': 'application/json'
|
|
},
|
|
success:({data})=>{
|
|
this.setData({
|
|
name:data.data.name,
|
|
school:data.data.school,
|
|
no:data.data.no,
|
|
score:data.data.score
|
|
})
|
|
}
|
|
})
|
|
},
|
|
LogOut(){
|
|
clearStorage();
|
|
wx.redirectTo({
|
|
url: '/pages/login/login',
|
|
})
|
|
},
|
|
|
|
onShow(){
|
|
|
|
}
|
|
}
|
|
}); |