File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1212from common .core .schemas import PaginatedResponse , PaginationParams
1313from common .core .security import default_md5_pwd , md5pwd , verify_md5pwd
1414from common .core .sqlbot_cache import clear_cache
15+ from common .core .config import settings
1516
1617router = APIRouter (tags = ["user" ], prefix = "/user" )
1718
1819@router .get ("/info" )
1920async def user_info (current_user : CurrentUser ):
2021 return current_user
2122
23+ @router .get ("/defaultPwd" )
24+ async def default_pwd () -> str :
25+ return settings .DEFAULT_PWD
26+
2227@router .get ("/pager/{pageNum}/{pageSize}" , response_model = PaginatedResponse [UserGrid ])
2328async def pager (
2429 session : SessionDep ,
Original file line number Diff line number Diff line change @@ -26,4 +26,5 @@ export const userApi = {
2626 get : ( key : string ) => request . get ( `/user/${ key } ` ) ,
2727 pwd : ( id : any ) => request . patch ( `/user/pwd/${ id } ` ) ,
2828 status : ( data : any ) => request . patch ( '/user/status' , data ) ,
29+ defaultPwd : ( ) => request . get ( '/user/defaultPwd' ) ,
2930}
Original file line number Diff line number Diff line change 157157 <span class =" header-span" >{{ t('datasource.the_original_one') }}</span >
158158 </div >
159159 <div class =" confirm-content" >
160- <span >SQLBot@123456 </span >
160+ <span >{{ defaultPwd }} </span >
161161 <el-button style =" margin-left : 4px " text @click =" copyText" >{{
162162 t('datasource.copy')
163163 }}</el-button >
@@ -387,6 +387,7 @@ import { useClipboard } from '@vueuse/core'
387387const { copy } = useClipboard ({ legacy: true })
388388
389389const { t } = useI18n ()
390+ const defaultPwd = ref (' SQLBot@123456' )
390391const keyword = ref (' ' )
391392const dialogFormVisible = ref (false )
392393const termFormRef = ref ()
@@ -511,7 +512,7 @@ const setPopoverRef = (el: any, row: any) => {
511512}
512513
513514const copyText = () => {
514- copy (' SQLBot@123456 ' )
515+ copy (defaultPwd . value )
515516 .then (function () {
516517 ElMessage .success (t (' embedded.copy_successful' ))
517518 })
@@ -793,12 +794,20 @@ const formatSpaceName = (row_oid_list: Array<any>) => {
793794 })
794795 return row_oid_list .map ((id : any ) => wsMap [id ]).join (' ,' )
795796}
797+ const loadDefaultPwd = () => {
798+ userApi .defaultPwd ().then ((res ) => {
799+ if (res ) {
800+ defaultPwd .value = res
801+ }
802+ })
803+ }
796804onMounted (() => {
797805 workspaceList ().then ((res ) => {
798806 options .value = res || []
799807 filterOption .value [2 ].option = [... options .value ]
800808 })
801809 search ()
810+ loadDefaultPwd ()
802811})
803812 </script >
804813
You can’t perform that action at this time.
0 commit comments