dev
This commit is contained in:
@@ -69,6 +69,11 @@ const sellerStore = useSellerStore();
|
|||||||
const userInfo = computed(() => userStore.userInfo);
|
const userInfo = computed(() => userStore.userInfo);
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
// 未登录时跳转到登录页
|
||||||
|
if (!userStore.isLoggedIn()) {
|
||||||
|
uni.navigateTo({ url: '/pages/login/index' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 刷新用户信息
|
// 刷新用户信息
|
||||||
userStore.fetchUserInfo();
|
userStore.fetchUserInfo();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,4 +9,11 @@ export default defineConfig({
|
|||||||
'@': resolve(__dirname, 'src'),
|
'@': resolve(__dirname, 'src'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
css: {
|
||||||
|
preprocessorOptions: {
|
||||||
|
scss: {
|
||||||
|
api: 'modern-compiler',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ import { User } from '@/entities/user.entity';
|
|||||||
TypeOrmModule.forFeature([User]),
|
TypeOrmModule.forFeature([User]),
|
||||||
JwtModule.registerAsync({
|
JwtModule.registerAsync({
|
||||||
imports: [ConfigModule],
|
imports: [ConfigModule],
|
||||||
useFactory: (configService: ConfigService) => ({
|
useFactory: (configService: ConfigService) => {
|
||||||
secret: configService.get<string>('jwt.secret') || 'dev_secret_key',
|
const expiresIn = configService.get<string>('jwt.expiresIn') || '2h';
|
||||||
signOptions: {
|
console.log('[AuthModule] JWT expiresIn config:', expiresIn);
|
||||||
expiresIn: Number(
|
return {
|
||||||
configService
|
secret: configService.get<string>('jwt.secret') || 'dev_secret_key',
|
||||||
.get<string>('jwt.expiresIn')
|
signOptions: {
|
||||||
?.replace(/[^0-9]/g, '') || '7200',
|
expiresIn: expiresIn as any,
|
||||||
),
|
},
|
||||||
},
|
};
|
||||||
}),
|
},
|
||||||
inject: [ConfigService],
|
inject: [ConfigService],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user