|
@@ -1,20 +1,14 @@
|
|
|
import { defineStore } from 'pinia';
|
|
import { defineStore } from 'pinia';
|
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
-import { ref, computed } from 'vue';
|
|
|
|
|
import { getUserInfo, logoutPhysical } from '@/api/modules/login';
|
|
import { getUserInfo, logoutPhysical } from '@/api/modules/login';
|
|
|
import config from '@/config';
|
|
import config from '@/config';
|
|
|
-
|
|
|
|
|
-import { Study, UserStoreState } from '@/types';
|
|
|
|
|
|
|
+import type { Study, UserStoreState } from '@/types';
|
|
|
import { UserInfo, VipCardInfo } from '@/types/user';
|
|
import { UserInfo, VipCardInfo } from '@/types/user';
|
|
|
import tools from '@/utils/uni-tool';
|
|
import tools from '@/utils/uni-tool';
|
|
|
import defaultAvatar from '@/static/personal/avatar_default.png'
|
|
import defaultAvatar from '@/static/personal/avatar_default.png'
|
|
|
-
|
|
|
|
|
-// @ts-ignore
|
|
|
|
|
-// import { useUserStore as useOldUserStore } from '@/hooks/useUserStore';
|
|
|
|
|
import { CardType, EnumExamType, EnumReviewMode, EnumUserType } from '@/common/enum';
|
|
import { CardType, EnumExamType, EnumReviewMode, EnumUserType } from '@/common/enum';
|
|
|
-import { OPEN_VIP_POPUP } from '@/types/injectionSymbols';
|
|
|
|
|
import { getDirectedSchool, saveDirectedSchool } from '@/api/modules/study';
|
|
import { getDirectedSchool, saveDirectedSchool } from '@/api/modules/study';
|
|
|
-// const oldUserStore = useOldUserStore()
|
|
|
|
|
|
|
+
|
|
|
const themeColor = '#31A0FC';
|
|
const themeColor = '#31A0FC';
|
|
|
type CheckLoginOptions = {
|
|
type CheckLoginOptions = {
|
|
|
askToLogin?: boolean;
|
|
askToLogin?: boolean;
|
|
@@ -140,7 +134,6 @@ export const useUserStore = defineStore('ie-user', {
|
|
|
async login(token: string) {
|
|
async login(token: string) {
|
|
|
try {
|
|
try {
|
|
|
this.accessToken = token;
|
|
this.accessToken = token;
|
|
|
- // await oldUserStore.SyncToken(token);
|
|
|
|
|
const userInfo = await this.getUserInfo();;
|
|
const userInfo = await this.getUserInfo();;
|
|
|
return Promise.resolve({
|
|
return Promise.resolve({
|
|
|
success: true,
|
|
success: true,
|