feat: 完善变更服务器时间的接口2
This commit is contained in:
parent
1a1f64f9fe
commit
b1487957b5
|
@ -62,7 +62,7 @@ class ServerTime(APIView):
|
||||||
|
|
||||||
修改服务器时间
|
修改服务器时间
|
||||||
"""
|
"""
|
||||||
command = f'date -s "{request.data["new_server_time"]}"'
|
command = f'date -s "{request.data["server_time"]}"'
|
||||||
completed = subprocess.run(
|
completed = subprocess.run(
|
||||||
["sudo", "sh", "-c", command], # 避免 shell=True 的安全风险
|
["sudo", "sh", "-c", command], # 避免 shell=True 的安全风险
|
||||||
input=SD_PWD, # 密码从安全配置读取
|
input=SD_PWD, # 密码从安全配置读取
|
||||||
|
|
Loading…
Reference in New Issue