This commit is contained in:
2026-04-07 14:50:23 +09:00
commit b4e485502b
4778 changed files with 2017091 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
export default defineNuxtRouteMiddleware(async (to, from) => {
const responseJson = await _crossCtl.doComm('select', 'user', {});
console.log('responseJson=', responseJson);
if (responseJson['responseCode'] == 200) {
_crossCtl.setAuthInfo(responseJson['data'][0]);
_crossCtl.setUserInfo(responseJson['data'][0]);
if (_crossCtl.isAuthenticated.value) {
const tmpProfile = responseJson['data'][0].userInfo.profile;
// console.log('huk', tmpProfile);
const profile = {
email: tmpProfile.infos.email,
displayName: tmpProfile.display_name,
photoUrl: tmpProfile.photo_url,
phone: tmpProfile.infos.phone ? tmpProfile.infos.phone : '',
memo: tmpProfile.infos.memo ? tmpProfile.infos.memo : '',
};
_crossCtl.setUserProfile(profile);
} else {
_crossCtl.setUserProfile({});
}
return null;
} else {
console.log('from = ', from, ', to = ', to);
_crossCtl.setUserProfile({});
if (to.fullPath != '/') {
return throwError('#' + responseJson['responseCode']);
} else {
console.log('skip for google...');
}
}
});