Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa8368e4fb | ||
|
|
bfd9878597 | ||
|
|
b64aa13a65 |
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
此文件受版权保护,未经授权禁止修改!如果您尚未获得授权,请通过微信(shouzi_1994)联系我们以购买授权。在未授权状态下,只需保留此代码,不会影响任何正常使用。
|
|
||||||
未经授权的商用使用可能会被我们的资产搜索引擎爬取,并可能导致后续索赔。索赔金额将不低于高级授权费的十倍。请您遵守版权法律法规,尊重知识产权。
|
|
||||||
*/
|
|
||||||
|
|
||||||
import child_process from 'child_process'
|
|
||||||
|
|
||||||
var url = 'https://www.gin-vue-admin.com'
|
|
||||||
var cmd = ''
|
|
||||||
switch (process.platform) {
|
|
||||||
case 'win32':
|
|
||||||
cmd = 'start'
|
|
||||||
child_process.exec(cmd + ' ' + url)
|
|
||||||
break
|
|
||||||
|
|
||||||
case 'darwin':
|
|
||||||
cmd = 'open'
|
|
||||||
child_process.exec(cmd + ' ' + url)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
"version": "2.8.6",
|
"version": "2.8.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node openDocument.js && vite --host --mode development",
|
"dev": "vite --host --mode development",
|
||||||
"serve": "node openDocument.js && vite --host --mode development",
|
"serve": "vite --host --mode development",
|
||||||
"build": "vite build --mode production",
|
"build": "vite build --mode production",
|
||||||
"limit-build": "npm install increase-memory-limit-fixbug cross-env -g && npm run fix-memory-limit && node ./limit && npm run build",
|
"limit-build": "npm install increase-memory-limit-fixbug cross-env -g && npm run fix-memory-limit && node ./limit && npm run build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
|||||||
@@ -9,21 +9,5 @@ import packageInfo from '../../package.json'
|
|||||||
export default {
|
export default {
|
||||||
install: (app) => {
|
install: (app) => {
|
||||||
register(app)
|
register(app)
|
||||||
console.log(`
|
|
||||||
欢迎使用 Gin-Vue-Admin
|
|
||||||
当前版本:v${packageInfo.version}
|
|
||||||
加群方式:微信:shouzi_1994 QQ群:622360840
|
|
||||||
项目地址:https://github.com/flipped-aurora/gin-vue-admin
|
|
||||||
插件市场:https://plugin.gin-vue-admin.com
|
|
||||||
GVA讨论社区:https://support.qq.com/products/371961
|
|
||||||
默认自动化文档地址:http://127.0.0.1:${import.meta.env.VITE_SERVER_PORT}/swagger/index.html
|
|
||||||
默认前端文件运行地址:http://127.0.0.1:${import.meta.env.VITE_CLI_PORT}
|
|
||||||
如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/coffee/index.html
|
|
||||||
--------------------------------------版权声明--------------------------------------
|
|
||||||
** 版权所有方:flipped-aurora开源团队 **
|
|
||||||
** 版权持有公司:北京翻转极光科技有限责任公司 **
|
|
||||||
** 剔除授权标识需购买商用授权:https://gin-vue-admin.com/empower/index.html **
|
|
||||||
** 感谢您对Gin-Vue-Admin的支持与关注 合法授权使用更有利于项目的长久发展**
|
|
||||||
`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
0
src/plugin/.gitkeep
Normal file
0
src/plugin/.gitkeep
Normal file
38
src/utils/date.js
Normal file
38
src/utils/date.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
// 对Date的扩展,将 Date 转化为指定格式的String
|
||||||
|
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
|
||||||
|
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
|
||||||
|
// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
|
||||||
|
// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
|
||||||
|
// eslint-disable-next-line no-extend-native
|
||||||
|
Date.prototype.Format = function (fmt) {
|
||||||
|
const o = {
|
||||||
|
'M+': this.getMonth() + 1, // 月份
|
||||||
|
'd+': this.getDate(), // 日
|
||||||
|
'h+': this.getHours(), // 小时
|
||||||
|
'm+': this.getMinutes(), // 分
|
||||||
|
's+': this.getSeconds(), // 秒
|
||||||
|
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
|
||||||
|
S: this.getMilliseconds() // 毫秒
|
||||||
|
}
|
||||||
|
const reg = /(y+)/
|
||||||
|
if (reg.test(fmt)) {
|
||||||
|
const t = reg.exec(fmt)[1]
|
||||||
|
fmt = fmt.replace(t, (this.getFullYear() + '').substring(4 - t.length))
|
||||||
|
}
|
||||||
|
for (let k in o) {
|
||||||
|
const regx = new RegExp('(' + k + ')')
|
||||||
|
if (regx.test(fmt)) {
|
||||||
|
const t = regx.exec(fmt)[1]
|
||||||
|
fmt = fmt.replace(t, t.length === 1 ? o[k] : ('00' + o[k]).substring(('' + o[k]).length))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fmt
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatTimeToStr(times, pattern) {
|
||||||
|
let d = new Date(times).Format('yyyy-MM-dd hh:mm:ss')
|
||||||
|
if (pattern) {
|
||||||
|
d = new Date(times).Format(pattern)
|
||||||
|
}
|
||||||
|
return d.toLocaleString()
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { formatTimeToStr } from '@/utils/date'
|
||||||
import { getDict } from '@/utils/dictionary'
|
import { getDict } from '@/utils/dictionary'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
@@ -8,7 +9,14 @@ export const formatBoolean = (bool) => {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export const formatDate = (time) => {
|
||||||
|
if (time !== null && time !== '') {
|
||||||
|
var date = new Date(time)
|
||||||
|
return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
export const filterDict = (value, options) => {
|
export const filterDict = (value, options) => {
|
||||||
// 递归查找函数
|
// 递归查找函数
|
||||||
const findInOptions = (opts, targetValue) => {
|
const findInOptions = (opts, targetValue) => {
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ const clearAndUpper = (text) => {
|
|||||||
|
|
||||||
// 递归获取目录下所有的 .vue 文件
|
// 递归获取目录下所有的 .vue 文件
|
||||||
const getAllVueFiles = (dir, fileList = []) => {
|
const getAllVueFiles = (dir, fileList = []) => {
|
||||||
|
if (!fs.existsSync(dir)) {
|
||||||
|
return fileList
|
||||||
|
}
|
||||||
const files = fs.readdirSync(dir)
|
const files = fs.readdirSync(dir)
|
||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
const filePath = path.join(dir, file)
|
const filePath = path.join(dir, file)
|
||||||
|
|||||||
Reference in New Issue
Block a user