mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-25 16:34:01 +00:00
fix
This commit is contained in:
parent
44f25f942e
commit
f8b0f39d44
|
@ -7,7 +7,7 @@ export const sendPing = async (): Promise<string> => {
|
|||
};
|
||||
|
||||
export const loginWithCode = async (code: string): Promise<string> => {
|
||||
const response = await api.post('/auth/login', { code });
|
||||
const response = await api.post('/child/auth/login', { loginCode: code })
|
||||
return response.data.accessToken;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import useStore from 'src/store';
|
||||
import { loginWithCode } from 'src/api/apiService';
|
||||
|
@ -29,13 +29,9 @@ const store = useStore();
|
|||
|
||||
const login = () => {
|
||||
if (canLogin.value) {
|
||||
loginWithCode(loginCode.value).then((response) => {
|
||||
if (response.error) {
|
||||
alert('ログインエラー: ' + response.error);
|
||||
return;
|
||||
}
|
||||
store.commit('setToken', response.token);
|
||||
store.commit('setLoggedIn', true);
|
||||
loginWithCode(loginCode.value).then((accessToken) => {
|
||||
store.commit('account/setToken', accessToken);
|
||||
store.commit('account/setLoggedIn', true);
|
||||
}).catch((error) => {
|
||||
alert('ログインエラー: ' + error);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user