diff --git a/package.json b/package.json index fb1e8d55..448d1ec3 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "nprogress": "0.2.0", "path-to-regexp": "2.4.0", "screenfull": "4.2.0", + "script-loader": "0.7.2", "showdown": "1.9.0", "sortablejs": "1.8.4", "tui-editor": "1.3.3", @@ -96,7 +97,6 @@ "runjs": "^4.3.2", "sass-loader": "^7.1.0", "script-ext-html-webpack-plugin": "2.1.3", - "script-loader": "0.7.2", "serve-static": "^1.13.2", "svg-sprite-loader": "4.1.3", "svgo": "1.2.0", diff --git a/src/utils/index.js b/src/utils/index.js index 2684e3c2..eb760d5e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -17,9 +17,17 @@ export function parseTime(time, cFormat) { if (typeof time === 'object') { date = time } else { - if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { - time = parseInt(time) + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } } + if ((typeof time === 'number') && (time.toString().length === 10)) { time = time * 1000 } diff --git a/src/views/profile/components/UserCard.vue b/src/views/profile/components/UserCard.vue index b9a383d6..2476f04a 100644 --- a/src/views/profile/components/UserCard.vue +++ b/src/views/profile/components/UserCard.vue @@ -65,7 +65,7 @@ export default { name: '', email: '', avatar: '', - roles: '' + role: '' } } } diff --git a/src/views/tab/index.vue b/src/views/tab/index.vue index 862a160f..2a35fa58 100644 --- a/src/views/tab/index.vue +++ b/src/views/tab/index.vue @@ -13,11 +13,11 @@