1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

improve code (#4370)

* improve code

* optimized code
This commit is contained in:
杨顺强
2019-12-19 13:44:30 +08:00
committed by Daniel Pan
parent 9c10cbf9f7
commit 4e584c8f65
7 changed files with 18 additions and 38 deletions

View File

@@ -2,10 +2,12 @@ import React from 'react';
import { gettext, loginUrl } from '../utils/constants';
function PermissionDeniedTip() {
let reloginUrl = `${loginUrl}?next=${encodeURIComponent(location.href)}`;
let errorTip = gettext('Permission denied. Plaese try {placeholder-left}login again.{placeholder-right}');
errorTip = errorTip.replace('{placeholder-left}', '<a class="action-link p-0" href='+ reloginUrl + '>')
errorTip = errorTip.replace('{placeholder-right}', '</a>');
return(
<span className="error">{gettext('Permission denied. Please try')}{' '}
<a className="action-link p-0" href={`${loginUrl}?next=${encodeURIComponent(location.href)}`}>{gettext('login again.')}</a>
</span>
<span className="error" dangerouslySetInnerHTML={{__html: errorTip}}></span>
);
}