Skip to content

Commit

Permalink
Merge pull request #12 from beclab/fix/notify
Browse files Browse the repository at this point in the history
fix: Add notify when login err
  • Loading branch information
wushuangs authored Aug 15, 2024
2 parents a3b56ce + 4ef49ba commit 2c31461
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
30 changes: 21 additions & 9 deletions packages/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@bytetrade/core": "0.3.45",
"@bytetrade/ui": "^0.0.74",
"@bytetrade/ui": "^0.1.17",
"@quasar/extras": "^1.16.9",
"axios": "^0.21.1",
"fetch": "1.1.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend/src/boot/smartEnginEntrance.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { boot } from 'quasar/wrappers';
import BytetradeUi from '@bytetrade/ui';
import BytetradeUi, { BtNotify } from '@bytetrade/ui';
import { Notify } from 'quasar';

export default boot(async ({ app }) => {
app.use(BytetradeUi);
BtNotify.init(Notify);
});
7 changes: 7 additions & 0 deletions packages/frontend/src/pages/FirstLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useTokenStore } from 'src/stores/token';
import { CurrentView } from 'src/constants/index';
import { BtNotify, NotifyDefinedType } from '@bytetrade/ui';
const { t } = useI18n();
const tokenStore = useTokenStore();
Expand Down Expand Up @@ -93,6 +94,12 @@ const onLogin = async () => {
}
}
} catch (err) {
console.log('eeee', err.response.data);
BtNotify.show({
type: NotifyDefinedType.MESSAGE,
message: err.response.data.message
});
await shakeInput();
await handleClearInput();
} finally {
Expand Down

0 comments on commit 2c31461

Please sign in to comment.