|
@@ -73,9 +73,7 @@ const login = (formEl: FormInstance | undefined) => {
|
|
|
return false as any;
|
|
|
}
|
|
|
loginLoading.value = true;
|
|
|
- //console.log(ruleForm.value);
|
|
|
post(LOGIN, { ...ruleForm.value }).then(res => {
|
|
|
- //console.log(res);
|
|
|
if(res.code == 'error') {
|
|
|
globalPopup?.showError(res.msg)
|
|
|
loginLoading.value = false;
|
|
@@ -84,10 +82,18 @@ const login = (formEl: FormInstance | undefined) => {
|
|
|
globalPopup?.showSuccess('登录成功')
|
|
|
sessionStorage.setItem('token', res.data.id)
|
|
|
setValue(res.data, 'userInfo')
|
|
|
+ // 将数据分析放到第一位
|
|
|
+ const index = res.data?.moduleList.findIndex((obj: any) => obj.path === '/analysis');
|
|
|
+ if (index !== -1) {
|
|
|
+ const item = res.data?.moduleList.splice(index, 1)[0];
|
|
|
+ res.data?.moduleList.unshift(item);
|
|
|
+ }
|
|
|
+ console.log(res.data?.moduleList)
|
|
|
setValue(res.data?.moduleList, 'routers')
|
|
|
setTimeout(() => {
|
|
|
loginLoading.value = false;
|
|
|
- router.push(res.data?.moduleList[0].path);
|
|
|
+ // router.push(res.data?.moduleList[0].path);
|
|
|
+ router.push('/analysis');
|
|
|
}, 100)
|
|
|
}).catch(_err => {
|
|
|
loginLoading.value = false;
|