feat: 系统引导使用接口变更

This commit is contained in:
TsMask
2024-05-07 16:27:45 +08:00
parent 60a26dd015
commit b76fed7dcf
5 changed files with 30 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { guideDone } from '@/api';
import { bootloaderDone } from '@/api';
import { stepState, fnToStepName } from '../hooks/useStep';
import { message, Form, Modal } from 'ant-design-vue/lib';
import { Modal } from 'ant-design-vue/lib';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { removeToken } from '@/plugins/auth-token';
import { useRouter } from 'vue-router';
@@ -68,11 +68,11 @@ function fnStepPrev() {
/**引导完成 */
function fnGuideDone() {
guideDone()
bootloaderDone()
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
removeToken();
useAppStore().sysGuide = false;
useAppStore().bootloader = false;
}
})
.finally(() => {

View File

@@ -1,11 +1,10 @@
<script setup lang="ts">
import { onMounted, reactive } from 'vue';
import { fnToStepName } from '../hooks/useStep';
import { guideStart } from '@/api';
import { bootloaderStart } from '@/api';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import { TOKEN_RESPONSE_FIELD } from '@/constants/token-constants';
import { getToken, setToken } from '@/plugins/auth-token';
import { Modal, message } from 'ant-design-vue/lib';
import { getToken, setToken } from '@/plugins/auth-token';
import { useRouter } from 'vue-router';
import useI18n from '@/hooks/useI18n';
const { t, changeLocale, optionsLocale } = useI18n();
@@ -18,7 +17,7 @@ const state = reactive({
/**引导开始 */
function fnGuideStart() {
if (getToken()) return;
guideStart().then(res => {
bootloaderStart().then(res => {
if (res.code === RESULT_CODE_SUCCESS && res.data) {
const token = res.data[TOKEN_RESPONSE_FIELD];
setToken(token);