1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import BaseStore from '@src/stores/base';
- export default class UserStore extends BaseStore {
-
- token() {
- return this.apiPost('/auth/token');
- }
-
- login(mobile, mobileVerifyCode, inviteCode) {
- return this.apiPost('/auth/login', { mobile, mobileVerifyCode, inviteCode });
- }
- loginWechat(code) {
- return this.apiGet('/auth/wechat', { code });
- }
- loginWechatPC(code) {
- return this.apiGet('/auth/wechat_pc', { code });
- }
-
- logout() {
- return this.apiPost('/auth/logout');
- }
-
- bind(mobile, mobileVerifyCode, inviteCode) {
- return this.apiPost('/auth/bind', { mobile, mobileVerifyCode, inviteCode });
- }
-
- validInviteCode(code) {
- return this.apiGet('/auth/valid/invite_code', { code });
- }
-
- validMobile(mobile) {
- return this.apiGet('/auth/valid/mobile', { mobile });
- }
- }
- export const User = new UserStore({ key: 'user' });
|