mirror of https://github.com/openspug/spug
fix issue
parent
6a25d33c2b
commit
6d94e590e9
|
@ -135,6 +135,9 @@ class ConfigView(View):
|
|||
form.updated_by = request.user
|
||||
envs = form.pop('envs')
|
||||
for env_id in envs:
|
||||
cf = Config.objects.filter(o_id=form.o_id, type=form.type, env_id=env_id, key=form.key).first()
|
||||
if cf:
|
||||
raise Exception(f'{cf.env.name} 中已存在该Key')
|
||||
Config.objects.create(env_id=env_id, **form)
|
||||
ConfigHistory.objects.create(action='1', env_id=env_id, **form)
|
||||
return json_response(error=error)
|
||||
|
|
|
@ -15,7 +15,11 @@ export function updatePermissions() {
|
|||
X_TOKEN = localStorage.getItem('token');
|
||||
Permission.isReady = true;
|
||||
Permission.isSuper = localStorage.getItem('is_supper') === 'true';
|
||||
Permission.permissions = JSON.parse(localStorage.getItem('permissions') || '[]');
|
||||
try {
|
||||
Permission.permissions = JSON.parse(localStorage.getItem('permissions') || '[]');
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 前端页面的权限判断(仅作为前端功能展示的控制,具体权限控制应在后端实现)
|
||||
|
|
|
@ -76,7 +76,8 @@ export default observer(function () {
|
|||
label="类型"
|
||||
name="is_public"
|
||||
valuePropName="checked"
|
||||
initialValue={store.record.is_public === undefined || store.record.is_public}>
|
||||
initialValue={store.record.is_public === undefined || store.record.is_public}
|
||||
tooltip={<a target="_blank" rel="noopener noreferrer" href="https://spug.cc/docs/conf-app">什么是公共/私有配置?</a>}>
|
||||
<Switch checkedChildren="公共" unCheckedChildren="私有"/>
|
||||
</Form.Item>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue