mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-28 20:33:43 +08:00
Compare commits
1 Commits
tauri-v1.2
...
tauri-v1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3eaf6c43d7 |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,18 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
## [v1.2.4](https://github.com/soybeanjs/soybean-admin/compare/v1.2.3...v1.2.4) (2024-06-14)
|
|
||||||
|
|
||||||
### 🛠 Optimizations
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- optimize `setupAppVersionNotification` - by @soybeanjs [<samp>(b5a72)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b5a723c)
|
|
||||||
- get buildTime with timezone 'Asia/Shanghai' - by @soybeanjs [<samp>(069fa)</samp>](https://github.com/soybeanjs/soybean-admin/commit/069fa8a)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/soybeanjs)
|
|
||||||
|
|
||||||
## [v1.2.3](https://github.com/soybeanjs/soybean-admin/compare/v1.2.2...v1.2.3) (2024-06-13)
|
## [v1.2.3](https://github.com/soybeanjs/soybean-admin/compare/v1.2.2...v1.2.3) (2024-06-13)
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
### 🐞 Bug Fixes
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
export * from './proxy';
|
export * from './proxy';
|
||||||
export * from './time';
|
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import dayjs from 'dayjs';
|
|
||||||
import utc from 'dayjs/plugin/utc';
|
|
||||||
import timezone from 'dayjs/plugin/timezone';
|
|
||||||
|
|
||||||
export function getBuildTime() {
|
|
||||||
dayjs.extend(utc);
|
|
||||||
dayjs.extend(timezone);
|
|
||||||
|
|
||||||
const buildTime = dayjs.tz(Date.now(), 'Asia/Shanghai').format('YYYY-MM-DD HH:mm:ss');
|
|
||||||
|
|
||||||
return buildTime;
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Soybean",
|
"name": "Soybean",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/axios",
|
"name": "@sa/axios",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/color",
|
"name": "@sa/color",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/hooks",
|
"name": "@sa/hooks",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/materials",
|
"name": "@sa/materials",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/fetch",
|
"name": "@sa/fetch",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/scripts",
|
"name": "@sa/scripts",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sa": "./bin.ts"
|
"sa": "./bin.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/uno-preset",
|
"name": "@sa/uno-preset",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/utils",
|
"name": "@sa/utils",
|
||||||
"version": "1.2.4",
|
"version": "1.2.3",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,18 +3,10 @@ import { NButton } from 'naive-ui';
|
|||||||
import { $t } from '../locales';
|
import { $t } from '../locales';
|
||||||
|
|
||||||
export function setupAppVersionNotification() {
|
export function setupAppVersionNotification() {
|
||||||
let isShow = false;
|
|
||||||
|
|
||||||
document.addEventListener('visibilitychange', async () => {
|
document.addEventListener('visibilitychange', async () => {
|
||||||
const preConditions = [!isShow, document.visibilityState === 'visible', !import.meta.env.DEV];
|
|
||||||
|
|
||||||
if (!preConditions.every(Boolean)) return;
|
|
||||||
|
|
||||||
const buildTime = await getHtmlBuildTime();
|
const buildTime = await getHtmlBuildTime();
|
||||||
|
|
||||||
if (buildTime !== BUILD_TIME) {
|
if (!import.meta.env.DEV && buildTime !== BUILD_TIME && document.visibilityState === 'visible') {
|
||||||
isShow = true;
|
|
||||||
|
|
||||||
const n = window.$notification?.create({
|
const n = window.$notification?.create({
|
||||||
title: $t('system.updateTitle'),
|
title: $t('system.updateTitle'),
|
||||||
content: $t('system.updateContent'),
|
content: $t('system.updateContent'),
|
||||||
@@ -40,9 +32,6 @@ export function setupAppVersionNotification() {
|
|||||||
() => $t('system.updateConfirm')
|
() => $t('system.updateConfirm')
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
},
|
|
||||||
onClose() {
|
|
||||||
isShow = false;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import process from 'node:process';
|
import process from 'node:process';
|
||||||
import { URL, fileURLToPath } from 'node:url';
|
import { URL, fileURLToPath } from 'node:url';
|
||||||
import { defineConfig, loadEnv } from 'vite';
|
import { defineConfig, loadEnv } from 'vite';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
import { setupVitePlugins } from './build/plugins';
|
import { setupVitePlugins } from './build/plugins';
|
||||||
import { createViteProxy, getBuildTime } from './build/config';
|
import { createViteProxy } from './build/config';
|
||||||
|
|
||||||
export default defineConfig(configEnv => {
|
export default defineConfig(configEnv => {
|
||||||
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta;
|
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta;
|
||||||
|
|
||||||
const buildTime = getBuildTime();
|
const buildTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: viteEnv.VITE_BASE_URL,
|
base: viteEnv.VITE_BASE_URL,
|
||||||
|
|||||||
Reference in New Issue
Block a user