@获取sa密码
(self, args)
| 1014 | return public.returnMsg(True, 'DATABASE_PASS_SUCCESS', (find['name'],)) |
| 1015 | |
| 1016 | def get_root_pwd(self, args): |
| 1017 | """ |
| 1018 | @获取sa密码 |
| 1019 | """ |
| 1020 | # check_result = os.system('/www/server/pgsql/bin/psql1 --version') |
| 1021 | if not os.path.exists("/www/server/pgsql/bin/psql"): return public.returnMsg(False, '检测到PgSQL未安装或未启动,请先安装或启动') |
| 1022 | password = '' |
| 1023 | path = '{}/data/postgresAS.json'.format(public.get_panel_path()) |
| 1024 | if os.path.isfile(path): |
| 1025 | try: |
| 1026 | password = json.loads(public.readFile(path))['password'] |
| 1027 | # print('333333333') |
| 1028 | # print(password) |
| 1029 | except: |
| 1030 | pass |
| 1031 | if 'is_True' in args and args.is_True: return password |
| 1032 | return public.returnMsg(True, password) |
| 1033 | |
| 1034 | def set_root_pwd(self, args): |
| 1035 | """ |