feat: 优化防篡改拒绝操作提示信息 (#6797)

Refs #6062 #4710
This commit is contained in:
ssongliu 2024-10-22 15:18:28 +08:00 committed by GitHub
parent 810891236b
commit 4bb0974c4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import router from '@/routers';
import { GlobalStore } from '@/store'; import { GlobalStore } from '@/store';
import { MsgError } from '@/utils/message'; import { MsgError } from '@/utils/message';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import i18n from '@/lang';
const globalStore = GlobalStore(); const globalStore = GlobalStore();
@ -90,6 +91,10 @@ class RequestHttp {
return data; return data;
} }
if (data.code && data.code !== ResultEnum.SUCCESS) { if (data.code && data.code !== ResultEnum.SUCCESS) {
if (data.message.toLowerCase().indexOf('operation not permitted') !== -1) {
MsgError(i18n.global.t('license.tamperHelper'));
return data;
}
MsgError(data.message); MsgError(data.message);
return Promise.reject(data); return Promise.reject(data);
} }

View file

@ -1743,6 +1743,7 @@ const message = {
introduce: 'Feature Introduction', introduce: 'Feature Introduction',
waf: 'Upgrading to the professional version can provide features such as interception map, logs, block records, geographical location blocking, custom rules, custom interception pages, etc.', waf: 'Upgrading to the professional version can provide features such as interception map, logs, block records, geographical location blocking, custom rules, custom interception pages, etc.',
tamper: 'Upgrading to the professional version can protect websites from unauthorized modifications or tampering.', tamper: 'Upgrading to the professional version can protect websites from unauthorized modifications or tampering.',
tamperHelper: 'Operation failed, the file or folder has tamper protection enabled. Please check and try again!',
gpu: 'Upgrading to the professional version can help users visually monitor important parameters of GPU such as workload, temperature, memory usage in real time.', gpu: 'Upgrading to the professional version can help users visually monitor important parameters of GPU such as workload, temperature, memory usage in real time.',
setting: setting:
'Upgrading to the professional version allows customization of panel logo, welcome message, and other information.', 'Upgrading to the professional version allows customization of panel logo, welcome message, and other information.',

View file

@ -1626,6 +1626,7 @@ const message = {
introduce: '功能介紹', introduce: '功能介紹',
waf: '升級專業版可以獲得攔截地圖日誌封鎖記錄地理位置封禁自定義規則自定義攔截頁面等功能', waf: '升級專業版可以獲得攔截地圖日誌封鎖記錄地理位置封禁自定義規則自定義攔截頁面等功能',
tamper: '升級專業版可以保護網站免受未經授權的修改或篡改', tamper: '升級專業版可以保護網站免受未經授權的修改或篡改',
tamperHelper: '操作失敗該文件或文件夾已經開啟防篡改請檢查後重試',
gpu: '升級專業版可以幫助用戶實時直觀查看到 GPU 的工作負載溫度顯存等重要參數', gpu: '升級專業版可以幫助用戶實時直觀查看到 GPU 的工作負載溫度顯存等重要參數',
setting: '升級專業版可以自定義面板 Logo歡迎簡介等信息', setting: '升級專業版可以自定義面板 Logo歡迎簡介等信息',
monitor: '升級專業版可以查看網站的即時狀態訪客趨勢訪客來源請求日誌等資訊 ', monitor: '升級專業版可以查看網站的即時狀態訪客趨勢訪客來源請求日誌等資訊 ',

View file

@ -1625,6 +1625,7 @@ const message = {
introduce: '功能介绍', introduce: '功能介绍',
waf: '升级专业版可以获得拦截地图日志封锁记录地理位置封禁自定义规则自定义拦截页面等功能', waf: '升级专业版可以获得拦截地图日志封锁记录地理位置封禁自定义规则自定义拦截页面等功能',
tamper: '升级专业版可以保护网站免受未经授权的修改或篡改', tamper: '升级专业版可以保护网站免受未经授权的修改或篡改',
tamperHelper: '操作失败该文件或文件夹已经开启防篡改请检查后重试',
gpu: '升级专业版可以帮助用户实时直观查看到 GPU 的工作负载温度显存等重要参数', gpu: '升级专业版可以帮助用户实时直观查看到 GPU 的工作负载温度显存等重要参数',
setting: '升级专业版可以自定义面板 Logo欢迎简介等信息', setting: '升级专业版可以自定义面板 Logo欢迎简介等信息',
monitor: '升级专业版可以查看网站的实时状态访客趋势访客来源请求日志等信息', monitor: '升级专业版可以查看网站的实时状态访客趋势访客来源请求日志等信息',