diff --git a/.env.development b/.env.development
index c85a7f7..8b6528e 100644
--- a/.env.development
+++ b/.env.development
@@ -1,2 +1,2 @@
BASE_URL= "https://vue3.go-admin.dev"
-VITE_BASE_URL= "http://dev.hospital.admin.igandanyiyuan.com"
+VITE_BASE_URL= "http://dev.hospital.admin.api.igandanyiyuan.com"
diff --git a/src/api/admin/login.js b/src/api/admin/login.js
index 9ce7b45..7a43ede 100644
--- a/src/api/admin/login.js
+++ b/src/api/admin/login.js
@@ -24,7 +24,7 @@ export function getAppConfig() {
// 根据角色获取菜单
export function getUserMenuRole() {
return request({
- url:'/api/v1/menurole',
+ url:'https://www.fastmock.site/mock/ebb1956b65d6078940cacb295a06be27/mock/menu',//'https://www.fastmock.site/mock/ebb1956b65d6078940cacb295a06be27/mock/menu',
method: 'get'
})
}
\ No newline at end of file
diff --git a/src/layout/components/Avatar/index.vue b/src/layout/components/Avatar/index.vue
index b4d26e4..1d49fda 100644
--- a/src/layout/components/Avatar/index.vue
+++ b/src/layout/components/Avatar/index.vue
@@ -5,7 +5,7 @@
-
{{ userInfo.name }}
+
{{ userInfo.nick_name }}
diff --git a/src/layout/components/Menu/Menu.vue b/src/layout/components/Menu/Menu.vue
index 1b1cec9..138ddfb 100644
--- a/src/layout/components/Menu/Menu.vue
+++ b/src/layout/components/Menu/Menu.vue
@@ -45,6 +45,8 @@ const keepDefaultSelect = () => {
};
const handleMenuClick = (key) => {
+ console.log(key)
+ console.log(router.getRoutes())
router.push(key);
};
diff --git a/src/layout/components/Menu/SubMenu.vue b/src/layout/components/Menu/SubMenu.vue
index 84d9a23..d041d62 100644
--- a/src/layout/components/Menu/SubMenu.vue
+++ b/src/layout/components/Menu/SubMenu.vue
@@ -1,22 +1,21 @@
-
+
-
- {{ menu.title }}
+
+
+
+ {{ menu.title }}1
{{ menu.title }}
+ >{{ menu.title }}2
-
-
+
+
+
diff --git a/src/views/admin/role/index.vue b/src/views/admin/role/index.vue
new file mode 100644
index 0000000..7bad1cd
--- /dev/null
+++ b/src/views/admin/role/index.vue
@@ -0,0 +1,12 @@
+
+ 我是角色ye
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/admin/sys-api/index.vue b/src/views/admin/sys-api/index.vue
index 7032a2e..4f442f4 100644
--- a/src/views/admin/sys-api/index.vue
+++ b/src/views/admin/sys-api/index.vue
@@ -246,8 +246,8 @@ onMounted(() => {
display: flex;
justify-content: flex-end;
}
-
-// Table 操作列样式
+/*
+Table 操作列样式 */
.arco-table-th:last-child > span {
margin-left: 15px;
}
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 41ddfb1..3e0af37 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -26,9 +26,9 @@
layout="vertical"
@keyup.enter="handleLogin"
>
-
+
@@ -36,9 +36,9 @@
-
+
@@ -48,9 +48,9 @@
-
+
@@ -106,16 +106,16 @@ const loading = ref(false);
// rules
const loginRules = {
- userName: [{ required: true, message: '请输入用户名' }],
- passWord: [{ required: true, message: '请输入密码' }],
- code: [{ required: true, message: '请输入验证码' }],
+ access: [{ required: true, message: '请输入用户名' }],
+ password: [{ required: true, message: '请输入密码' }],
+ captcha: [{ required: true, message: '请输入验证码' }],
};
// 获取验证码
const loadCaptcha = async () => {
const res = await getCaptcha();
- captchUrl.value = res.data;
- loginForm.uuid = res.id;
+ captchUrl.value = res.data.b64s;
+ loginForm.captchaId = res.data.id;
};
// 登陆
@@ -125,19 +125,25 @@ const handleLogin = () => {
proxy.$refs.loginFormRef.validate(async (valid) => {
if (!valid) {
try {
- const { code, token, msg } = await login(loginForm);
+ const { code, data, msg } = await login(loginForm);
if ( code == 200 ) {
- await store.setToken(token);
+ const {avatar,nick_name,token,user_id}=data;
+ const userInfo={
+ nick_name,
+ avatar,
+ user_id
+ }
+ await store.setInfo(token,userInfo);
proxy.$message.success({
content: '登陆成功',
duration: 2000,
});
setTimeout(() => {
- proxy.$router.push('/admin/sys-api');
- loading.value = false;
+ proxy.$router.push('/admin/role');
+ loading.value = false;
}, 500);
} else {
- proxy.$message.error(`登陆失败:${msg}`);
+ proxy.$message.error(`登陆失败:${message}`);
}
} catch (err) {
// 登录失败 重新获取验证码
@@ -170,14 +176,14 @@ onMounted(async () => {
border-color: #e5e7eb;
}
-// 输入框重写
+
.arco-input-wrapper {
border-radius: 20px;
height: 40px;
border: 1px solid #ddd;
background: #fff;
}
-// 输入框 重写框颜色
+
.arco-input-wrapper:hover {
background: #fff;
border: 1px solid #1e6fff;
@@ -201,13 +207,13 @@ onMounted(async () => {
.account-wrap-login {
width: 960px;
height: 554px;
- // background: #fff;
+ /* background: #fff; */
border-radius: 10px;
overflow: hidden;
display: flex;
flex-wrap: wrap;
- // justify-content:space-between;
- // padding:30px 95px 33px
+ /* justify-content:space-between;
+ padding:30px 95px 33px */
}
.account-wrap-login .login-pic {
background-color: #0259e6 !important;
@@ -283,7 +289,7 @@ onMounted(async () => {
}
}
-// 20230105 自动填充背景色问题
+ /* 20230105 自动填充背景色问题 */
:deep(.arco-input-wrapper .arco-input.arco-input-size-medium) {
box-shadow: 0 0 0px 1000px #fff inset;
}
diff --git a/vite.config.js b/vite.config.js
index 38955b9..534f3ed 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -28,7 +28,8 @@ export default defineConfig({
}
},
server: {
-
+ host: true,
+ port: 1798,
//secure: false,
proxy: {
// '/api': {