feat : role And permission
This commit is contained in:
@@ -23,7 +23,7 @@ Future<void> setupLiveStockDI() async {
|
||||
final tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
if (tokenService.baseurl.value == null) {
|
||||
await tokenService.saveBaseUrl('https://api.dam.rasadyar.net/');
|
||||
await tokenService.saveBaseUrl(Module.inspection,'https://api.dam.rasadyar.net/');
|
||||
}
|
||||
|
||||
// First register AppInterceptor with lazy callbacks
|
||||
@@ -42,10 +42,10 @@ Future<void> setupLiveStockDI() async {
|
||||
return null;
|
||||
},
|
||||
saveTokenCallback: (String newToken) async {
|
||||
await tokenService.saveAccessToken(newToken);
|
||||
// await tokenService.saveAccessToken(newToken);
|
||||
},
|
||||
clearTokenCallback: () async {
|
||||
await tokenService.deleteTokens();
|
||||
await tokenService.deleteAllTokens();
|
||||
Get.offAllNamed(LiveStockRoutes.auth, arguments: Module.liveStocks);
|
||||
},
|
||||
authArguments: Module.liveStocks,
|
||||
|
||||
@@ -126,7 +126,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
call: () async => await authRepository.login(authRequest: loginRequestModel.toJson()),
|
||||
onSuccess: (result) async {
|
||||
await tokenStorageService.saveModule(_module);
|
||||
await tokenStorageService.saveRefreshToken(result?.refresh ?? '');
|
||||
/* await tokenStorageService.saveRefreshToken(result?.refresh ?? '');
|
||||
await tokenStorageService.saveAccessToken(result?.access ?? '');
|
||||
if (rememberMe.value) {
|
||||
await tokenStorageService.saveUserPass(
|
||||
@@ -136,7 +136,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
module: _module,
|
||||
),
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
Get.offAllNamed(LiveStockRoutes.init);
|
||||
},
|
||||
|
||||
@@ -11,7 +11,12 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
body:PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (didPop, result) {
|
||||
Get.back(result: -1);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
@@ -97,7 +102,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -683,7 +683,7 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
text: 'خروج',
|
||||
backgroundColor: AppColor.error,
|
||||
onPressed: () async {
|
||||
await controller.rootLogic.tokenService.deleteTokens().then((value) {
|
||||
await controller.rootLogic.tokenService.deleteAllTokens().then((value) {
|
||||
Get.back();
|
||||
Get.offAllNamed(LiveStockRoutes.auth, arguments: Module.chicken);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user