diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs index babd9cfc..c846a8cf 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs @@ -104,8 +104,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers [HttpPost] public async Task AddChildrenMenu(ChildrenDto childrenDto) { - - var _children= await _menuService.AddChildrenMenu(childrenDto.parentId, childrenDto.data); + await _menuService.AddChildrenMenu(childrenDto.parentId, childrenDto.data); return Result.Success(); } /// diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs index da355365..b6964d14 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/UserController.cs @@ -122,6 +122,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// 根据http上下文的用户得到该用户信息,关联角色 /// /// + [Authorize] [HttpGet] public async Task GetUserInfoById() { diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml b/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml index 33289157..cad3e2be 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml @@ -32,6 +32,13 @@ + + + 修改密码 + + + + 更 diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-shm b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-shm deleted file mode 100644 index fe9ac284..00000000 Binary files a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-shm and /dev/null differ diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-wal b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db-wal deleted file mode 100644 index e69de29b..00000000 diff --git a/Yi.Vue/src/api/accountApi.js b/Yi.Vue/src/api/accountApi.js index fa7645e4..c0e19022 100644 --- a/Yi.Vue/src/api/accountApi.js +++ b/Yi.Vue/src/api/accountApi.js @@ -28,6 +28,13 @@ export default { url: `/Account/email?emailAddress=${emailAddress}`, method: 'post', }) + }, + changePassword(user, newPassword) { + return myaxios({ + url: `/Account/changePassword`, + method: 'put', + data: { user, newPassword } + }) } } \ No newline at end of file diff --git a/Yi.Vue/src/api/menuApi.js b/Yi.Vue/src/api/menuApi.js index ad21a96b..6143cfbd 100644 --- a/Yi.Vue/src/api/menuApi.js +++ b/Yi.Vue/src/api/menuApi.js @@ -40,5 +40,11 @@ export default { method: 'post', data: { id1: menuId, id2: mouldId } }) + }, + geTopMenuByUser() { + return myaxios({ + url: '/Menu/geTopMenuByUser', + method: 'get' + }) } } \ No newline at end of file diff --git a/Yi.Vue/src/api/userApi.js b/Yi.Vue/src/api/userApi.js index 6fba2ccb..160fe868 100644 --- a/Yi.Vue/src/api/userApi.js +++ b/Yi.Vue/src/api/userApi.js @@ -19,5 +19,11 @@ export default { url: `/User/GetRolesByUserId?userId=${userId}`, method: 'get' }) + }, + GetUserInfoById() { + return myaxios({ + url: `/User/GetUserInfoById`, + method: 'get' + }) } } \ No newline at end of file diff --git a/Yi.Vue/src/util/myaxios.js b/Yi.Vue/src/util/myaxios.js index 7f96c754..4929f207 100644 --- a/Yi.Vue/src/util/myaxios.js +++ b/Yi.Vue/src/util/myaxios.js @@ -49,14 +49,33 @@ myaxios.interceptors.response.use(async function(response) { store.dispatch("closeLoad"); return resp; -}, function(error) { - +}, async function(error) { const resp = error.response.data if (resp.code == undefined && resp.msg == undefined) { vm.$dialog.notify.error("错误代码:无,原因:与服务器失去连接", { position: "top-right", timeout: 5000, }); + } else if (resp.code == 401) { + const res = await vm.$dialog.error({ + text: `错误代码:${resp.code},原因:${resp.msg}
是否重新进行登录?`, + title: '错误', + actions: { + 'false': '取消', + 'true': '跳转' + } + }); + if (res) { + vm.$store.dispatch("Logout").then((resp) => { + vm.$router.push({ path: "/login" }); + }); + } + + } else if (resp.code !== 200) { + vm.$dialog.notify.error(`错误代码:${resp.code},原因:${resp.msg}`, { + position: "top-right", + timeout: 5000, + }); } store.dispatch("closeLoad"); diff --git a/Yi.Vue/src/views/AdmUser.vue b/Yi.Vue/src/views/AdmUser.vue index fe42156d..89f1cf25 100644 --- a/Yi.Vue/src/views/AdmUser.vue +++ b/Yi.Vue/src/views/AdmUser.vue @@ -108,6 +108,8 @@ strInfo+="
" { text: "邮箱", value: "email", sortable: true }, { text: "IP", value: "ip", sortable: false }, { text: "年龄", value: "age", sortable: false }, + { text: "地址", value: "address", sortable: false }, + { text: "电话", value: "phone", sortable: false }, { text: "操作", value: "actions", sortable: false }, ], defaultItem: { @@ -116,6 +118,8 @@ strInfo+="
" icon: "mdi-lock", nick: "橙子", age: 18, + address:"中国", + phone:"" }, }), }; diff --git a/Yi.Vue/src/views/userInfo.vue b/Yi.Vue/src/views/userInfo.vue index 031c9563..a63a4f83 100644 --- a/Yi.Vue/src/views/userInfo.vue +++ b/Yi.Vue/src/views/userInfo.vue @@ -10,11 +10,13 @@ /> -
橙子
+
+ {{ userInfo.username }} +
-

橙子大大

+

{{ userInfo.nick }}

-

我认为世界有我而更精彩!难道不是吗?

+

{{ userInfo.introduction }}

编辑头像 @@ -31,7 +33,7 @@ - + 账户信息 mdi-phone @@ -51,192 +53,179 @@ - -
Account Information
- - - - - - - - - - + +
Account Information
+ + + + + + + + + + - - - - - - - - - - - - -
+ + + + + + + + + +
+
- - - -
Extra Information
- - - - - - mdi-phone - + + +
Extra Information
+ + + + + + mdi-phone + - - 等级: - 100 - + + 等级: + 100 + - - mdi-message-text - - + + mdi-message-text + +
- - + + - - 经验: - 1000 - + + 经验: + 1000 + - - mdi-message-text - - + + mdi-message-text + + - + - - - mdi-lock - + + + mdi-lock + - - 拥有角色: - - - 管理员 - - - - - - + + 拥有角色: + + + {{item.role_name}} + + + + + + - - 拥有接口: - - - 增删改查 - - - - + + 拥有菜单: + + + {{menuInfo.menu_name}} + + + + - + - - - mdi-email - + + + mdi-email + - - 发帖总数: - 1000 - - - - - - - - 评论总数: - 500 - - - - - - - - 查看主题 - - - - -
-
- -
-
-
+ + 等待更新: + 1000 + + + + + + 等待更新: + 500 + + + + + + + 等待更新 + + + + + + + +
+ -
Password Information
- - - - -
+
Password Information
+ + + + +
-
+ - - - - - - 清空 - - 保存 - + + 清空 + 保存 + @@ -245,10 +234,48 @@