|
|
|
@ -17,6 +17,7 @@ import { _IsPhone } from '@gykeji/jsutil';
|
|
|
|
|
import {computed, onMounted, ref} from 'vue';
|
|
|
|
|
import {ApiGetVerifyCode, ApiPostVerifyCodeCheck} from '../api/user'
|
|
|
|
|
import {HandleApiError, ShowToast} from '../utils';
|
|
|
|
|
import { ApiGetUserInfo } from "./api/user";
|
|
|
|
|
import {useStore} from 'vuex';
|
|
|
|
|
|
|
|
|
|
const $store = useStore();
|
|
|
|
@ -60,9 +61,21 @@ const handleLogin = async () =>{
|
|
|
|
|
|
|
|
|
|
if(!HandleApiError(error)){
|
|
|
|
|
$store.commit('setToken', result.accessToken);
|
|
|
|
|
await getUserInfo()
|
|
|
|
|
uni.redirectTo({url:'/pages/index/index'});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: 获取用户信息
|
|
|
|
|
* @return {*}
|
|
|
|
|
*/
|
|
|
|
|
const getUserInfo = async () => {
|
|
|
|
|
const { error, result } = await ApiGetUserInfo();
|
|
|
|
|
if (result) {
|
|
|
|
|
$store.commit("setUserInfo", result);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const calcTimer = () =>{
|
|
|
|
|
codeTimerNum.value--;
|
|
|
|
|
if(codeTimerNum.value === 0){
|
|
|
|
|