Browse Source

User/delete (#74)

* feat: add delete user api

* feat:update frontend resources
master
vran 3 years ago
committed by GitHub
parent
commit
a880778f6e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      api/src/main/java/com/databasir/api/Routes.java
  2. 13
      api/src/main/java/com/databasir/api/UserController.java
  3. 2
      api/src/main/resources/static/index.html
  4. 2
      api/src/main/resources/static/js/101-legacy.762f538b.js
  5. 2
      api/src/main/resources/static/js/101-legacy.762f538b.js.map
  6. 2
      api/src/main/resources/static/js/101.c46eda9a.js
  7. 2
      api/src/main/resources/static/js/101.c46eda9a.js.map
  8. 2
      api/src/main/resources/static/js/117-legacy.5a8a817f.js
  9. 2
      api/src/main/resources/static/js/117-legacy.5a8a817f.js.map
  10. 2
      api/src/main/resources/static/js/139-legacy.b3ab46a9.js
  11. 2
      api/src/main/resources/static/js/139-legacy.b3ab46a9.js.map
  12. 2
      api/src/main/resources/static/js/139.338f8cdc.js
  13. 2
      api/src/main/resources/static/js/139.338f8cdc.js.map
  14. 2
      api/src/main/resources/static/js/146-legacy.ba4f1d2b.js
  15. 2
      api/src/main/resources/static/js/146-legacy.ba4f1d2b.js.map
  16. 2
      api/src/main/resources/static/js/146.dc9458dc.js
  17. 2
      api/src/main/resources/static/js/146.dc9458dc.js.map
  18. 2
      api/src/main/resources/static/js/243-legacy.8e2218d7.js
  19. 2
      api/src/main/resources/static/js/243-legacy.8e2218d7.js.map
  20. 2
      api/src/main/resources/static/js/243.d82073b3.js
  21. 2
      api/src/main/resources/static/js/243.d82073b3.js.map
  22. 2
      api/src/main/resources/static/js/414-legacy.d93814b8.js
  23. 1
      api/src/main/resources/static/js/414-legacy.d93814b8.js.map
  24. 2
      api/src/main/resources/static/js/414.635bff5a.js
  25. 1
      api/src/main/resources/static/js/414.635bff5a.js.map
  26. 2
      api/src/main/resources/static/js/459-legacy.43cbc678.js
  27. 2
      api/src/main/resources/static/js/459-legacy.43cbc678.js.map
  28. 2
      api/src/main/resources/static/js/459.3cf4a06a.js
  29. 1
      api/src/main/resources/static/js/459.3cf4a06a.js.map
  30. 2
      api/src/main/resources/static/js/459.d78be801.js
  31. 1
      api/src/main/resources/static/js/459.d78be801.js.map
  32. 2
      api/src/main/resources/static/js/469-legacy.b0c9ae4b.js
  33. 1
      api/src/main/resources/static/js/469-legacy.b0c9ae4b.js.map
  34. 2
      api/src/main/resources/static/js/469-legacy.c7a09cfa.js
  35. 1
      api/src/main/resources/static/js/469-legacy.c7a09cfa.js.map
  36. 1
      api/src/main/resources/static/js/469.609a9412.js.map
  37. 4
      api/src/main/resources/static/js/469.70845a6a.js
  38. 1
      api/src/main/resources/static/js/469.70845a6a.js.map
  39. 2
      api/src/main/resources/static/js/564.d209a2a0.js
  40. 2
      api/src/main/resources/static/js/564.d209a2a0.js.map
  41. 2
      api/src/main/resources/static/js/596-legacy.c074f3a2.js
  42. 2
      api/src/main/resources/static/js/596-legacy.c074f3a2.js.map
  43. 2
      api/src/main/resources/static/js/596.c5d055fb.js
  44. 1
      api/src/main/resources/static/js/596.c5d055fb.js.map
  45. 2
      api/src/main/resources/static/js/596.cc084305.js
  46. 1
      api/src/main/resources/static/js/596.cc084305.js.map
  47. 2
      api/src/main/resources/static/js/754-legacy.8ce78db0.js
  48. 2
      api/src/main/resources/static/js/754-legacy.8ce78db0.js.map
  49. 2
      api/src/main/resources/static/js/754.d964c8b8.js
  50. 2
      api/src/main/resources/static/js/754.d964c8b8.js.map
  51. 2
      api/src/main/resources/static/js/865-legacy.95ef57b0.js
  52. 2
      api/src/main/resources/static/js/865-legacy.95ef57b0.js.map
  53. 2
      api/src/main/resources/static/js/865.8a397b0a.js
  54. 2
      api/src/main/resources/static/js/865.8a397b0a.js.map
  55. 1
      api/src/main/resources/static/js/924-legacy.3ccd761f.js.map
  56. 4
      api/src/main/resources/static/js/924-legacy.890aead4.js
  57. 1
      api/src/main/resources/static/js/924-legacy.890aead4.js.map
  58. 2
      api/src/main/resources/static/js/979-legacy.2177bee0.js
  59. 1
      api/src/main/resources/static/js/979-legacy.2177bee0.js.map
  60. 2
      api/src/main/resources/static/js/979.62f03bb7.js
  61. 1
      api/src/main/resources/static/js/979.62f03bb7.js.map
  62. 2
      api/src/main/resources/static/js/99-legacy.0cf27260.js
  63. 2
      api/src/main/resources/static/js/99-legacy.0cf27260.js.map
  64. 2
      api/src/main/resources/static/js/99.810cec85.js
  65. 2
      api/src/main/resources/static/js/99.810cec85.js.map
  66. 4
      api/src/main/resources/static/js/app-legacy.068b0ad8.js
  67. 2
      api/src/main/resources/static/js/app-legacy.068b0ad8.js.map
  68. 4
      api/src/main/resources/static/js/app.42acff90.js
  69. 2
      api/src/main/resources/static/js/app.42acff90.js.map
  70. 1
      core/src/main/java/com/databasir/core/domain/DomainErrors.java
  71. 8
      core/src/main/java/com/databasir/core/domain/user/service/UserService.java
  72. 4
      dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java
  73. 18
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/User.java
  74. 38
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/UserPojo.java
  75. 120
      dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/UserRecord.java
  76. 54
      dao/src/main/java/com/databasir/dao/impl/UserDao.java
  77. 24
      dao/src/main/resources/db/migration/V1__init.sql

2
api/src/main/java/com/databasir/api/Routes.java

@ -10,6 +10,8 @@ public interface Routes {
String GET_ONE = BASE + "/users/{userId}";
String DELETE_ONE = BASE + "/users/{userId}";
String ENABLE = BASE + "/users/{userId}/enable";
String DISABLE = BASE + "/users/{userId}/disable";

13
api/src/main/java/com/databasir/api/UserController.java

@ -8,7 +8,6 @@ import com.databasir.core.domain.DomainErrors;
import com.databasir.core.domain.log.annotation.Operation;
import com.databasir.core.domain.user.data.*;
import com.databasir.core.domain.user.service.UserService;
import com.databasir.core.infrastructure.event.EventPublisher;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@ -29,8 +28,6 @@ public class UserController {
private final UserOperationValidator userOperationValidator;
private final EventPublisher eventPublisher;
@GetMapping(Routes.User.LIST)
public JsonData<Page<UserPageResponse>> list(@PageableDefault(sort = "id", direction = Sort.Direction.DESC)
Pageable pageable,
@ -73,6 +70,16 @@ public class UserController {
return JsonData.ok(userService.get(userId));
}
@DeleteMapping(Routes.User.DELETE_ONE)
@PreAuthorize("hasAnyAuthority('SYS_OWNER')")
public JsonData<Void> deleteOne(@PathVariable Integer userId) {
if (userOperationValidator.isMyself(userId)) {
throw DomainErrors.CANNOT_DELETE_SELF.exception();
}
userService.deleteOne(userId);
return JsonData.ok();
}
@PostMapping(Routes.User.RENEW_PASSWORD)
@PreAuthorize("hasAnyAuthority('SYS_OWNER')")
@Operation(module = Operation.Modules.USER, name = "重置用户密码", involvedUserId = "#userId")

2
api/src/main/resources/static/index.html

@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.34b8254e.js"></script><script defer="defer" type="module" src="/js/app.969627b4.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.ca7b1117.js" nomodule></script><script defer="defer" src="/js/app-legacy.26c8cf98.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.34b8254e.js"></script><script defer="defer" type="module" src="/js/app.42acff90.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.ca7b1117.js" nomodule></script><script defer="defer" src="/js/app-legacy.068b0ad8.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

2
api/src/main/resources/static/js/101-legacy.fe788b74.js → api/src/main/resources/static/js/101-legacy.762f538b.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/101-legacy.fe788b74.js.map → api/src/main/resources/static/js/101-legacy.762f538b.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/101.f397f8a9.js → api/src/main/resources/static/js/101.c46eda9a.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/101.f397f8a9.js.map → api/src/main/resources/static/js/101.c46eda9a.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/117-legacy.e08db215.js → api/src/main/resources/static/js/117-legacy.5a8a817f.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/117-legacy.e08db215.js.map → api/src/main/resources/static/js/117-legacy.5a8a817f.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/139-legacy.c7c6213a.js → api/src/main/resources/static/js/139-legacy.b3ab46a9.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/139-legacy.c7c6213a.js.map → api/src/main/resources/static/js/139-legacy.b3ab46a9.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/139.23e83679.js → api/src/main/resources/static/js/139.338f8cdc.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/139.23e83679.js.map → api/src/main/resources/static/js/139.338f8cdc.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/146-legacy.1c773831.js → api/src/main/resources/static/js/146-legacy.ba4f1d2b.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/146-legacy.1c773831.js.map → api/src/main/resources/static/js/146-legacy.ba4f1d2b.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/146.08f4ba55.js → api/src/main/resources/static/js/146.dc9458dc.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/146.08f4ba55.js.map → api/src/main/resources/static/js/146.dc9458dc.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/243-legacy.92016c20.js → api/src/main/resources/static/js/243-legacy.8e2218d7.js

@ -1,2 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[243],{1243:function(e,t,n){n.r(t),n.d(t,{default:function(){return W}});var r=n(6252),u=(0,r.Uk)(" 系统邮箱设置 "),o=(0,r.Uk)(" : "),l=(0,r.Uk)("保存"),a=(0,r.Uk)("重置");function s(e,t,n,s,i,m){var f=(0,r.up)("box"),d=(0,r.up)("el-icon"),p=(0,r.up)("el-divider"),c=(0,r.up)("el-input"),w=(0,r.up)("el-form-item"),h=(0,r.up)("el-col"),g=(0,r.up)("el-switch"),W=(0,r.up)("el-button"),V=(0,r.up)("el-form"),S=(0,r.up)("el-card"),_=(0,r.up)("el-main"),b=(0,r.up)("el-container");return(0,r.wg)(),(0,r.j4)(b,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(_,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(S,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(d,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(f)]})),_:1}),u]})),_:1}),(0,r.Wm)(V,{model:i.form,"label-position":"top",rules:i.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(w,{label:"邮箱账号",prop:"username"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.username,"onUpdate:modelValue":t[0]||(t[0]=function(e){return i.form.username=e}),placeholder:"请输入邮箱账号"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"邮箱密码",prop:"password"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.password,"onUpdate:modelValue":t[1]||(t[1]=function(e){return i.form.password=e}),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"SMTP",prop:"smtpHost"},{default:(0,r.w5)((function(){return[(0,r.Wm)(h,{span:12},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.smtpHost,"onUpdate:modelValue":t[2]||(t[2]=function(e){return i.form.smtpHost=e}),placeholder:"SMTP Host"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(h,{span:1,style:{"text-align":"center"}},{default:(0,r.w5)((function(){return[o]})),_:1}),(0,r.Wm)(h,{span:6},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.smtpPort,"onUpdate:modelValue":t[3]||(t[3]=function(e){return i.form.smtpPort=e}),placeholder:"SMTP Port"},null,8,["modelValue"])]})),_:1})]})),_:1}),(0,r.Wm)(w,{label:"启用 SSL",prop:"useSSL"},{default:(0,r.w5)((function(){return[(0,r.Wm)(g,{modelValue:i.form.useSSL,"onUpdate:modelValue":t[4]||(t[4]=function(e){return i.form.useSSL=e})},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{style:{"margin-top":"38px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(W,{type:"primary",onClick:t[5]||(t[5]=function(e){return m.onSubmit("formRef")})},{default:(0,r.w5)((function(){return[l]})),_:1}),(0,r.Wm)(W,{type:"danger",onClick:t[6]||(t[6]=function(e){return m.onReset()})},{default:(0,r.w5)((function(){return[a]})),_:1})]})),_:1})]})),_:1},8,["model","rules"])]})),_:1})]})),_:1})]})),_:1})}var i=n(8534),m=(n(5666),n(3872)),f="/api/v1.0/settings",d=function(){return m.Z.get(f+"/sys_email")},p=function(e){return m.Z.post(f+"/sys_email",e)},c=function(){return m.Z["delete"](f+"/sys_email")},w={data:function(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null,useSSL:!1},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted:function(){this.fetchSysMail()},methods:{requiredInputValidRule:function(e){return{required:!0,message:e,trigger:"blur"}},fetchSysMail:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,d().then((function(e){return e.data}));case 2:n=t.sent,n&&(e.form=n);case 4:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;this.$refs.formRef.validate((function(t){return t?(p(e.form).then((function(t){t.errCode||e.$message.success("更新成功")})),!0):(e.$message.error("请完善表单相关信息!"),!1)}))},onReset:function(){var e=this;this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){c().then((function(t){t.errCode||(e.form={},e.$message.success("重置成功"))}))}))}}},h=n(3744);const g=(0,h.Z)(w,[["render",s]]);var W=g}}]);
//# sourceMappingURL=243-legacy.92016c20.js.map
//# sourceMappingURL=243-legacy.8e2218d7.js.map

2
api/src/main/resources/static/js/243-legacy.92016c20.js.map → api/src/main/resources/static/js/243-legacy.8e2218d7.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/243.e2c9f564.js → api/src/main/resources/static/js/243.d82073b3.js

@ -1,2 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[243],{1243:function(e,l,t){t.r(l),t.d(l,{default:function(){return W}});var a=t(6252);const s=(0,a.Uk)(" 系统邮箱设置 "),r=(0,a.Uk)(" : "),u=(0,a.Uk)("保存"),o=(0,a.Uk)("重置");function m(e,l,t,m,n,d){const p=(0,a.up)("box"),i=(0,a.up)("el-icon"),f=(0,a.up)("el-divider"),c=(0,a.up)("el-input"),h=(0,a.up)("el-form-item"),w=(0,a.up)("el-col"),W=(0,a.up)("el-switch"),V=(0,a.up)("el-button"),g=(0,a.up)("el-form"),S=(0,a.up)("el-card"),_=(0,a.up)("el-main"),b=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(b,null,{default:(0,a.w5)((()=>[(0,a.Wm)(_,null,{default:(0,a.w5)((()=>[(0,a.Wm)(S,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(i,null,{default:(0,a.w5)((()=>[(0,a.Wm)(p)])),_:1}),s])),_:1}),(0,a.Wm)(g,{model:n.form,"label-position":"top",rules:n.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{label:"邮箱账号",prop:"username"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.username,"onUpdate:modelValue":l[0]||(l[0]=e=>n.form.username=e),placeholder:"请输入邮箱账号"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"邮箱密码",prop:"password"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.password,"onUpdate:modelValue":l[1]||(l[1]=e=>n.form.password=e),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"SMTP",prop:"smtpHost"},{default:(0,a.w5)((()=>[(0,a.Wm)(w,{span:12},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.smtpHost,"onUpdate:modelValue":l[2]||(l[2]=e=>n.form.smtpHost=e),placeholder:"SMTP Host"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(w,{span:1,style:{"text-align":"center"}},{default:(0,a.w5)((()=>[r])),_:1}),(0,a.Wm)(w,{span:6},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:n.form.smtpPort,"onUpdate:modelValue":l[3]||(l[3]=e=>n.form.smtpPort=e),placeholder:"SMTP Port"},null,8,["modelValue"])])),_:1})])),_:1}),(0,a.Wm)(h,{label:"启用 SSL",prop:"useSSL"},{default:(0,a.w5)((()=>[(0,a.Wm)(W,{modelValue:n.form.useSSL,"onUpdate:modelValue":l[4]||(l[4]=e=>n.form.useSSL=e)},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{style:{"margin-top":"38px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(V,{type:"primary",onClick:l[5]||(l[5]=e=>d.onSubmit("formRef"))},{default:(0,a.w5)((()=>[u])),_:1}),(0,a.Wm)(V,{type:"danger",onClick:l[6]||(l[6]=e=>d.onReset())},{default:(0,a.w5)((()=>[o])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])),_:1})}var n=t(3872);const d="/api/v1.0/settings",p=()=>n.Z.get(d+"/sys_email"),i=e=>n.Z.post(d+"/sys_email",e),f=()=>n.Z["delete"](d+"/sys_email");var c={data(){return{form:{smtpHost:null,smtpPort:null,username:null,password:null,useSSL:!1},formRule:{username:[this.requiredInputValidRule("请输入邮箱账号"),{type:"email",message:"邮箱格式不正确",trigger:"blur"}],password:[this.requiredInputValidRule("请输入邮箱密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted(){this.fetchSysMail()},methods:{requiredInputValidRule(e){return{required:!0,message:e,trigger:"blur"}},async fetchSysMail(){const e=await p().then((e=>e.data));e&&(this.form=e)},onSubmit(){this.$refs.formRef.validate((e=>e?(i(this.form).then((e=>{e.errCode||this.$message.success("更新成功")})),!0):(this.$message.error("请完善表单相关信息!"),!1)))},onReset(){this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{f().then((e=>{e.errCode||(this.form={},this.$message.success("重置成功"))}))}))}}},h=t(3744);const w=(0,h.Z)(c,[["render",m]]);var W=w}}]);
//# sourceMappingURL=243.e2c9f564.js.map
//# sourceMappingURL=243.d82073b3.js.map

2
api/src/main/resources/static/js/243.e2c9f564.js.map → api/src/main/resources/static/js/243.d82073b3.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/414-legacy.d93814b8.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/414-legacy.d93814b8.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/414.635bff5a.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/414.635bff5a.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/459-legacy.f3905f9c.js → api/src/main/resources/static/js/459-legacy.43cbc678.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/459-legacy.f3905f9c.js.map → api/src/main/resources/static/js/459-legacy.43cbc678.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/459.3cf4a06a.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/459.3cf4a06a.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/459.d78be801.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/459.d78be801.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/469-legacy.b0c9ae4b.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/469-legacy.b0c9ae4b.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/469-legacy.c7a09cfa.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/469-legacy.c7a09cfa.js.map

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/469.609a9412.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/469.609a9412.js → api/src/main/resources/static/js/469.70845a6a.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/469.70845a6a.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/564.b084aa8c.js → api/src/main/resources/static/js/564.d209a2a0.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/564.b084aa8c.js.map → api/src/main/resources/static/js/564.d209a2a0.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/596-legacy.1d54812e.js → api/src/main/resources/static/js/596-legacy.c074f3a2.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/596-legacy.1d54812e.js.map → api/src/main/resources/static/js/596-legacy.c074f3a2.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/596.c5d055fb.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/596.c5d055fb.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/596.cc084305.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/596.cc084305.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/754-legacy.9cccfd52.js → api/src/main/resources/static/js/754-legacy.8ce78db0.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/754-legacy.9cccfd52.js.map → api/src/main/resources/static/js/754-legacy.8ce78db0.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/754.94f1d1eb.js → api/src/main/resources/static/js/754.d964c8b8.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/754.94f1d1eb.js.map → api/src/main/resources/static/js/754.d964c8b8.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/865-legacy.55e3080f.js → api/src/main/resources/static/js/865-legacy.95ef57b0.js

@ -1,2 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[865],{8865:function(t,n,e){e.r(n),e.d(n,{default:function(){return f}});var i=e(6252),a=e(9963),r=(0,i.Uk)("立即跳转");function o(t,n,e,o,u,l){var s=(0,i.up)("el-button"),c=(0,i.up)("el-result"),d=(0,i.up)("el-main"),f=(0,i.up)("el-container"),g=(0,i.Q2)("loading");return(0,i.wg)(),(0,i.j4)(f,null,{default:(0,i.w5)((function(){return[(0,i.wy)(((0,i.wg)(),(0,i.j4)(d,{class:"login-main"},{default:(0,i.w5)((function(){return[(0,i.wy)((0,i.Wm)(c,{icon:u.icon,title:u.title,"sub-title":u.subTitle},{extra:(0,i.w5)((function(){return[(0,i.Wm)(s,{type:"primary",onClick:n[0]||(n[0]=function(t){return l.toIndexPage()})},{default:(0,i.w5)((function(){return[r]})),_:1})]})),_:1},8,["icon","title","sub-title"]),[[a.F8,!u.loading]])]})),_:1})),[[g,u.loading]])]})),_:1})}var u=e(152),l=e(1836),s={data:function(){return{registrationId:null,icon:"",title:"",subTitle:"",loading:!0}},created:function(){this.registrationId=this.$route.params.id,this.login()},methods:{login:function(){var t=this,n=window.location.href,e=this.$route.query;e.redirect_uri=n,(0,u.rd)(this.registrationId,e).then((function(n){n.errCode?(t.title=n.errMessage,t.icon="error"):(l.E.saveUserLoginData(n.data),t.$store.commit("userUpdate",{nickname:n.data.nickname,username:n.data.username,email:n.data.email,avatar:n.data.avatar}),t.icon="success",t.$router.push({path:"/groups"})),t.loading=!1})).catch((function(n){console.log("login failed: "+n),t.icon="error",t.title="登陆失败,请重试",t.loading=!1}))},toIndexPage:function(){this.$router.push({path:"/"})}}},c=e(3744);const d=(0,c.Z)(s,[["render",o]]);var f=d}}]);
//# sourceMappingURL=865-legacy.55e3080f.js.map
//# sourceMappingURL=865-legacy.95ef57b0.js.map

2
api/src/main/resources/static/js/865-legacy.55e3080f.js.map → api/src/main/resources/static/js/865-legacy.95ef57b0.js.map

@ -1 +1 @@
{"version":3,"file":"js/865-legacy.55e3080f.js","mappings":"iMAUiE,Q,qKAT7DA,EAAAA,EAAAA,IAaeC,EAAA,M,kBAZX,iBAWU,uBAXVD,EAAAA,EAAAA,IAWUE,EAAA,CAXmBC,MAAM,cAAY,C,kBAC3C,iBASY,WATZC,EAAAA,EAAAA,IASYC,EAAA,CARPC,KAAMC,EAAAA,KACNC,MAAOD,EAAAA,MACP,YAAWA,EAAAA,UAHhB,CAMeE,OAAK,SAChB,iBAAiE,EAAjEL,EAAAA,EAAAA,IAAiEM,EAAA,CAAtDC,KAAK,UAAWC,QAAK,+BAAEC,EAAAA,iBAAlC,C,kBAAiD,iBAAI,O,eAPzD,wCAIaN,EAAAA,e,OALjB,IAAoBA,EAAAA,e,6BA2B5B,GACIO,KADW,WAEP,MAAO,CACHC,eAAgB,KAChBT,KAAM,GACNE,MAAO,GACPQ,SAAU,GACVC,SAAS,IAIjBC,QAXW,WAYPC,KAAKJ,eAAiBI,KAAKC,OAAOC,OAAOC,GACzCH,KAAKI,SAGTC,QAAS,CACJD,MADI,WACI,WACCE,EAAcC,OAAOC,SAASC,KAC9BP,EAASF,KAAKC,OAAOS,MAC3BR,EAAOS,aAAeL,GACtBM,EAAAA,EAAAA,IAAYZ,KAAKJ,eAAgBM,GAAQW,MAAK,SAAAC,GACrCA,EAAKC,SAWN,EAAK1B,MAAQyB,EAAKE,WAClB,EAAK7B,KAAO,UAXZ8B,EAAAA,EAAAA,kBAAuBH,EAAKnB,MAC5B,EAAKuB,OAAOC,OAAO,aAAc,CAC7BC,SAAUN,EAAKnB,KAAKyB,SACpBC,SAAUP,EAAKnB,KAAK0B,SACpBC,MAAOR,EAAKnB,KAAK2B,MACjBC,OAAQT,EAAKnB,KAAK4B,SAEtB,EAAKpC,KAAK,UACV,EAAKqC,QAAQC,KAAK,CAACC,KAAM,aAK7B,EAAK5B,SAAU,KAChB6B,OAAM,SAAAC,GACLC,QAAQC,IAAI,iBAAiBF,GAC7B,EAAKzC,KAAO,QACZ,EAAKE,MAAQ,WACb,EAAKS,SAAU,MAIvBiC,YA7BK,WA8BD/B,KAAKwB,QAAQC,KAAK,CAACC,KAAM,S,UCpErC,MAAMM,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,KAEpE","sources":["webpack://databasir/./src/views/OAuth2Login.vue","webpack://databasir/./src/views/OAuth2Login.vue?b6ea"],"sourcesContent":["<template>\r\n <el-container>\r\n <el-main v-loading=\"loading\" class=\"login-main\">\r\n <el-result\r\n :icon=\"icon\"\r\n :title=\"title\"\r\n :sub-title=\"subTitle\"\r\n v-show=\"!loading\"\r\n >\r\n <template #extra>\r\n <el-button type=\"primary\" @click=\"toIndexPage()\">立即跳转</el-button>\r\n </template>\r\n </el-result>\r\n </el-main>\r\n </el-container>\r\n</template>\r\n\r\n<style>\r\n.login-main {\r\n margin: 0 auto;\r\n margin-top: 200px;\r\n}\r\n\r\n</style>\r\n<script>\r\nimport { oauth2Login } from \"../api/Login\"\r\nimport { user } from \"../utils/auth\"\r\n\r\n\r\nexport default {\r\n data() {\r\n return {\r\n registrationId: null,\r\n icon: '',\r\n title: '',\r\n subTitle: '',\r\n loading: true,\r\n }\r\n },\r\n\r\n created() {\r\n this.registrationId = this.$route.params.id\r\n this.login()\r\n },\r\n\r\n methods: {\r\n login() {\r\n const redirectUri = window.location.href\r\n const params = this.$route.query\r\n params.redirect_uri = redirectUri\r\n oauth2Login(this.registrationId, params).then(resp => {\r\n if (!resp.errCode) {\r\n user.saveUserLoginData(resp.data)\r\n this.$store.commit('userUpdate', {\r\n nickname: resp.data.nickname,\r\n username: resp.data.username,\r\n email: resp.data.email,\r\n avatar: resp.data.avatar\r\n })\r\n this.icon='success'\r\n this.$router.push({path: '/groups'})\r\n } else {\r\n this.title = resp.errMessage\r\n this.icon = 'error'\r\n }\r\n this.loading = false\r\n }).catch(err => {\r\n console.log('login failed: '+err)\r\n this.icon = 'error'\r\n this.title = '登陆失败,请重试'\r\n this.loading = false\r\n })\r\n },\r\n\r\n toIndexPage() {\r\n this.$router.push({path: '/'})\r\n }\r\n }\r\n}\r\n</script>","import { render } from \"./OAuth2Login.vue?vue&type=template&id=65bc9922\"\nimport script from \"./OAuth2Login.vue?vue&type=script&lang=js\"\nexport * from \"./OAuth2Login.vue?vue&type=script&lang=js\"\n\nimport \"./OAuth2Login.vue?vue&type=style&index=0&id=65bc9922&lang=css\"\n\nimport exportComponent from \"E:\\\\git_workspace\\\\databasir-frontend\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["_createBlock","_component_el_container","_component_el_main","class","_createVNode","_component_el_result","icon","$data","title","extra","_component_el_button","type","onClick","$options","data","registrationId","subTitle","loading","created","this","$route","params","id","login","methods","redirectUri","window","location","href","query","redirect_uri","oauth2Login","then","resp","errCode","errMessage","user","$store","commit","nickname","username","email","avatar","$router","push","path","catch","err","console","log","toIndexPage","__exports__","render"],"sourceRoot":""}
{"version":3,"file":"js/865-legacy.95ef57b0.js","mappings":"iMAUiE,Q,qKAT7DA,EAAAA,EAAAA,IAaeC,EAAA,M,kBAZX,iBAWU,uBAXVD,EAAAA,EAAAA,IAWUE,EAAA,CAXmBC,MAAM,cAAY,C,kBAC3C,iBASY,WATZC,EAAAA,EAAAA,IASYC,EAAA,CARPC,KAAMC,EAAAA,KACNC,MAAOD,EAAAA,MACP,YAAWA,EAAAA,UAHhB,CAMeE,OAAK,SAChB,iBAAiE,EAAjEL,EAAAA,EAAAA,IAAiEM,EAAA,CAAtDC,KAAK,UAAWC,QAAK,+BAAEC,EAAAA,iBAAlC,C,kBAAiD,iBAAI,O,eAPzD,wCAIaN,EAAAA,e,OALjB,IAAoBA,EAAAA,e,6BA2B5B,GACIO,KADW,WAEP,MAAO,CACHC,eAAgB,KAChBT,KAAM,GACNE,MAAO,GACPQ,SAAU,GACVC,SAAS,IAIjBC,QAXW,WAYPC,KAAKJ,eAAiBI,KAAKC,OAAOC,OAAOC,GACzCH,KAAKI,SAGTC,QAAS,CACJD,MADI,WACI,WACCE,EAAcC,OAAOC,SAASC,KAC9BP,EAASF,KAAKC,OAAOS,MAC3BR,EAAOS,aAAeL,GACtBM,EAAAA,EAAAA,IAAYZ,KAAKJ,eAAgBM,GAAQW,MAAK,SAAAC,GACrCA,EAAKC,SAWN,EAAK1B,MAAQyB,EAAKE,WAClB,EAAK7B,KAAO,UAXZ8B,EAAAA,EAAAA,kBAAuBH,EAAKnB,MAC5B,EAAKuB,OAAOC,OAAO,aAAc,CAC7BC,SAAUN,EAAKnB,KAAKyB,SACpBC,SAAUP,EAAKnB,KAAK0B,SACpBC,MAAOR,EAAKnB,KAAK2B,MACjBC,OAAQT,EAAKnB,KAAK4B,SAEtB,EAAKpC,KAAK,UACV,EAAKqC,QAAQC,KAAK,CAACC,KAAM,aAK7B,EAAK5B,SAAU,KAChB6B,OAAM,SAAAC,GACLC,QAAQC,IAAI,iBAAiBF,GAC7B,EAAKzC,KAAO,QACZ,EAAKE,MAAQ,WACb,EAAKS,SAAU,MAIvBiC,YA7BK,WA8BD/B,KAAKwB,QAAQC,KAAK,CAACC,KAAM,S,UCpErC,MAAMM,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,KAEpE","sources":["webpack://databasir/./src/views/OAuth2Login.vue","webpack://databasir/./src/views/OAuth2Login.vue?b6ea"],"sourcesContent":["<template>\r\n <el-container>\r\n <el-main v-loading=\"loading\" class=\"login-main\">\r\n <el-result\r\n :icon=\"icon\"\r\n :title=\"title\"\r\n :sub-title=\"subTitle\"\r\n v-show=\"!loading\"\r\n >\r\n <template #extra>\r\n <el-button type=\"primary\" @click=\"toIndexPage()\">立即跳转</el-button>\r\n </template>\r\n </el-result>\r\n </el-main>\r\n </el-container>\r\n</template>\r\n\r\n<style>\r\n.login-main {\r\n margin: 0 auto;\r\n margin-top: 200px;\r\n}\r\n\r\n</style>\r\n<script>\r\nimport { oauth2Login } from \"../api/Login\"\r\nimport { user } from \"../utils/auth\"\r\n\r\n\r\nexport default {\r\n data() {\r\n return {\r\n registrationId: null,\r\n icon: '',\r\n title: '',\r\n subTitle: '',\r\n loading: true,\r\n }\r\n },\r\n\r\n created() {\r\n this.registrationId = this.$route.params.id\r\n this.login()\r\n },\r\n\r\n methods: {\r\n login() {\r\n const redirectUri = window.location.href\r\n const params = this.$route.query\r\n params.redirect_uri = redirectUri\r\n oauth2Login(this.registrationId, params).then(resp => {\r\n if (!resp.errCode) {\r\n user.saveUserLoginData(resp.data)\r\n this.$store.commit('userUpdate', {\r\n nickname: resp.data.nickname,\r\n username: resp.data.username,\r\n email: resp.data.email,\r\n avatar: resp.data.avatar\r\n })\r\n this.icon='success'\r\n this.$router.push({path: '/groups'})\r\n } else {\r\n this.title = resp.errMessage\r\n this.icon = 'error'\r\n }\r\n this.loading = false\r\n }).catch(err => {\r\n console.log('login failed: '+err)\r\n this.icon = 'error'\r\n this.title = '登陆失败,请重试'\r\n this.loading = false\r\n })\r\n },\r\n\r\n toIndexPage() {\r\n this.$router.push({path: '/'})\r\n }\r\n }\r\n}\r\n</script>","import { render } from \"./OAuth2Login.vue?vue&type=template&id=65bc9922\"\nimport script from \"./OAuth2Login.vue?vue&type=script&lang=js\"\nexport * from \"./OAuth2Login.vue?vue&type=script&lang=js\"\n\nimport \"./OAuth2Login.vue?vue&type=style&index=0&id=65bc9922&lang=css\"\n\nimport exportComponent from \"E:\\\\git_workspace\\\\databasir-frontend\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["_createBlock","_component_el_container","_component_el_main","class","_createVNode","_component_el_result","icon","$data","title","extra","_component_el_button","type","onClick","$options","data","registrationId","subTitle","loading","created","this","$route","params","id","login","methods","redirectUri","window","location","href","query","redirect_uri","oauth2Login","then","resp","errCode","errMessage","user","$store","commit","nickname","username","email","avatar","$router","push","path","catch","err","console","log","toIndexPage","__exports__","render"],"sourceRoot":""}

2
api/src/main/resources/static/js/865.4a2f905b.js → api/src/main/resources/static/js/865.8a397b0a.js

@ -1,2 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[865],{8865:function(t,e,i){i.r(e),i.d(e,{default:function(){return h}});var a=i(6252),r=i(9963);const n=(0,a.Uk)("立即跳转");function s(t,e,i,s,o,l){const u=(0,a.up)("el-button"),d=(0,a.up)("el-result"),c=(0,a.up)("el-main"),h=(0,a.up)("el-container"),g=(0,a.Q2)("loading");return(0,a.wg)(),(0,a.j4)(h,null,{default:(0,a.w5)((()=>[(0,a.wy)(((0,a.wg)(),(0,a.j4)(c,{class:"login-main"},{default:(0,a.w5)((()=>[(0,a.wy)((0,a.Wm)(d,{icon:o.icon,title:o.title,"sub-title":o.subTitle},{extra:(0,a.w5)((()=>[(0,a.Wm)(u,{type:"primary",onClick:e[0]||(e[0]=t=>l.toIndexPage())},{default:(0,a.w5)((()=>[n])),_:1})])),_:1},8,["icon","title","sub-title"]),[[r.F8,!o.loading]])])),_:1})),[[g,o.loading]])])),_:1})}var o=i(152),l=i(1836),u={data(){return{registrationId:null,icon:"",title:"",subTitle:"",loading:!0}},created(){this.registrationId=this.$route.params.id,this.login()},methods:{login(){const t=window.location.href,e=this.$route.query;e.redirect_uri=t,(0,o.rd)(this.registrationId,e).then((t=>{t.errCode?(this.title=t.errMessage,this.icon="error"):(l.E.saveUserLoginData(t.data),this.$store.commit("userUpdate",{nickname:t.data.nickname,username:t.data.username,email:t.data.email,avatar:t.data.avatar}),this.icon="success",this.$router.push({path:"/groups"})),this.loading=!1})).catch((t=>{console.log("login failed: "+t),this.icon="error",this.title="登陆失败,请重试",this.loading=!1}))},toIndexPage(){this.$router.push({path:"/"})}}},d=i(3744);const c=(0,d.Z)(u,[["render",s]]);var h=c}}]);
//# sourceMappingURL=865.4a2f905b.js.map
//# sourceMappingURL=865.8a397b0a.js.map

2
api/src/main/resources/static/js/865.4a2f905b.js.map → api/src/main/resources/static/js/865.8a397b0a.js.map

@ -1 +1 @@
{"version":3,"file":"js/865.4a2f905b.js","mappings":"uMAUiE,Q,uKAT7DA,EAAAA,EAAAA,IAaeC,EAAA,M,kBAZX,IAWU,uBAXVD,EAAAA,EAAAA,IAWUE,EAAA,CAXmBC,MAAM,cAAY,C,kBAC3C,IASY,WATZC,EAAAA,EAAAA,IASYC,EAAA,CARPC,KAAMC,EAAAA,KACNC,MAAOD,EAAAA,MACP,YAAWA,EAAAA,UAHhB,CAMeE,OAAK,SAChB,IAAiE,EAAjEL,EAAAA,EAAAA,IAAiEM,EAAA,CAAtDC,KAAK,UAAWC,QAAK,eAAEC,EAAAA,gBAAlC,C,kBAAiD,IAAI,M,cAPzD,wCAIaN,EAAAA,c,OALjB,IAAoBA,EAAAA,c,6BA2B5B,GACIO,OACI,MAAO,CACHC,eAAgB,KAChBT,KAAM,GACNE,MAAO,GACPQ,SAAU,GACVC,SAAS,IAIjBC,UACIC,KAAKJ,eAAiBI,KAAKC,OAAOC,OAAOC,GACzCH,KAAKI,SAGTC,QAAS,CACJD,QACG,MAAME,EAAcC,OAAOC,SAASC,KAC9BP,EAASF,KAAKC,OAAOS,MAC3BR,EAAOS,aAAeL,GACtBM,EAAAA,EAAAA,IAAYZ,KAAKJ,eAAgBM,GAAQW,MAAKC,IACrCA,EAAKC,SAWNf,KAAKX,MAAQyB,EAAKE,WAClBhB,KAAKb,KAAO,UAXZ8B,EAAAA,EAAAA,kBAAuBH,EAAKnB,MAC5BK,KAAKkB,OAAOC,OAAO,aAAc,CAC7BC,SAAUN,EAAKnB,KAAKyB,SACpBC,SAAUP,EAAKnB,KAAK0B,SACpBC,MAAOR,EAAKnB,KAAK2B,MACjBC,OAAQT,EAAKnB,KAAK4B,SAEtBvB,KAAKb,KAAK,UACVa,KAAKwB,QAAQC,KAAK,CAACC,KAAM,aAK7B1B,KAAKF,SAAU,KAChB6B,OAAMC,IACLC,QAAQC,IAAI,iBAAiBF,GAC7B5B,KAAKb,KAAO,QACZa,KAAKX,MAAQ,WACbW,KAAKF,SAAU,MAIvBiC,cACI/B,KAAKwB,QAAQC,KAAK,CAACC,KAAM,S,UCpErC,MAAMM,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,KAEpE","sources":["webpack://databasir/./src/views/OAuth2Login.vue","webpack://databasir/./src/views/OAuth2Login.vue?b6ea"],"sourcesContent":["<template>\r\n <el-container>\r\n <el-main v-loading=\"loading\" class=\"login-main\">\r\n <el-result\r\n :icon=\"icon\"\r\n :title=\"title\"\r\n :sub-title=\"subTitle\"\r\n v-show=\"!loading\"\r\n >\r\n <template #extra>\r\n <el-button type=\"primary\" @click=\"toIndexPage()\">立即跳转</el-button>\r\n </template>\r\n </el-result>\r\n </el-main>\r\n </el-container>\r\n</template>\r\n\r\n<style>\r\n.login-main {\r\n margin: 0 auto;\r\n margin-top: 200px;\r\n}\r\n\r\n</style>\r\n<script>\r\nimport { oauth2Login } from \"../api/Login\"\r\nimport { user } from \"../utils/auth\"\r\n\r\n\r\nexport default {\r\n data() {\r\n return {\r\n registrationId: null,\r\n icon: '',\r\n title: '',\r\n subTitle: '',\r\n loading: true,\r\n }\r\n },\r\n\r\n created() {\r\n this.registrationId = this.$route.params.id\r\n this.login()\r\n },\r\n\r\n methods: {\r\n login() {\r\n const redirectUri = window.location.href\r\n const params = this.$route.query\r\n params.redirect_uri = redirectUri\r\n oauth2Login(this.registrationId, params).then(resp => {\r\n if (!resp.errCode) {\r\n user.saveUserLoginData(resp.data)\r\n this.$store.commit('userUpdate', {\r\n nickname: resp.data.nickname,\r\n username: resp.data.username,\r\n email: resp.data.email,\r\n avatar: resp.data.avatar\r\n })\r\n this.icon='success'\r\n this.$router.push({path: '/groups'})\r\n } else {\r\n this.title = resp.errMessage\r\n this.icon = 'error'\r\n }\r\n this.loading = false\r\n }).catch(err => {\r\n console.log('login failed: '+err)\r\n this.icon = 'error'\r\n this.title = '登陆失败,请重试'\r\n this.loading = false\r\n })\r\n },\r\n\r\n toIndexPage() {\r\n this.$router.push({path: '/'})\r\n }\r\n }\r\n}\r\n</script>","import { render } from \"./OAuth2Login.vue?vue&type=template&id=65bc9922\"\nimport script from \"./OAuth2Login.vue?vue&type=script&lang=js\"\nexport * from \"./OAuth2Login.vue?vue&type=script&lang=js\"\n\nimport \"./OAuth2Login.vue?vue&type=style&index=0&id=65bc9922&lang=css\"\n\nimport exportComponent from \"E:\\\\git_workspace\\\\databasir-frontend\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["_createBlock","_component_el_container","_component_el_main","class","_createVNode","_component_el_result","icon","$data","title","extra","_component_el_button","type","onClick","$options","data","registrationId","subTitle","loading","created","this","$route","params","id","login","methods","redirectUri","window","location","href","query","redirect_uri","oauth2Login","then","resp","errCode","errMessage","user","$store","commit","nickname","username","email","avatar","$router","push","path","catch","err","console","log","toIndexPage","__exports__","render"],"sourceRoot":""}
{"version":3,"file":"js/865.8a397b0a.js","mappings":"uMAUiE,Q,uKAT7DA,EAAAA,EAAAA,IAaeC,EAAA,M,kBAZX,IAWU,uBAXVD,EAAAA,EAAAA,IAWUE,EAAA,CAXmBC,MAAM,cAAY,C,kBAC3C,IASY,WATZC,EAAAA,EAAAA,IASYC,EAAA,CARPC,KAAMC,EAAAA,KACNC,MAAOD,EAAAA,MACP,YAAWA,EAAAA,UAHhB,CAMeE,OAAK,SAChB,IAAiE,EAAjEL,EAAAA,EAAAA,IAAiEM,EAAA,CAAtDC,KAAK,UAAWC,QAAK,eAAEC,EAAAA,gBAAlC,C,kBAAiD,IAAI,M,cAPzD,wCAIaN,EAAAA,c,OALjB,IAAoBA,EAAAA,c,6BA2B5B,GACIO,OACI,MAAO,CACHC,eAAgB,KAChBT,KAAM,GACNE,MAAO,GACPQ,SAAU,GACVC,SAAS,IAIjBC,UACIC,KAAKJ,eAAiBI,KAAKC,OAAOC,OAAOC,GACzCH,KAAKI,SAGTC,QAAS,CACJD,QACG,MAAME,EAAcC,OAAOC,SAASC,KAC9BP,EAASF,KAAKC,OAAOS,MAC3BR,EAAOS,aAAeL,GACtBM,EAAAA,EAAAA,IAAYZ,KAAKJ,eAAgBM,GAAQW,MAAKC,IACrCA,EAAKC,SAWNf,KAAKX,MAAQyB,EAAKE,WAClBhB,KAAKb,KAAO,UAXZ8B,EAAAA,EAAAA,kBAAuBH,EAAKnB,MAC5BK,KAAKkB,OAAOC,OAAO,aAAc,CAC7BC,SAAUN,EAAKnB,KAAKyB,SACpBC,SAAUP,EAAKnB,KAAK0B,SACpBC,MAAOR,EAAKnB,KAAK2B,MACjBC,OAAQT,EAAKnB,KAAK4B,SAEtBvB,KAAKb,KAAK,UACVa,KAAKwB,QAAQC,KAAK,CAACC,KAAM,aAK7B1B,KAAKF,SAAU,KAChB6B,OAAMC,IACLC,QAAQC,IAAI,iBAAiBF,GAC7B5B,KAAKb,KAAO,QACZa,KAAKX,MAAQ,WACbW,KAAKF,SAAU,MAIvBiC,cACI/B,KAAKwB,QAAQC,KAAK,CAACC,KAAM,S,UCpErC,MAAMM,GAA2B,OAAgB,EAAQ,CAAC,CAAC,SAASC,KAEpE","sources":["webpack://databasir/./src/views/OAuth2Login.vue","webpack://databasir/./src/views/OAuth2Login.vue?b6ea"],"sourcesContent":["<template>\r\n <el-container>\r\n <el-main v-loading=\"loading\" class=\"login-main\">\r\n <el-result\r\n :icon=\"icon\"\r\n :title=\"title\"\r\n :sub-title=\"subTitle\"\r\n v-show=\"!loading\"\r\n >\r\n <template #extra>\r\n <el-button type=\"primary\" @click=\"toIndexPage()\">立即跳转</el-button>\r\n </template>\r\n </el-result>\r\n </el-main>\r\n </el-container>\r\n</template>\r\n\r\n<style>\r\n.login-main {\r\n margin: 0 auto;\r\n margin-top: 200px;\r\n}\r\n\r\n</style>\r\n<script>\r\nimport { oauth2Login } from \"../api/Login\"\r\nimport { user } from \"../utils/auth\"\r\n\r\n\r\nexport default {\r\n data() {\r\n return {\r\n registrationId: null,\r\n icon: '',\r\n title: '',\r\n subTitle: '',\r\n loading: true,\r\n }\r\n },\r\n\r\n created() {\r\n this.registrationId = this.$route.params.id\r\n this.login()\r\n },\r\n\r\n methods: {\r\n login() {\r\n const redirectUri = window.location.href\r\n const params = this.$route.query\r\n params.redirect_uri = redirectUri\r\n oauth2Login(this.registrationId, params).then(resp => {\r\n if (!resp.errCode) {\r\n user.saveUserLoginData(resp.data)\r\n this.$store.commit('userUpdate', {\r\n nickname: resp.data.nickname,\r\n username: resp.data.username,\r\n email: resp.data.email,\r\n avatar: resp.data.avatar\r\n })\r\n this.icon='success'\r\n this.$router.push({path: '/groups'})\r\n } else {\r\n this.title = resp.errMessage\r\n this.icon = 'error'\r\n }\r\n this.loading = false\r\n }).catch(err => {\r\n console.log('login failed: '+err)\r\n this.icon = 'error'\r\n this.title = '登陆失败,请重试'\r\n this.loading = false\r\n })\r\n },\r\n\r\n toIndexPage() {\r\n this.$router.push({path: '/'})\r\n }\r\n }\r\n}\r\n</script>","import { render } from \"./OAuth2Login.vue?vue&type=template&id=65bc9922\"\nimport script from \"./OAuth2Login.vue?vue&type=script&lang=js\"\nexport * from \"./OAuth2Login.vue?vue&type=script&lang=js\"\n\nimport \"./OAuth2Login.vue?vue&type=style&index=0&id=65bc9922&lang=css\"\n\nimport exportComponent from \"E:\\\\git_workspace\\\\databasir-frontend\\\\node_modules\\\\vue-loader\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"names":["_createBlock","_component_el_container","_component_el_main","class","_createVNode","_component_el_result","icon","$data","title","extra","_component_el_button","type","onClick","$options","data","registrationId","subTitle","loading","created","this","$route","params","id","login","methods","redirectUri","window","location","href","query","redirect_uri","oauth2Login","then","resp","errCode","errMessage","user","$store","commit","nickname","username","email","avatar","$router","push","path","catch","err","console","log","toIndexPage","__exports__","render"],"sourceRoot":""}

1
api/src/main/resources/static/js/924-legacy.3ccd761f.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/924-legacy.3ccd761f.js → api/src/main/resources/static/js/924-legacy.890aead4.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/924-legacy.890aead4.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/979-legacy.2177bee0.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/979-legacy.2177bee0.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/979.62f03bb7.js

File diff suppressed because one or more lines are too long

1
api/src/main/resources/static/js/979.62f03bb7.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/99-legacy.fcfcb9cd.js → api/src/main/resources/static/js/99-legacy.0cf27260.js

@ -1,2 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[99],{5430:function(e,t,a){a.d(t,{v:function(){return r}});var n=a(3872),o="/api/v1.0/operation_logs",r=function(e){return n.Z.get(o,{params:e})}},2099:function(e,t,a){a.r(t),a.d(t,{default:function(){return h}});a(8309);var n=a(6252),o=a(3577),r={key:0},u=(0,n.Uk)("成功"),l={key:1},i=(0,n.Uk)("失败"),p={key:0},c={key:1},g={key:1},s={key:1},d={key:1};function f(e,t,a,f,w,m){var P=(0,n.up)("el-table-column"),j=(0,n.up)("el-option"),h=(0,n.up)("el-select"),v=(0,n.up)("el-tag"),y=(0,n.up)("el-link"),b=(0,n.up)("el-table"),k=(0,n.up)("el-main"),L=(0,n.up)("el-pagination"),O=(0,n.up)("el-footer"),D=(0,n.up)("el-container");return(0,n.wg)(),(0,n.j4)(D,null,{default:(0,n.w5)((function(){return[(0,n.Wm)(k,null,{default:(0,n.w5)((function(){return[(0,n.Wm)(b,{data:w.projectOperationLogPageData.data},{default:(0,n.w5)((function(){return[(0,n.Wm)(P,{prop:"id",label:""}),(0,n.Wm)(P,{prop:"operationModule",label:"系统模块"}),(0,n.Wm)(P,{prop:"operatorNickname",label:"操作人"}),(0,n.Wm)(P,{prop:"operationName",label:"操作"}),(0,n.Wm)(P,{label:"状态"},{header:(0,n.w5)((function(){return[(0,n.Wm)(h,{modelValue:w.projectOperationLogPageQuery.isSuccess,"onUpdate:modelValue":t[0]||(t[0]=function(e){return w.projectOperationLogPageQuery.isSuccess=e}),placeholder:"状态",onChange:m.onQuery,clearable:"",size:"small","tag-type":"success"},{default:(0,n.w5)((function(){return[((0,n.wg)(),(0,n.iD)(n.HY,null,(0,n.Ko)([!0,!1],(function(e){return(0,n.Wm)(j,{key:e,label:e?"成功":"失败",value:e},null,8,["label","value"])})),64))]})),_:1},8,["modelValue","onChange"])]})),default:(0,n.w5)((function(e){return[e.row.isSuccess?((0,n.wg)(),(0,n.iD)("span",r,[(0,n.Wm)(v,{type:"success"},{default:(0,n.w5)((function(){return[u]})),_:1})])):((0,n.wg)(),(0,n.iD)("span",l,[(0,n.Wm)(v,{type:"danger"},{default:(0,n.w5)((function(){return[i]})),_:1})]))]})),_:1}),(0,n.Wm)(P,{label:"错误信息"},{default:(0,n.w5)((function(e){return[e.row.isSuccess?((0,n.wg)(),(0,n.iD)("span",p)):((0,n.wg)(),(0,n.iD)("span",c,(0,o.zw)(e.row.operationResponse.errMessage),1))]})),_:1}),(0,n.Wm)(P,{label:"涉及分组"},{default:(0,n.w5)((function(e){return[e.row.involvedGroup?((0,n.wg)(),(0,n.j4)(y,{key:0},{default:(0,n.w5)((function(){return[(0,n.Uk)((0,o.zw)(e.row.involvedGroup.name),1)]})),_:2},1024)):((0,n.wg)(),(0,n.iD)("span",g," - "))]})),_:1}),(0,n.Wm)(P,{label:"涉及项目"},{default:(0,n.w5)((function(e){return[e.row.involvedProject?((0,n.wg)(),(0,n.j4)(y,{key:0},{default:(0,n.w5)((function(){return[(0,n.Uk)((0,o.zw)(e.row.involvedProject.name),1)]})),_:2},1024)):((0,n.wg)(),(0,n.iD)("span",s," - "))]})),_:1}),(0,n.Wm)(P,{label:"涉及用户"},{default:(0,n.w5)((function(e){return[e.row.involvedUser?((0,n.wg)(),(0,n.j4)(y,{key:0},{default:(0,n.w5)((function(){return[(0,n.Uk)((0,o.zw)(e.row.involvedUser.nickname),1)]})),_:2},1024)):((0,n.wg)(),(0,n.iD)("span",d," - "))]})),_:1}),(0,n.Wm)(P,{prop:"createAt",label:"记录时间"})]})),_:1},8,["data"])]})),_:1}),(0,n.Wm)(O,null,{default:(0,n.w5)((function(){return[(0,n.Wm)(L,{layout:"prev, pager, next","hide-on-single-page":!1,currentPage:w.projectOperationLogPageData.number,"page-size":w.projectOperationLogPageData.size,"page-count":w.projectOperationLogPageData.totalPages,onCurrentChange:m.onProjectOperationLogCurrentPageChange},null,8,["currentPage","page-size","page-count","onCurrentChange"])]})),_:1})]})),_:1})}var w=a(5430),m={data:function(){return{projectOperationLogPageData:{data:[],number:1,size:10,totalElements:0,totalPages:1},projectOperationLogPageQuery:{page:0,size:10,isSuccess:null,involveProjectId:null,module:null}}},created:function(){this.fetchProjectOperationLogs()},methods:{fetchProjectOperationLogs:function(e){var t=this;this.projectOperationLogPageQuery.page=e?e-1:null,(0,w.v)(this.projectOperationLogPageQuery).then((function(e){e.errCode||(t.projectOperationLogPageData.data=e.data.content,t.projectOperationLogPageData.number=e.data.number+1,t.projectOperationLogPageData.size=e.data.size,t.projectOperationLogPageData.totalPages=e.data.totalPages,t.projectOperationLogPageData.totalElements=e.data.totalElements)}))},onProjectOperationLogCurrentPageChange:function(e){e&&e-1!=this.projectOperationLogPageQuery.page&&(this.projectOperationLogPageQuery.page=e-1,this.fetchProjectOperationLogs(e))},onQuery:function(){this.fetchProjectOperationLogs()}}},P=a(3744);const j=(0,P.Z)(m,[["render",f]]);var h=j}}]);
//# sourceMappingURL=99-legacy.fcfcb9cd.js.map
//# sourceMappingURL=99-legacy.0cf27260.js.map

2
api/src/main/resources/static/js/99-legacy.fcfcb9cd.js.map → api/src/main/resources/static/js/99-legacy.0cf27260.js.map

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/99.e2e8211b.js → api/src/main/resources/static/js/99.810cec85.js

@ -1,2 +1,2 @@
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[99],{5430:function(e,a,t){t.d(a,{v:function(){return n}});var o=t(3872);const r="/api/v1.0/operation_logs",n=e=>o.Z.get(r,{params:e})},2099:function(e,a,t){t.r(a),t.d(a,{default:function(){return f}});var o=t(6252),r=t(3577);const n={key:0},l=(0,o.Uk)("成功"),p={key:1},u=(0,o.Uk)("失败"),i={key:0},g={key:1},s={key:1},c={key:1},d={key:1};function w(e,a,t,w,m,P){const h=(0,o.up)("el-table-column"),j=(0,o.up)("el-option"),f=(0,o.up)("el-select"),v=(0,o.up)("el-tag"),y=(0,o.up)("el-link"),b=(0,o.up)("el-table"),k=(0,o.up)("el-main"),L=(0,o.up)("el-pagination"),O=(0,o.up)("el-footer"),D=(0,o.up)("el-container");return(0,o.wg)(),(0,o.j4)(D,null,{default:(0,o.w5)((()=>[(0,o.Wm)(k,null,{default:(0,o.w5)((()=>[(0,o.Wm)(b,{data:m.projectOperationLogPageData.data},{default:(0,o.w5)((()=>[(0,o.Wm)(h,{prop:"id",label:""}),(0,o.Wm)(h,{prop:"operationModule",label:"系统模块"}),(0,o.Wm)(h,{prop:"operatorNickname",label:"操作人"}),(0,o.Wm)(h,{prop:"operationName",label:"操作"}),(0,o.Wm)(h,{label:"状态"},{header:(0,o.w5)((()=>[(0,o.Wm)(f,{modelValue:m.projectOperationLogPageQuery.isSuccess,"onUpdate:modelValue":a[0]||(a[0]=e=>m.projectOperationLogPageQuery.isSuccess=e),placeholder:"状态",onChange:P.onQuery,clearable:"",size:"small","tag-type":"success"},{default:(0,o.w5)((()=>[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)([!0,!1],(e=>(0,o.Wm)(j,{key:e,label:e?"成功":"失败",value:e},null,8,["label","value"]))),64))])),_:1},8,["modelValue","onChange"])])),default:(0,o.w5)((e=>[e.row.isSuccess?((0,o.wg)(),(0,o.iD)("span",n,[(0,o.Wm)(v,{type:"success"},{default:(0,o.w5)((()=>[l])),_:1})])):((0,o.wg)(),(0,o.iD)("span",p,[(0,o.Wm)(v,{type:"danger"},{default:(0,o.w5)((()=>[u])),_:1})]))])),_:1}),(0,o.Wm)(h,{label:"错误信息"},{default:(0,o.w5)((e=>[e.row.isSuccess?((0,o.wg)(),(0,o.iD)("span",i)):((0,o.wg)(),(0,o.iD)("span",g,(0,r.zw)(e.row.operationResponse.errMessage),1))])),_:1}),(0,o.Wm)(h,{label:"涉及分组"},{default:(0,o.w5)((e=>[e.row.involvedGroup?((0,o.wg)(),(0,o.j4)(y,{key:0},{default:(0,o.w5)((()=>[(0,o.Uk)((0,r.zw)(e.row.involvedGroup.name),1)])),_:2},1024)):((0,o.wg)(),(0,o.iD)("span",s," - "))])),_:1}),(0,o.Wm)(h,{label:"涉及项目"},{default:(0,o.w5)((e=>[e.row.involvedProject?((0,o.wg)(),(0,o.j4)(y,{key:0},{default:(0,o.w5)((()=>[(0,o.Uk)((0,r.zw)(e.row.involvedProject.name),1)])),_:2},1024)):((0,o.wg)(),(0,o.iD)("span",c," - "))])),_:1}),(0,o.Wm)(h,{label:"涉及用户"},{default:(0,o.w5)((e=>[e.row.involvedUser?((0,o.wg)(),(0,o.j4)(y,{key:0},{default:(0,o.w5)((()=>[(0,o.Uk)((0,r.zw)(e.row.involvedUser.nickname),1)])),_:2},1024)):((0,o.wg)(),(0,o.iD)("span",d," - "))])),_:1}),(0,o.Wm)(h,{prop:"createAt",label:"记录时间"})])),_:1},8,["data"])])),_:1}),(0,o.Wm)(O,null,{default:(0,o.w5)((()=>[(0,o.Wm)(L,{layout:"prev, pager, next","hide-on-single-page":!1,currentPage:m.projectOperationLogPageData.number,"page-size":m.projectOperationLogPageData.size,"page-count":m.projectOperationLogPageData.totalPages,onCurrentChange:P.onProjectOperationLogCurrentPageChange},null,8,["currentPage","page-size","page-count","onCurrentChange"])])),_:1})])),_:1})}var m=t(5430),P={data(){return{projectOperationLogPageData:{data:[],number:1,size:10,totalElements:0,totalPages:1},projectOperationLogPageQuery:{page:0,size:10,isSuccess:null,involveProjectId:null,module:null}}},created(){this.fetchProjectOperationLogs()},methods:{fetchProjectOperationLogs(e){this.projectOperationLogPageQuery.page=e?e-1:null,(0,m.v)(this.projectOperationLogPageQuery).then((e=>{e.errCode||(this.projectOperationLogPageData.data=e.data.content,this.projectOperationLogPageData.number=e.data.number+1,this.projectOperationLogPageData.size=e.data.size,this.projectOperationLogPageData.totalPages=e.data.totalPages,this.projectOperationLogPageData.totalElements=e.data.totalElements)}))},onProjectOperationLogCurrentPageChange(e){e&&e-1!=this.projectOperationLogPageQuery.page&&(this.projectOperationLogPageQuery.page=e-1,this.fetchProjectOperationLogs(e))},onQuery(){this.fetchProjectOperationLogs()}}},h=t(3744);const j=(0,h.Z)(P,[["render",w]]);var f=j}}]);
//# sourceMappingURL=99.e2e8211b.js.map
//# sourceMappingURL=99.810cec85.js.map

2
api/src/main/resources/static/js/99.e2e8211b.js.map → api/src/main/resources/static/js/99.810cec85.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/app-legacy.26c8cf98.js → api/src/main/resources/static/js/app-legacy.068b0ad8.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app-legacy.26c8cf98.js.map → api/src/main/resources/static/js/app-legacy.068b0ad8.js.map

File diff suppressed because one or more lines are too long

4
api/src/main/resources/static/js/app.969627b4.js → api/src/main/resources/static/js/app.42acff90.js

File diff suppressed because one or more lines are too long

2
api/src/main/resources/static/js/app.969627b4.js.map → api/src/main/resources/static/js/app.42acff90.js.map

File diff suppressed because one or more lines are too long

1
core/src/main/java/com/databasir/core/domain/DomainErrors.java

@ -42,6 +42,7 @@ public enum DomainErrors implements DatabasirErrors {
CIRCLE_REFERENCE("A_10027", "检查到循环引用"),
DUPLICATE_COLUMN("A_10028", "重复的列"),
INVALID_MOCK_DATA_SCRIPT("A_10029", "不合法的表达式"),
CANNOT_DELETE_SELF("A_10030", "无法对自己执行删除账号操作"),
;
private final String errCode;

8
core/src/main/java/com/databasir/core/domain/user/service/UserService.java

@ -176,4 +176,12 @@ public class UserService {
userPojo.setNickname(request.getNickname());
userDao.updateById(userPojo);
}
@Transactional
public void deleteOne(Integer userId) {
if (userDao.existsById(userId)) {
userDao.deleteById(userId);
loginDao.deleteByUserId(userId);
}
}
}

4
dao/generated-src/jooq/main/java/com/databasir/dao/Keys.java

@ -101,8 +101,8 @@ public class Keys {
public static final UniqueKey<TableIndexDocumentRecord> KEY_TABLE_INDEX_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableIndexDocument.TABLE_INDEX_DOCUMENT, DSL.name("KEY_table_index_document_PRIMARY"), new TableField[] { TableIndexDocument.TABLE_INDEX_DOCUMENT.ID }, true);
public static final UniqueKey<TableTriggerDocumentRecord> KEY_TABLE_TRIGGER_DOCUMENT_PRIMARY = Internal.createUniqueKey(TableTriggerDocument.TABLE_TRIGGER_DOCUMENT, DSL.name("KEY_table_trigger_document_PRIMARY"), new TableField[] { TableTriggerDocument.TABLE_TRIGGER_DOCUMENT.ID }, true);
public static final UniqueKey<UserRecord> KEY_USER_PRIMARY = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_PRIMARY"), new TableField[] { User.USER.ID }, true);
public static final UniqueKey<UserRecord> KEY_USER_UK_EMAIL = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_uk_email"), new TableField[] { User.USER.EMAIL }, true);
public static final UniqueKey<UserRecord> KEY_USER_UK_USERNAME = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_uk_username"), new TableField[] { User.USER.USERNAME }, true);
public static final UniqueKey<UserRecord> KEY_USER_UK_EMAIL = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_uk_email"), new TableField[] { User.USER.EMAIL, User.USER.DELETED_TOKEN }, true);
public static final UniqueKey<UserRecord> KEY_USER_UK_USERNAME = Internal.createUniqueKey(User.USER, DSL.name("KEY_user_uk_username"), new TableField[] { User.USER.USERNAME, User.USER.DELETED_TOKEN }, true);
public static final UniqueKey<UserFavoriteProjectRecord> KEY_USER_FAVORITE_PROJECT_PRIMARY = Internal.createUniqueKey(UserFavoriteProject.USER_FAVORITE_PROJECT, DSL.name("KEY_user_favorite_project_PRIMARY"), new TableField[] { UserFavoriteProject.USER_FAVORITE_PROJECT.ID }, true);
public static final UniqueKey<UserFavoriteProjectRecord> KEY_USER_FAVORITE_PROJECT_UK_USER_ID_PROJECT_ID = Internal.createUniqueKey(UserFavoriteProject.USER_FAVORITE_PROJECT, DSL.name("KEY_user_favorite_project_uk_user_id_project_id"), new TableField[] { UserFavoriteProject.USER_FAVORITE_PROJECT.USER_ID, UserFavoriteProject.USER_FAVORITE_PROJECT.PROJECT_ID }, true);
public static final UniqueKey<UserRoleRecord> KEY_USER_ROLE_PRIMARY = Internal.createUniqueKey(UserRole.USER_ROLE, DSL.name("KEY_user_role_PRIMARY"), new TableField[] { UserRole.USER_ROLE.ID }, true);

18
dao/generated-src/jooq/main/java/com/databasir/dao/tables/User.java

@ -17,7 +17,7 @@ import org.jooq.ForeignKey;
import org.jooq.Identity;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row9;
import org.jooq.Row11;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
@ -84,6 +84,16 @@ public class User extends TableImpl<UserRecord> {
*/
public final TableField<UserRecord, Boolean> ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.inline("0", SQLDataType.BOOLEAN)), this, "");
/**
* The column <code>databasir.user.deleted</code>.
*/
public final TableField<UserRecord, Boolean> DELETED = createField(DSL.name("deleted"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.inline("0", SQLDataType.BOOLEAN)), this, "");
/**
* The column <code>databasir.user.deleted_token</code>.
*/
public final TableField<UserRecord, Integer> DELETED_TOKEN = createField(DSL.name("deleted_token"), SQLDataType.INTEGER.nullable(false).defaultValue(DSL.inline("0", SQLDataType.INTEGER)), this, "");
/**
* The column <code>databasir.user.update_at</code>.
*/
@ -174,11 +184,11 @@ public class User extends TableImpl<UserRecord> {
}
// -------------------------------------------------------------------------
// Row9 type methods
// Row11 type methods
// -------------------------------------------------------------------------
@Override
public Row9<Integer, String, String, String, String, String, Boolean, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row9) super.fieldsRow();
public Row11<Integer, String, String, String, String, String, Boolean, Boolean, Integer, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row11) super.fieldsRow();
}
}

38
dao/generated-src/jooq/main/java/com/databasir/dao/tables/pojos/UserPojo.java

@ -23,6 +23,8 @@ public class UserPojo implements Serializable {
private String nickname;
private String avatar;
private Boolean enabled;
private Boolean deleted;
private Integer deletedToken;
private LocalDateTime updateAt;
private LocalDateTime createAt;
@ -36,6 +38,8 @@ public class UserPojo implements Serializable {
this.nickname = value.nickname;
this.avatar = value.avatar;
this.enabled = value.enabled;
this.deleted = value.deleted;
this.deletedToken = value.deletedToken;
this.updateAt = value.updateAt;
this.createAt = value.createAt;
}
@ -48,6 +52,8 @@ public class UserPojo implements Serializable {
String nickname,
String avatar,
Boolean enabled,
Boolean deleted,
Integer deletedToken,
LocalDateTime updateAt,
LocalDateTime createAt
) {
@ -58,6 +64,8 @@ public class UserPojo implements Serializable {
this.nickname = nickname;
this.avatar = avatar;
this.enabled = enabled;
this.deleted = deleted;
this.deletedToken = deletedToken;
this.updateAt = updateAt;
this.createAt = createAt;
}
@ -160,6 +168,34 @@ public class UserPojo implements Serializable {
this.enabled = enabled;
}
/**
* Getter for <code>databasir.user.deleted</code>.
*/
public Boolean getDeleted() {
return this.deleted;
}
/**
* Setter for <code>databasir.user.deleted</code>.
*/
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
/**
* Getter for <code>databasir.user.deleted_token</code>.
*/
public Integer getDeletedToken() {
return this.deletedToken;
}
/**
* Setter for <code>databasir.user.deleted_token</code>.
*/
public void setDeletedToken(Integer deletedToken) {
this.deletedToken = deletedToken;
}
/**
* Getter for <code>databasir.user.update_at</code>.
*/
@ -199,6 +235,8 @@ public class UserPojo implements Serializable {
sb.append(", ").append(nickname);
sb.append(", ").append(avatar);
sb.append(", ").append(enabled);
sb.append(", ").append(deleted);
sb.append(", ").append(deletedToken);
sb.append(", ").append(updateAt);
sb.append(", ").append(createAt);

120
dao/generated-src/jooq/main/java/com/databasir/dao/tables/records/UserRecord.java

@ -11,8 +11,8 @@ import java.time.LocalDateTime;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record9;
import org.jooq.Row9;
import org.jooq.Record11;
import org.jooq.Row11;
import org.jooq.impl.UpdatableRecordImpl;
@ -20,7 +20,7 @@ import org.jooq.impl.UpdatableRecordImpl;
* This class is generated by jOOQ.
*/
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Record9<Integer, String, String, String, String, String, Boolean, LocalDateTime, LocalDateTime> {
public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Record11<Integer, String, String, String, String, String, Boolean, Boolean, Integer, LocalDateTime, LocalDateTime> {
private static final long serialVersionUID = 1L;
@ -122,32 +122,60 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
return (Boolean) get(6);
}
/**
* Setter for <code>databasir.user.deleted</code>.
*/
public void setDeleted(Boolean value) {
set(7, value);
}
/**
* Getter for <code>databasir.user.deleted</code>.
*/
public Boolean getDeleted() {
return (Boolean) get(7);
}
/**
* Setter for <code>databasir.user.deleted_token</code>.
*/
public void setDeletedToken(Integer value) {
set(8, value);
}
/**
* Getter for <code>databasir.user.deleted_token</code>.
*/
public Integer getDeletedToken() {
return (Integer) get(8);
}
/**
* Setter for <code>databasir.user.update_at</code>.
*/
public void setUpdateAt(LocalDateTime value) {
set(7, value);
set(9, value);
}
/**
* Getter for <code>databasir.user.update_at</code>.
*/
public LocalDateTime getUpdateAt() {
return (LocalDateTime) get(7);
return (LocalDateTime) get(9);
}
/**
* Setter for <code>databasir.user.create_at</code>.
*/
public void setCreateAt(LocalDateTime value) {
set(8, value);
set(10, value);
}
/**
* Getter for <code>databasir.user.create_at</code>.
*/
public LocalDateTime getCreateAt() {
return (LocalDateTime) get(8);
return (LocalDateTime) get(10);
}
// -------------------------------------------------------------------------
@ -160,17 +188,17 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
}
// -------------------------------------------------------------------------
// Record9 type implementation
// Record11 type implementation
// -------------------------------------------------------------------------
@Override
public Row9<Integer, String, String, String, String, String, Boolean, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row9) super.fieldsRow();
public Row11<Integer, String, String, String, String, String, Boolean, Boolean, Integer, LocalDateTime, LocalDateTime> fieldsRow() {
return (Row11) super.fieldsRow();
}
@Override
public Row9<Integer, String, String, String, String, String, Boolean, LocalDateTime, LocalDateTime> valuesRow() {
return (Row9) super.valuesRow();
public Row11<Integer, String, String, String, String, String, Boolean, Boolean, Integer, LocalDateTime, LocalDateTime> valuesRow() {
return (Row11) super.valuesRow();
}
@Override
@ -209,12 +237,22 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
}
@Override
public Field<LocalDateTime> field8() {
public Field<Boolean> field8() {
return User.USER.DELETED;
}
@Override
public Field<Integer> field9() {
return User.USER.DELETED_TOKEN;
}
@Override
public Field<LocalDateTime> field10() {
return User.USER.UPDATE_AT;
}
@Override
public Field<LocalDateTime> field9() {
public Field<LocalDateTime> field11() {
return User.USER.CREATE_AT;
}
@ -254,12 +292,22 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
}
@Override
public LocalDateTime component8() {
public Boolean component8() {
return getDeleted();
}
@Override
public Integer component9() {
return getDeletedToken();
}
@Override
public LocalDateTime component10() {
return getUpdateAt();
}
@Override
public LocalDateTime component9() {
public LocalDateTime component11() {
return getCreateAt();
}
@ -299,12 +347,22 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
}
@Override
public LocalDateTime value8() {
public Boolean value8() {
return getDeleted();
}
@Override
public Integer value9() {
return getDeletedToken();
}
@Override
public LocalDateTime value10() {
return getUpdateAt();
}
@Override
public LocalDateTime value9() {
public LocalDateTime value11() {
return getCreateAt();
}
@ -351,19 +409,31 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
}
@Override
public UserRecord value8(LocalDateTime value) {
public UserRecord value8(Boolean value) {
setDeleted(value);
return this;
}
@Override
public UserRecord value9(Integer value) {
setDeletedToken(value);
return this;
}
@Override
public UserRecord value10(LocalDateTime value) {
setUpdateAt(value);
return this;
}
@Override
public UserRecord value9(LocalDateTime value) {
public UserRecord value11(LocalDateTime value) {
setCreateAt(value);
return this;
}
@Override
public UserRecord values(Integer value1, String value2, String value3, String value4, String value5, String value6, Boolean value7, LocalDateTime value8, LocalDateTime value9) {
public UserRecord values(Integer value1, String value2, String value3, String value4, String value5, String value6, Boolean value7, Boolean value8, Integer value9, LocalDateTime value10, LocalDateTime value11) {
value1(value1);
value2(value2);
value3(value3);
@ -373,6 +443,8 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
value7(value7);
value8(value8);
value9(value9);
value10(value10);
value11(value11);
return this;
}
@ -390,7 +462,7 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
/**
* Create a detached, initialised UserRecord
*/
public UserRecord(Integer id, String email, String username, String password, String nickname, String avatar, Boolean enabled, LocalDateTime updateAt, LocalDateTime createAt) {
public UserRecord(Integer id, String email, String username, String password, String nickname, String avatar, Boolean enabled, Boolean deleted, Integer deletedToken, LocalDateTime updateAt, LocalDateTime createAt) {
super(User.USER);
setId(id);
@ -400,6 +472,8 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
setNickname(nickname);
setAvatar(avatar);
setEnabled(enabled);
setDeleted(deleted);
setDeletedToken(deletedToken);
setUpdateAt(updateAt);
setCreateAt(createAt);
}
@ -418,6 +492,8 @@ public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Recor
setNickname(value.getNickname());
setAvatar(value.getAvatar());
setEnabled(value.getEnabled());
setDeleted(value.getDeleted());
setDeletedToken(value.getDeletedToken());
setUpdateAt(value.getUpdateAt());
setCreateAt(value.getCreateAt());
}

54
dao/src/main/java/com/databasir/dao/impl/UserDao.java

@ -15,6 +15,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
import java.util.*;
import static com.databasir.dao.Tables.USER;
@ -31,15 +32,44 @@ public class UserDao extends BaseDao<UserPojo> {
super(USER, UserPojo.class);
}
@Override
public <T extends Serializable> int deleteById(T id) {
return getDslContext()
.deleteFrom(USER).where(identity().eq(id).and(USER.DELETED.eq(false)))
.execute();
}
@Override
public int delete(Condition condition) {
return getDslContext()
.update(USER)
.set(USER.DELETED, true)
.set(USER.DELETED_TOKEN, USER.ID)
.where(USER.DELETED.eq(false))
.execute();
}
@Override
public boolean exists(Condition condition) {
return super.exists(condition.and(USER.DELETED.eq(false)));
}
@Override
public <T extends Serializable> boolean existsById(T id) {
return getDslContext().fetchExists(USER, identity().eq(id).and(USER.DELETED.eq(false)));
}
public void updateEnabledByUserId(Integer userId, Boolean enabled) {
dslContext
.update(USER).set(USER.ENABLED, enabled).where(USER.ID.eq(userId))
.update(USER).set(USER.ENABLED, enabled)
.where(USER.ID.eq(userId).and(USER.DELETED.eq(false)))
.execute();
}
public void updatePassword(Integer userId, String password) {
dslContext
.update(USER).set(USER.PASSWORD, password).where(USER.ID.eq(userId))
.update(USER).set(USER.PASSWORD, password)
.where(USER.ID.eq(userId).and(USER.DELETED.eq(false)))
.execute();
}
@ -49,7 +79,7 @@ public class UserDao extends BaseDao<UserPojo> {
}
return dslContext
.select(USER.fields()).from(USER)
.where(USER.ID.in(userIds))
.where(USER.ID.in(userIds).and(USER.DELETED.eq(false)))
.fetchInto(UserPojo.class);
}
@ -59,7 +89,8 @@ public class UserDao extends BaseDao<UserPojo> {
return dslContext
.select(USER.fields()).from(USER)
.innerJoin(USER_ROLE).on(USER_ROLE.USER_ID.eq(USER.ID))
.where(USER_ROLE.GROUP_ID.eq(groupId).and(USER_ROLE.ROLE.eq(role)))
.where(USER.DELETED.eq(false)
.and(USER_ROLE.GROUP_ID.eq(groupId).and(USER_ROLE.ROLE.eq(role))))
.orderBy(USER_ROLE.ID.desc())
.limit(size)
.fetchInto(UserPojo.class);
@ -67,21 +98,24 @@ public class UserDao extends BaseDao<UserPojo> {
public Optional<UserPojo> selectByEmail(String email) {
return dslContext
.select(USER.fields()).from(USER).where(USER.EMAIL.eq(email))
.select(USER.fields()).from(USER)
.where(USER.EMAIL.eq(email).and(USER.DELETED.eq(false)))
.fetchOptionalInto(UserPojo.class);
}
public Optional<UserPojo> selectByEmailOrUsername(String emailOrUsername) {
return dslContext
.select(USER.fields()).from(USER)
.where(USER.EMAIL.eq(emailOrUsername).or(USER.USERNAME.eq(emailOrUsername)))
.where(USER.DELETED.eq(false)
.and(USER.EMAIL.eq(emailOrUsername).or(USER.USERNAME.eq(emailOrUsername))))
.fetchOptionalInto(UserPojo.class);
}
public List<UserPojo> selectEnabledGroupMembers(Integer groupId) {
return dslContext.select(USER.fields()).from(USER)
.innerJoin(USER_ROLE).on(USER.ID.eq(USER_ROLE.USER_ID))
.where(USER_ROLE.GROUP_ID.eq(groupId).and(USER.ENABLED.eq(true)))
.where(USER.DELETED.eq(false)
.and(USER_ROLE.GROUP_ID.eq(groupId).and(USER.ENABLED.eq(true))))
.fetchInto(UserPojo.class);
}
@ -91,7 +125,8 @@ public class UserDao extends BaseDao<UserPojo> {
.selectCount()
.from(USER)
.innerJoin(USER_ROLE).on(USER.ID.eq(USER_ROLE.USER_ID))
.where(USER_ROLE.GROUP_ID.eq(groupId).and(condition))
.where(USER.DELETED.eq(false)
.and(USER_ROLE.GROUP_ID.eq(groupId).and(condition)))
.fetchOne(0, int.class);
// data
@ -100,7 +135,8 @@ public class UserDao extends BaseDao<UserPojo> {
USER_ROLE.USER_ID, USER_ROLE.ROLE, USER_ROLE.GROUP_ID, USER_ROLE.CREATE_AT)
.from(USER)
.innerJoin(USER_ROLE).on(USER.ID.eq(USER_ROLE.USER_ID))
.where(USER_ROLE.GROUP_ID.eq(groupId).and(condition))
.where(USER.DELETED.eq(false)
.and(USER_ROLE.GROUP_ID.eq(groupId).and(condition)))
.orderBy(getSortFields(request.getSort()))
.offset(request.getOffset()).limit(request.getPageSize())
.fetchInto(GroupMemberDetailPojo.class);

24
dao/src/main/resources/db/migration/V1__init.sql

@ -27,17 +27,19 @@ CREATE TABLE IF NOT EXISTS sys_mail
CREATE TABLE IF NOT EXISTS user
(
id INT PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(512) NOT NULL,
username VARCHAR(128) NOT NULL,
password TEXT NOT NULL,
nickname VARCHAR(255) NOT NULL,
avatar VARCHAR(512) DEFAULT NULL,
enabled BOOLEAN NOT NULL DEFAULT FALSE,
update_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT UNIQUE uk_email (email),
CONSTRAINT UNIQUE uk_username (username)
id INT PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(512) NOT NULL,
username VARCHAR(128) NOT NULL,
password TEXT NOT NULL,
nickname VARCHAR(255) NOT NULL,
avatar VARCHAR(512) DEFAULT NULL,
enabled BOOLEAN NOT NULL DEFAULT FALSE,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
deleted_token INT NOT NULL DEFAULT 0,
update_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
create_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT UNIQUE uk_email (email, deleted_token),
CONSTRAINT UNIQUE uk_username (username, deleted_token)
) CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci;

Loading…
Cancel
Save