From e5cd162b83f10447b1ffb8bca15dee85694b63d9 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 30 Sep 2020 15:14:44 -0700 Subject: [PATCH] Updated api fetch to return an object. --- components/forms/AccountEditForm.js | 8 +++----- components/forms/ChangePasswordForm.js | 8 +++----- components/forms/LoginForm.js | 8 ++++---- components/forms/WebsiteEditForm.js | 8 +++++--- hooks/useFetch.js | 6 ++++-- lib/web.js | 12 +++++------- package.json | 2 +- public/country/ja-JP.json | 1 + public/country/zh-CN.json | 1 + rollup.tracker.config.js | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 public/country/ja-JP.json create mode 100644 public/country/zh-CN.json diff --git a/components/forms/AccountEditForm.js b/components/forms/AccountEditForm.js index 16c6fd3f..f2deea9b 100644 --- a/components/forms/AccountEditForm.js +++ b/components/forms/AccountEditForm.js @@ -32,15 +32,13 @@ export default function AccountEditForm({ values, onSave, onClose }) { const [message, setMessage] = useState(); const handleSubmit = async values => { - const response = await post(`/api/account`, values); + const { ok, data } = await post(`/api/account`, values); - if (typeof response !== 'string') { + if (ok) { onSave(); } else { setMessage( - response || ( - - ), + data || , ); } }; diff --git a/components/forms/ChangePasswordForm.js b/components/forms/ChangePasswordForm.js index e2f225b7..1878ffef 100644 --- a/components/forms/ChangePasswordForm.js +++ b/components/forms/ChangePasswordForm.js @@ -40,15 +40,13 @@ export default function ChangePasswordForm({ values, onSave, onClose }) { const [message, setMessage] = useState(); const handleSubmit = async values => { - const response = await post(`/api/account/password`, values); + const { ok, data } = await post(`/api/account/password`, values); - if (typeof response !== 'string') { + if (ok) { onSave(); } else { setMessage( - response || ( - - ), + data || , ); } }; diff --git a/components/forms/LoginForm.js b/components/forms/LoginForm.js index a34a4474..074da868 100644 --- a/components/forms/LoginForm.js +++ b/components/forms/LoginForm.js @@ -31,19 +31,19 @@ export default function LoginForm() { const [message, setMessage] = useState(); const handleSubmit = async ({ username, password }) => { - const response = await post('/api/auth/login', { username, password }); + const { ok, status, data } = await post('/api/auth/login', { username, password }); - if (typeof response !== 'string') { + if (ok) { await Router.push('/'); } else { setMessage( - response.startsWith('401') ? ( + status === 401 ? ( ) : ( - response + data ), ); } diff --git a/components/forms/WebsiteEditForm.js b/components/forms/WebsiteEditForm.js index 7d405e52..822b7ea5 100644 --- a/components/forms/WebsiteEditForm.js +++ b/components/forms/WebsiteEditForm.js @@ -37,12 +37,14 @@ export default function WebsiteEditForm({ values, onSave, onClose }) { const [message, setMessage] = useState(); const handleSubmit = async values => { - const response = await post(`/api/website`, values); + const { ok, data } = await post(`/api/website`, values); - if (typeof response !== 'string') { + if (ok) { onSave(); } else { - setMessage(); + setMessage( + data || , + ); } }; diff --git a/hooks/useFetch.js b/hooks/useFetch.js index a99778ae..3250acd3 100644 --- a/hooks/useFetch.js +++ b/hooks/useFetch.js @@ -6,6 +6,7 @@ import { updateQuery } from 'redux/actions/queries'; export default function useFetch(url, params = {}, options = {}) { const dispatch = useDispatch(); const [data, setData] = useState(); + const [status, setStatus] = useState(); const [error, setError] = useState(); const [loading, setLoadiing] = useState(false); const keys = Object.keys(params) @@ -18,11 +19,12 @@ export default function useFetch(url, params = {}, options = {}) { setLoadiing(true); setError(null); const time = performance.now(); - const data = await get(url, params); + const { data, status } = await get(url, params); dispatch(updateQuery({ url, time: performance.now() - time, completed: Date.now() })); setData(data); + setStatus(status); onDataLoad(data); } catch (e) { console.error(e); @@ -46,5 +48,5 @@ export default function useFetch(url, params = {}, options = {}) { } }, [url, ...keys, ...update]); - return { data, error, loading, loadData }; + return { data, status, error, loading }; } diff --git a/lib/web.js b/lib/web.js index a20a09c8..9f5003d6 100644 --- a/lib/web.js +++ b/lib/web.js @@ -1,6 +1,6 @@ import { getQueryString } from './url'; -export const apiRequest = (method, url, body) => +export const apiRequest = (method, url, body, headers) => fetch(url, { method, cache: 'no-cache', @@ -8,18 +8,16 @@ export const apiRequest = (method, url, body) => headers: { Accept: 'application/json', 'Content-Type': 'application/json', + ...headers, }, body, }).then(res => { + console.log({ res }); if (res.ok) { - return res.json(); + return res.json().then(data => ({ ok: res.ok, status: res.status, data })); } - if (['post', 'put', 'delete'].includes(method)) { - return res.text(); - } - - return null; + return res.text().then(data => ({ ok: res.ok, status: res.status, res: res, data })); }); export const get = (url, params) => apiRequest('get', `${url}${getQueryString(params)}`); diff --git a/package.json b/package.json index 68a31c0b..311d7aed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "0.62.0", + "version": "0.63.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", diff --git a/public/country/ja-JP.json b/public/country/ja-JP.json new file mode 100644 index 00000000..0b432dc7 --- /dev/null +++ b/public/country/ja-JP.json @@ -0,0 +1 @@ +{"IS":"\u30a2\u30a4\u30b9\u30e9\u30f3\u30c9","IE":"\u30a2\u30a4\u30eb\u30e9\u30f3\u30c9","AZ":"\u30a2\u30bc\u30eb\u30d0\u30a4\u30b8\u30e3\u30f3","AF":"\u30a2\u30d5\u30ac\u30cb\u30b9\u30bf\u30f3","US":"\u30a2\u30e1\u30ea\u30ab\u5408\u8846\u56fd","AE":"\u30a2\u30e9\u30d6\u9996\u9577\u56fd\u9023\u90a6","DZ":"\u30a2\u30eb\u30b8\u30a7\u30ea\u30a2","AR":"\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3","AW":"\u30a2\u30eb\u30d0","AL":"\u30a2\u30eb\u30d0\u30cb\u30a2","AM":"\u30a2\u30eb\u30e1\u30cb\u30a2","AI":"\u30a2\u30f3\u30ae\u30e9","AO":"\u30a2\u30f3\u30b4\u30e9","AG":"\u30a2\u30f3\u30c6\u30a3\u30b0\u30a2\u30fb\u30d0\u30fc\u30d6\u30fc\u30c0","AD":"\u30a2\u30f3\u30c9\u30e9","YE":"\u30a4\u30a8\u30e1\u30f3","GB":"\u30a4\u30ae\u30ea\u30b9","IL":"\u30a4\u30b9\u30e9\u30a8\u30eb","IT":"\u30a4\u30bf\u30ea\u30a2","IQ":"\u30a4\u30e9\u30af","IR":"\u30a4\u30e9\u30f3","IN":"\u30a4\u30f3\u30c9","ID":"\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2","WF":"\u30a6\u30a9\u30ea\u30b9\u30fb\u30d5\u30c4\u30ca","UG":"\u30a6\u30ac\u30f3\u30c0","UA":"\u30a6\u30af\u30e9\u30a4\u30ca","UZ":"\u30a6\u30ba\u30d9\u30ad\u30b9\u30bf\u30f3","UY":"\u30a6\u30eb\u30b0\u30a2\u30a4","EC":"\u30a8\u30af\u30a2\u30c9\u30eb","EG":"\u30a8\u30b8\u30d7\u30c8","EE":"\u30a8\u30b9\u30c8\u30cb\u30a2","SZ":"\u30a8\u30b9\u30ef\u30c6\u30a3\u30cb","ET":"\u30a8\u30c1\u30aa\u30d4\u30a2","ER":"\u30a8\u30ea\u30c8\u30ea\u30a2","SV":"\u30a8\u30eb\u30b5\u30eb\u30d0\u30c9\u30eb","AU":"\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2","AT":"\u30aa\u30fc\u30b9\u30c8\u30ea\u30a2","AX":"\u30aa\u30fc\u30e9\u30f3\u30c9\u8af8\u5cf6","OM":"\u30aa\u30de\u30fc\u30f3","NL":"\u30aa\u30e9\u30f3\u30c0","BQ":"\u30aa\u30e9\u30f3\u30c0\u9818\u30ab\u30ea\u30d6","GH":"\u30ac\u30fc\u30ca","CV":"\u30ab\u30fc\u30dc\u30d9\u30eb\u30c7","GG":"\u30ac\u30fc\u30f3\u30b8\u30fc","GY":"\u30ac\u30a4\u30a2\u30ca","KZ":"\u30ab\u30b6\u30d5\u30b9\u30bf\u30f3","QA":"\u30ab\u30bf\u30fc\u30eb","CA":"\u30ab\u30ca\u30c0","GA":"\u30ac\u30dc\u30f3","CM":"\u30ab\u30e1\u30eb\u30fc\u30f3","GM":"\u30ac\u30f3\u30d3\u30a2","KH":"\u30ab\u30f3\u30dc\u30b8\u30a2","GN":"\u30ae\u30cb\u30a2","GW":"\u30ae\u30cb\u30a2\u30d3\u30b5\u30a6","CY":"\u30ad\u30d7\u30ed\u30b9","CU":"\u30ad\u30e5\u30fc\u30d0","CW":"\u30ad\u30e5\u30e9\u30bd\u30fc","GR":"\u30ae\u30ea\u30b7\u30e3","KI":"\u30ad\u30ea\u30d0\u30b9","KG":"\u30ad\u30eb\u30ae\u30b9","GT":"\u30b0\u30a2\u30c6\u30de\u30e9","GP":"\u30b0\u30a2\u30c9\u30eb\u30fc\u30d7","GU":"\u30b0\u30a2\u30e0","KW":"\u30af\u30a6\u30a7\u30fc\u30c8","CK":"\u30af\u30c3\u30af\u8af8\u5cf6","GL":"\u30b0\u30ea\u30fc\u30f3\u30e9\u30f3\u30c9","CX":"\u30af\u30ea\u30b9\u30de\u30b9\u5cf6","GD":"\u30b0\u30ec\u30ca\u30c0","HR":"\u30af\u30ed\u30a2\u30c1\u30a2","KY":"\u30b1\u30a4\u30de\u30f3\u8af8\u5cf6","KE":"\u30b1\u30cb\u30a2","CI":"\u30b3\u30fc\u30c8\u30b8\u30dc\u30ef\u30fc\u30eb","CC":"\u30b3\u30b3\u30b9(\u30ad\u30fc\u30ea\u30f3\u30b0)\u8af8\u5cf6","CR":"\u30b3\u30b9\u30bf\u30ea\u30ab","KM":"\u30b3\u30e2\u30ed","CO":"\u30b3\u30ed\u30f3\u30d3\u30a2","CG":"\u30b3\u30f3\u30b4\u5171\u548c\u56fd(\u30d6\u30e9\u30b6\u30d3\u30eb)","CD":"\u30b3\u30f3\u30b4\u6c11\u4e3b\u5171\u548c\u56fd(\u30ad\u30f3\u30b7\u30e3\u30b5)","SA":"\u30b5\u30a6\u30b8\u30a2\u30e9\u30d3\u30a2","GS":"\u30b5\u30a6\u30b9\u30b8\u30e7\u30fc\u30b8\u30a2\u30fb\u30b5\u30a6\u30b9\u30b5\u30f3\u30c9\u30a6\u30a3\u30c3\u30c1\u8af8\u5cf6","WS":"\u30b5\u30e2\u30a2","BL":"\u30b5\u30f3\u30fb\u30d0\u30eb\u30c6\u30eb\u30df\u30fc","MF":"\u30b5\u30f3\u30fb\u30de\u30eb\u30bf\u30f3","ST":"\u30b5\u30f3\u30c8\u30e1\u30fb\u30d7\u30ea\u30f3\u30b7\u30da","ZM":"\u30b6\u30f3\u30d3\u30a2","PM":"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u5cf6\u30fb\u30df\u30af\u30ed\u30f3\u5cf6","SM":"\u30b5\u30f3\u30de\u30ea\u30ce","SL":"\u30b7\u30a8\u30e9\u30ec\u30aa\u30cd","DJ":"\u30b8\u30d6\u30c1","GI":"\u30b8\u30d6\u30e9\u30eb\u30bf\u30eb","JE":"\u30b8\u30e3\u30fc\u30b8\u30fc","JM":"\u30b8\u30e3\u30de\u30a4\u30ab","GE":"\u30b8\u30e7\u30fc\u30b8\u30a2","SY":"\u30b7\u30ea\u30a2","SG":"\u30b7\u30f3\u30ac\u30dd\u30fc\u30eb","SX":"\u30b7\u30f3\u30c8\u30fb\u30de\u30fc\u30eb\u30c6\u30f3","ZW":"\u30b8\u30f3\u30d0\u30d6\u30a8","CH":"\u30b9\u30a4\u30b9","SE":"\u30b9\u30a6\u30a7\u30fc\u30c7\u30f3","SD":"\u30b9\u30fc\u30c0\u30f3","SJ":"\u30b9\u30d0\u30fc\u30eb\u30d0\u30eb\u8af8\u5cf6\u30fb\u30e4\u30f3\u30de\u30a4\u30a8\u30f3\u5cf6","ES":"\u30b9\u30da\u30a4\u30f3","SR":"\u30b9\u30ea\u30ca\u30e0","LK":"\u30b9\u30ea\u30e9\u30f3\u30ab","SK":"\u30b9\u30ed\u30d0\u30ad\u30a2","SI":"\u30b9\u30ed\u30d9\u30cb\u30a2","SC":"\u30bb\u30fc\u30b7\u30a7\u30eb","SN":"\u30bb\u30cd\u30ac\u30eb","RS":"\u30bb\u30eb\u30d3\u30a2","KN":"\u30bb\u30f3\u30c8\u30af\u30ea\u30b9\u30c8\u30d5\u30a1\u30fc\u30fb\u30cd\u30fc\u30f4\u30a3\u30b9","VC":"\u30bb\u30f3\u30c8\u30d3\u30f3\u30bb\u30f3\u30c8\u53ca\u3073\u30b0\u30ec\u30ca\u30c7\u30a3\u30fc\u30f3\u8af8\u5cf6","SH":"\u30bb\u30f3\u30c8\u30d8\u30ec\u30ca","LC":"\u30bb\u30f3\u30c8\u30eb\u30b7\u30a2","SO":"\u30bd\u30de\u30ea\u30a2","SB":"\u30bd\u30ed\u30e2\u30f3\u8af8\u5cf6","TC":"\u30bf\u30fc\u30af\u30b9\u30fb\u30ab\u30a4\u30b3\u30b9\u8af8\u5cf6","TH":"\u30bf\u30a4","TJ":"\u30bf\u30b8\u30ad\u30b9\u30bf\u30f3","TZ":"\u30bf\u30f3\u30b6\u30cb\u30a2","CZ":"\u30c1\u30a7\u30b3","TD":"\u30c1\u30e3\u30c9","TN":"\u30c1\u30e5\u30cb\u30b8\u30a2","CL":"\u30c1\u30ea","TV":"\u30c4\u30d0\u30eb","DK":"\u30c7\u30f3\u30de\u30fc\u30af","DE":"\u30c9\u30a4\u30c4","TG":"\u30c8\u30fc\u30b4","TK":"\u30c8\u30b1\u30e9\u30a6","DO":"\u30c9\u30df\u30cb\u30ab\u5171\u548c\u56fd","DM":"\u30c9\u30df\u30cb\u30ab\u56fd","TT":"\u30c8\u30ea\u30cb\u30c0\u30fc\u30c9\u30fb\u30c8\u30d0\u30b4","TM":"\u30c8\u30eb\u30af\u30e1\u30cb\u30b9\u30bf\u30f3","TR":"\u30c8\u30eb\u30b3","TO":"\u30c8\u30f3\u30ac","NG":"\u30ca\u30a4\u30b8\u30a7\u30ea\u30a2","NR":"\u30ca\u30a6\u30eb","NA":"\u30ca\u30df\u30d3\u30a2","NU":"\u30cb\u30a6\u30a8","NI":"\u30cb\u30ab\u30e9\u30b0\u30a2","NE":"\u30cb\u30b8\u30a7\u30fc\u30eb","NC":"\u30cb\u30e5\u30fc\u30ab\u30ec\u30c9\u30cb\u30a2","NZ":"\u30cb\u30e5\u30fc\u30b8\u30fc\u30e9\u30f3\u30c9","NP":"\u30cd\u30d1\u30fc\u30eb","NF":"\u30ce\u30fc\u30d5\u30a9\u30fc\u30af\u5cf6","NO":"\u30ce\u30eb\u30a6\u30a7\u30fc","HM":"\u30cf\u30fc\u30c9\u5cf6\u30fb\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u8af8\u5cf6","BH":"\u30d0\u30fc\u30ec\u30fc\u30f3","HT":"\u30cf\u30a4\u30c1","PK":"\u30d1\u30ad\u30b9\u30bf\u30f3","VA":"\u30d0\u30c1\u30ab\u30f3\u5e02\u56fd","PA":"\u30d1\u30ca\u30de","VU":"\u30d0\u30cc\u30a2\u30c4","BS":"\u30d0\u30cf\u30de","PG":"\u30d1\u30d7\u30a2\u30cb\u30e5\u30fc\u30ae\u30cb\u30a2","BM":"\u30d0\u30df\u30e5\u30fc\u30c0","PW":"\u30d1\u30e9\u30aa","PY":"\u30d1\u30e9\u30b0\u30a2\u30a4","BB":"\u30d0\u30eb\u30d0\u30c9\u30b9","PS":"\u30d1\u30ec\u30b9\u30c1\u30ca\u81ea\u6cbb\u533a","HU":"\u30cf\u30f3\u30ac\u30ea\u30fc","BD":"\u30d0\u30f3\u30b0\u30e9\u30c7\u30b7\u30e5","PN":"\u30d4\u30c8\u30b1\u30a2\u30f3\u8af8\u5cf6","FJ":"\u30d5\u30a3\u30b8\u30fc","PH":"\u30d5\u30a3\u30ea\u30d4\u30f3","FI":"\u30d5\u30a3\u30f3\u30e9\u30f3\u30c9","BT":"\u30d6\u30fc\u30bf\u30f3","BV":"\u30d6\u30fc\u30d9\u5cf6","PR":"\u30d7\u30a8\u30eb\u30c8\u30ea\u30b3","FO":"\u30d5\u30a7\u30ed\u30fc\u8af8\u5cf6","FK":"\u30d5\u30a9\u30fc\u30af\u30e9\u30f3\u30c9\u8af8\u5cf6","BR":"\u30d6\u30e9\u30b8\u30eb","FR":"\u30d5\u30e9\u30f3\u30b9","BG":"\u30d6\u30eb\u30ac\u30ea\u30a2","BF":"\u30d6\u30eb\u30ad\u30ca\u30d5\u30a1\u30bd","BN":"\u30d6\u30eb\u30cd\u30a4","BI":"\u30d6\u30eb\u30f3\u30b8","VN":"\u30d9\u30c8\u30ca\u30e0","BJ":"\u30d9\u30ca\u30f3","VE":"\u30d9\u30cd\u30ba\u30a8\u30e9","BY":"\u30d9\u30e9\u30eb\u30fc\u30b7","BZ":"\u30d9\u30ea\u30fc\u30ba","PE":"\u30da\u30eb\u30fc","BE":"\u30d9\u30eb\u30ae\u30fc","PL":"\u30dd\u30fc\u30e9\u30f3\u30c9","BA":"\u30dc\u30b9\u30cb\u30a2\u30fb\u30d8\u30eb\u30c4\u30a7\u30b4\u30d3\u30ca","BW":"\u30dc\u30c4\u30ef\u30ca","BO":"\u30dc\u30ea\u30d3\u30a2","PT":"\u30dd\u30eb\u30c8\u30ac\u30eb","HN":"\u30db\u30f3\u30b8\u30e5\u30e9\u30b9","MH":"\u30de\u30fc\u30b7\u30e3\u30eb\u8af8\u5cf6","MG":"\u30de\u30c0\u30ac\u30b9\u30ab\u30eb","YT":"\u30de\u30e8\u30c3\u30c8","MW":"\u30de\u30e9\u30a6\u30a4","ML":"\u30de\u30ea","MT":"\u30de\u30eb\u30bf","MQ":"\u30de\u30eb\u30c6\u30a3\u30cb\u30fc\u30af","MY":"\u30de\u30ec\u30fc\u30b7\u30a2","IM":"\u30de\u30f3\u5cf6","FM":"\u30df\u30af\u30ed\u30cd\u30b7\u30a2\u9023\u90a6","MM":"\u30df\u30e3\u30f3\u30de\u30fc (\u30d3\u30eb\u30de)","MX":"\u30e1\u30ad\u30b7\u30b3","MU":"\u30e2\u30fc\u30ea\u30b7\u30e3\u30b9","MR":"\u30e2\u30fc\u30ea\u30bf\u30cb\u30a2","MZ":"\u30e2\u30b6\u30f3\u30d3\u30fc\u30af","MC":"\u30e2\u30ca\u30b3","MV":"\u30e2\u30eb\u30c7\u30a3\u30d6","MD":"\u30e2\u30eb\u30c9\u30d0","MA":"\u30e2\u30ed\u30c3\u30b3","MN":"\u30e2\u30f3\u30b4\u30eb","ME":"\u30e2\u30f3\u30c6\u30cd\u30b0\u30ed","MS":"\u30e2\u30f3\u30c8\u30bb\u30e9\u30c8","JO":"\u30e8\u30eb\u30c0\u30f3","LA":"\u30e9\u30aa\u30b9","LV":"\u30e9\u30c8\u30d3\u30a2","LT":"\u30ea\u30c8\u30a2\u30cb\u30a2","LY":"\u30ea\u30d3\u30a2","LI":"\u30ea\u30d2\u30c6\u30f3\u30b7\u30e5\u30bf\u30a4\u30f3","LR":"\u30ea\u30d9\u30ea\u30a2","RO":"\u30eb\u30fc\u30de\u30cb\u30a2","LU":"\u30eb\u30af\u30bb\u30f3\u30d6\u30eb\u30af","RW":"\u30eb\u30ef\u30f3\u30c0","LS":"\u30ec\u30bd\u30c8","LB":"\u30ec\u30d0\u30ce\u30f3","RE":"\u30ec\u30e6\u30cb\u30aa\u30f3","RU":"\u30ed\u30b7\u30a2","IO":"\u82f1\u9818\u30a4\u30f3\u30c9\u6d0b\u5730\u57df","VG":"\u82f1\u9818\u30f4\u30a1\u30fc\u30b8\u30f3\u8af8\u5cf6","KR":"\u97d3\u56fd","UM":"\u5408\u8846\u56fd\u9818\u6709\u5c0f\u96e2\u5cf6","EH":"\u897f\u30b5\u30cf\u30e9","GQ":"\u8d64\u9053\u30ae\u30cb\u30a2","TW":"\u53f0\u6e7e","CF":"\u4e2d\u592e\u30a2\u30d5\u30ea\u30ab\u5171\u548c\u56fd","MO":"\u4e2d\u83ef\u4eba\u6c11\u5171\u548c\u56fd\u30de\u30ab\u30aa\u7279\u5225\u884c\u653f\u533a","HK":"\u4e2d\u83ef\u4eba\u6c11\u5171\u548c\u56fd\u9999\u6e2f\u7279\u5225\u884c\u653f\u533a","CN":"\u4e2d\u56fd","TL":"\u6771\u30c6\u30a3\u30e2\u30fc\u30eb","ZA":"\u5357\u30a2\u30d5\u30ea\u30ab","SS":"\u5357\u30b9\u30fc\u30c0\u30f3","AQ":"\u5357\u6975","JP":"\u65e5\u672c","GF":"\u4ecf\u9818\u30ae\u30a2\u30ca","PF":"\u4ecf\u9818\u30dd\u30ea\u30cd\u30b7\u30a2","TF":"\u4ecf\u9818\u6975\u5357\u8af8\u5cf6","VI":"\u7c73\u9818\u30f4\u30a1\u30fc\u30b8\u30f3\u8af8\u5cf6","AS":"\u7c73\u9818\u30b5\u30e2\u30a2","MK":"\u5317\u30de\u30b1\u30c9\u30cb\u30a2","MP":"\u5317\u30de\u30ea\u30a2\u30ca\u8af8\u5cf6","KP":"\u5317\u671d\u9bae"} \ No newline at end of file diff --git a/public/country/zh-CN.json b/public/country/zh-CN.json new file mode 100644 index 00000000..b6ad153c --- /dev/null +++ b/public/country/zh-CN.json @@ -0,0 +1 @@ +{"AL":"\u963f\u5c14\u5df4\u5c3c\u4e9a","DZ":"\u963f\u5c14\u53ca\u5229\u4e9a","AF":"\u963f\u5bcc\u6c57","AR":"\u963f\u6839\u5ef7","AE":"\u963f\u62c9\u4f2f\u8054\u5408\u914b\u957f\u56fd","AW":"\u963f\u9c81\u5df4","OM":"\u963f\u66fc","AZ":"\u963f\u585e\u62dc\u7586","EG":"\u57c3\u53ca","ET":"\u57c3\u585e\u4fc4\u6bd4\u4e9a","IE":"\u7231\u5c14\u5170","EE":"\u7231\u6c99\u5c3c\u4e9a","AD":"\u5b89\u9053\u5c14","AO":"\u5b89\u54e5\u62c9","AI":"\u5b89\u572d\u62c9","AG":"\u5b89\u63d0\u74dc\u548c\u5df4\u5e03\u8fbe","AT":"\u5965\u5730\u5229","AX":"\u5965\u5170\u7fa4\u5c9b","AU":"\u6fb3\u5927\u5229\u4e9a","BB":"\u5df4\u5df4\u591a\u65af","PG":"\u5df4\u5e03\u4e9a\u65b0\u51e0\u5185\u4e9a","BS":"\u5df4\u54c8\u9a6c","PK":"\u5df4\u57fa\u65af\u5766","PY":"\u5df4\u62c9\u572d","PS":"\u5df4\u52d2\u65af\u5766\u9886\u571f","BH":"\u5df4\u6797","PA":"\u5df4\u62ff\u9a6c","BR":"\u5df4\u897f","BY":"\u767d\u4fc4\u7f57\u65af","BM":"\u767e\u6155\u5927","BG":"\u4fdd\u52a0\u5229\u4e9a","MP":"\u5317\u9a6c\u91cc\u4e9a\u7eb3\u7fa4\u5c9b","MK":"\u5317\u9a6c\u5176\u987f","BJ":"\u8d1d\u5b81","BE":"\u6bd4\u5229\u65f6","IS":"\u51b0\u5c9b","PR":"\u6ce2\u591a\u9ece\u5404","PL":"\u6ce2\u5170","BA":"\u6ce2\u65af\u5c3c\u4e9a\u548c\u9ed1\u585e\u54e5\u7ef4\u90a3","BO":"\u73bb\u5229\u7ef4\u4e9a","BZ":"\u4f2f\u5229\u5179","BW":"\u535a\u8328\u74e6\u7eb3","BT":"\u4e0d\u4e39","BF":"\u5e03\u57fa\u7eb3\u6cd5\u7d22","BI":"\u5e03\u9686\u8fea","BV":"\u5e03\u97e6\u5c9b","KP":"\u671d\u9c9c","GQ":"\u8d64\u9053\u51e0\u5185\u4e9a","DK":"\u4e39\u9ea6","DE":"\u5fb7\u56fd","TL":"\u4e1c\u5e1d\u6c76","TG":"\u591a\u54e5","DO":"\u591a\u7c73\u5c3c\u52a0\u5171\u548c\u56fd","DM":"\u591a\u7c73\u5c3c\u514b","RU":"\u4fc4\u7f57\u65af","EC":"\u5384\u74dc\u591a\u5c14","ER":"\u5384\u7acb\u7279\u91cc\u4e9a","FR":"\u6cd5\u56fd","FO":"\u6cd5\u7f57\u7fa4\u5c9b","PF":"\u6cd5\u5c5e\u6ce2\u5229\u5c3c\u897f\u4e9a","GF":"\u6cd5\u5c5e\u572d\u4e9a\u90a3","TF":"\u6cd5\u5c5e\u5357\u90e8\u9886\u5730","MF":"\u6cd5\u5c5e\u5723\u9a6c\u4e01","VA":"\u68b5\u8482\u5188","PH":"\u83f2\u5f8b\u5bbe","FJ":"\u6590\u6d4e","FI":"\u82ac\u5170","CV":"\u4f5b\u5f97\u89d2","FK":"\u798f\u514b\u5170\u7fa4\u5c9b","GM":"\u5188\u6bd4\u4e9a","CG":"\u521a\u679c\uff08\u5e03\uff09","CD":"\u521a\u679c\uff08\u91d1\uff09","CO":"\u54e5\u4f26\u6bd4\u4e9a","CR":"\u54e5\u65af\u8fbe\u9ece\u52a0","GD":"\u683c\u6797\u7eb3\u8fbe","GL":"\u683c\u9675\u5170","GE":"\u683c\u9c81\u5409\u4e9a","GG":"\u6839\u897f\u5c9b","CU":"\u53e4\u5df4","GP":"\u74dc\u5fb7\u7f57\u666e","GU":"\u5173\u5c9b","GY":"\u572d\u4e9a\u90a3","KZ":"\u54c8\u8428\u514b\u65af\u5766","HT":"\u6d77\u5730","KR":"\u97e9\u56fd","NL":"\u8377\u5170","BQ":"\u8377\u5c5e\u52a0\u52d2\u6bd4\u533a","SX":"\u8377\u5c5e\u5723\u9a6c\u4e01","HM":"\u8d6b\u5fb7\u5c9b\u548c\u9ea6\u514b\u5510\u7eb3\u7fa4\u5c9b","ME":"\u9ed1\u5c71","HN":"\u6d2a\u90fd\u62c9\u65af","KI":"\u57fa\u91cc\u5df4\u65af","DJ":"\u5409\u5e03\u63d0","KG":"\u5409\u5c14\u5409\u65af\u65af\u5766","GN":"\u51e0\u5185\u4e9a","GW":"\u51e0\u5185\u4e9a\u6bd4\u7ecd","CA":"\u52a0\u62ff\u5927","GH":"\u52a0\u7eb3","GA":"\u52a0\u84ec","KH":"\u67ec\u57d4\u5be8","CZ":"\u6377\u514b","ZW":"\u6d25\u5df4\u5e03\u97e6","CM":"\u5580\u9ea6\u9686","QA":"\u5361\u5854\u5c14","KY":"\u5f00\u66fc\u7fa4\u5c9b","CC":"\u79d1\u79d1\u65af\uff08\u57fa\u6797\uff09\u7fa4\u5c9b","KM":"\u79d1\u6469\u7f57","CI":"\u79d1\u7279\u8fea\u74e6","KW":"\u79d1\u5a01\u7279","HR":"\u514b\u7f57\u5730\u4e9a","KE":"\u80af\u5c3c\u4e9a","CK":"\u5e93\u514b\u7fa4\u5c9b","CW":"\u5e93\u62c9\u7d22","LV":"\u62c9\u8131\u7ef4\u4e9a","LS":"\u83b1\u7d22\u6258","LA":"\u8001\u631d","LB":"\u9ece\u5df4\u5ae9","LT":"\u7acb\u9676\u5b9b","LR":"\u5229\u6bd4\u91cc\u4e9a","LY":"\u5229\u6bd4\u4e9a","LI":"\u5217\u652f\u6566\u58eb\u767b","RE":"\u7559\u5c3c\u6c6a","LU":"\u5362\u68ee\u5821","RW":"\u5362\u65fa\u8fbe","RO":"\u7f57\u9a6c\u5c3c\u4e9a","MG":"\u9a6c\u8fbe\u52a0\u65af\u52a0","IM":"\u9a6c\u6069\u5c9b","MV":"\u9a6c\u5c14\u4ee3\u592b","MT":"\u9a6c\u8033\u4ed6","MW":"\u9a6c\u62c9\u7ef4","MY":"\u9a6c\u6765\u897f\u4e9a","ML":"\u9a6c\u91cc","MH":"\u9a6c\u7ecd\u5c14\u7fa4\u5c9b","MQ":"\u9a6c\u63d0\u5c3c\u514b","YT":"\u9a6c\u7ea6\u7279","MU":"\u6bdb\u91cc\u6c42\u65af","MR":"\u6bdb\u91cc\u5854\u5c3c\u4e9a","US":"\u7f8e\u56fd","UM":"\u7f8e\u56fd\u672c\u571f\u5916\u5c0f\u5c9b\u5c7f","AS":"\u7f8e\u5c5e\u8428\u6469\u4e9a","VI":"\u7f8e\u5c5e\u7ef4\u5c14\u4eac\u7fa4\u5c9b","MN":"\u8499\u53e4","MS":"\u8499\u7279\u585e\u62c9\u7279","BD":"\u5b5f\u52a0\u62c9\u56fd","PE":"\u79d8\u9c81","FM":"\u5bc6\u514b\u7f57\u5c3c\u897f\u4e9a","MM":"\u7f05\u7538","MD":"\u6469\u5c14\u591a\u74e6","MA":"\u6469\u6d1b\u54e5","MC":"\u6469\u7eb3\u54e5","MZ":"\u83ab\u6851\u6bd4\u514b","MX":"\u58a8\u897f\u54e5","NA":"\u7eb3\u7c73\u6bd4\u4e9a","ZA":"\u5357\u975e","AQ":"\u5357\u6781\u6d32","GS":"\u5357\u4e54\u6cbb\u4e9a\u548c\u5357\u6851\u5a01\u5947\u7fa4\u5c9b","SS":"\u5357\u82cf\u4e39","NR":"\u7459\u9c81","NI":"\u5c3c\u52a0\u62c9\u74dc","NP":"\u5c3c\u6cca\u5c14","NE":"\u5c3c\u65e5\u5c14","NG":"\u5c3c\u65e5\u5229\u4e9a","NU":"\u7ebd\u57c3","NO":"\u632a\u5a01","NF":"\u8bfa\u798f\u514b\u5c9b","PW":"\u5e15\u52b3","PN":"\u76ae\u7279\u51ef\u6069\u7fa4\u5c9b","PT":"\u8461\u8404\u7259","JP":"\u65e5\u672c","SE":"\u745e\u5178","CH":"\u745e\u58eb","SV":"\u8428\u5c14\u74e6\u591a","WS":"\u8428\u6469\u4e9a","RS":"\u585e\u5c14\u7ef4\u4e9a","SL":"\u585e\u62c9\u5229\u6602","SN":"\u585e\u5185\u52a0\u5c14","CY":"\u585e\u6d66\u8def\u65af","SC":"\u585e\u820c\u5c14","SA":"\u6c99\u7279\u963f\u62c9\u4f2f","BL":"\u5723\u5df4\u6cf0\u52d2\u7c73","CX":"\u5723\u8bde\u5c9b","ST":"\u5723\u591a\u7f8e\u548c\u666e\u6797\u897f\u6bd4","SH":"\u5723\u8d6b\u52d2\u62ff","KN":"\u5723\u57fa\u8328\u548c\u5c3c\u7ef4\u65af","LC":"\u5723\u5362\u897f\u4e9a","SM":"\u5723\u9a6c\u529b\u8bfa","PM":"\u5723\u76ae\u57c3\u5c14\u548c\u5bc6\u514b\u9686\u7fa4\u5c9b","VC":"\u5723\u6587\u68ee\u7279\u548c\u683c\u6797\u7eb3\u4e01\u65af","LK":"\u65af\u91cc\u5170\u5361","SK":"\u65af\u6d1b\u4f10\u514b","SI":"\u65af\u6d1b\u6587\u5c3c\u4e9a","SJ":"\u65af\u74e6\u5c14\u5df4\u548c\u626c\u9a6c\u5ef6","SZ":"\u65af\u5a01\u58eb\u5170","SD":"\u82cf\u4e39","SR":"\u82cf\u91cc\u5357","SB":"\u6240\u7f57\u95e8\u7fa4\u5c9b","SO":"\u7d22\u9a6c\u91cc","TJ":"\u5854\u5409\u514b\u65af\u5766","TW":"\u53f0\u6e7e","TH":"\u6cf0\u56fd","TZ":"\u5766\u6851\u5c3c\u4e9a","TO":"\u6c64\u52a0","TC":"\u7279\u514b\u65af\u548c\u51ef\u79d1\u65af\u7fa4\u5c9b","TT":"\u7279\u7acb\u5c3c\u8fbe\u548c\u591a\u5df4\u54e5","TN":"\u7a81\u5c3c\u65af","TV":"\u56fe\u74e6\u5362","TR":"\u571f\u8033\u5176","TM":"\u571f\u5e93\u66fc\u65af\u5766","TK":"\u6258\u514b\u52b3","WF":"\u74e6\u5229\u65af\u548c\u5bcc\u56fe\u7eb3","VU":"\u74e6\u52aa\u963f\u56fe","GT":"\u5371\u5730\u9a6c\u62c9","VE":"\u59d4\u5185\u745e\u62c9","BN":"\u6587\u83b1","UG":"\u4e4c\u5e72\u8fbe","UA":"\u4e4c\u514b\u5170","UY":"\u4e4c\u62c9\u572d","UZ":"\u4e4c\u5179\u522b\u514b\u65af\u5766","ES":"\u897f\u73ed\u7259","EH":"\u897f\u6492\u54c8\u62c9","GR":"\u5e0c\u814a","SG":"\u65b0\u52a0\u5761","NC":"\u65b0\u5580\u91cc\u591a\u5c3c\u4e9a","NZ":"\u65b0\u897f\u5170","HU":"\u5308\u7259\u5229","SY":"\u53d9\u5229\u4e9a","JM":"\u7259\u4e70\u52a0","AM":"\u4e9a\u7f8e\u5c3c\u4e9a","YE":"\u4e5f\u95e8","IQ":"\u4f0a\u62c9\u514b","IR":"\u4f0a\u6717","IL":"\u4ee5\u8272\u5217","IT":"\u610f\u5927\u5229","IN":"\u5370\u5ea6","ID":"\u5370\u5ea6\u5c3c\u897f\u4e9a","GB":"\u82f1\u56fd","VG":"\u82f1\u5c5e\u7ef4\u5c14\u4eac\u7fa4\u5c9b","IO":"\u82f1\u5c5e\u5370\u5ea6\u6d0b\u9886\u5730","JO":"\u7ea6\u65e6","VN":"\u8d8a\u5357","ZM":"\u8d5e\u6bd4\u4e9a","JE":"\u6cfd\u897f\u5c9b","TD":"\u4e4d\u5f97","GI":"\u76f4\u5e03\u7f57\u9640","CL":"\u667a\u5229","CF":"\u4e2d\u975e\u5171\u548c\u56fd","CN":"\u4e2d\u56fd","MO":"\u4e2d\u56fd\u6fb3\u95e8\u7279\u522b\u884c\u653f\u533a","HK":"\u4e2d\u56fd\u9999\u6e2f\u7279\u522b\u884c\u653f\u533a"} \ No newline at end of file diff --git a/rollup.tracker.config.js b/rollup.tracker.config.js index e836955f..5d2938ee 100644 --- a/rollup.tracker.config.js +++ b/rollup.tracker.config.js @@ -9,5 +9,5 @@ export default { file: 'public/umami.js', format: 'iife', }, - plugins: [resolve(), buble(), terser({ compress: { evaluate: false } })], + plugins: [resolve(), buble({ objectAssign: true }), terser({ compress: { evaluate: false } })], };