Compare commits
1 Commits
24bb6d95cb
...
tauri-v1.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4aa117f05d |
3
.vscode/extensions.json
vendored
@@ -6,6 +6,9 @@
|
|||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"editorconfig.editorconfig",
|
"editorconfig.editorconfig",
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
|
"formulahendry.auto-close-tag",
|
||||||
|
"formulahendry.auto-complete-tag",
|
||||||
|
"formulahendry.auto-rename-tag",
|
||||||
"lokalise.i18n-ally",
|
"lokalise.i18n-ally",
|
||||||
"mhutchie.git-graph",
|
"mhutchie.git-graph",
|
||||||
"mikestead.dotenv",
|
"mikestead.dotenv",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { defineConfig } from '@soybeanjs/eslint-config';
|
import { defineConfig } from '@soybeanjs/eslint-config';
|
||||||
|
|
||||||
export default defineConfig(
|
export default defineConfig(
|
||||||
{ vue: true, unocss: true },
|
{ vue: true, unocss: true, ignores: ['src-tauri/target'] },
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
'vue/multi-word-component-names': [
|
'vue/multi-word-component-names': [
|
||||||
|
|||||||
40
package.json
@@ -32,17 +32,20 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "vite build --mode prod",
|
"build": "vite build --mode prod",
|
||||||
|
"build:tauri": "pnpm tauri build",
|
||||||
"build:test": "vite build --mode test",
|
"build:test": "vite build --mode test",
|
||||||
"cleanup": "sa cleanup",
|
"cleanup": "sa cleanup",
|
||||||
"commit": "sa git-commit",
|
"commit": "sa git-commit",
|
||||||
"commit:zh": "sa git-commit -l=zh-cn",
|
"commit:zh": "sa git-commit -l=zh-cn",
|
||||||
"dev": "vite --mode test",
|
"dev": "vite --mode test",
|
||||||
"dev:prod": "vite --mode prod",
|
"dev:prod": "vite --mode prod",
|
||||||
|
"dev:tauri": "pnpm tauri dev",
|
||||||
"gen-route": "sa gen-route",
|
"gen-route": "sa gen-route",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"prepare": "simple-git-hooks",
|
"prepare": "simple-git-hooks",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"release": "sa release",
|
"release": "sa release",
|
||||||
|
"tauri-icon": "pnpm tauri icon ./public/logo.png",
|
||||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||||
"update-pkg": "sa update-pkg"
|
"update-pkg": "sa update-pkg"
|
||||||
},
|
},
|
||||||
@@ -59,44 +62,45 @@
|
|||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"echarts": "5.5.1",
|
"echarts": "5.5.1",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
"naive-ui": "2.40.1",
|
"naive-ui": "2.39.0",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"pinia": "2.2.4",
|
"pinia": "2.2.2",
|
||||||
"tailwind-merge": "2.5.3",
|
"tailwind-merge": "2.5.2",
|
||||||
"vue": "3.5.11",
|
"vue": "3.5.7",
|
||||||
"vue-draggable-plus": "0.5.3",
|
"vue-draggable-plus": "0.5.3",
|
||||||
"vue-i18n": "10.0.4",
|
"vue-i18n": "10.0.1",
|
||||||
"vue-router": "4.4.5"
|
"vue-router": "4.4.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@elegant-router/vue": "0.3.8",
|
"@elegant-router/vue": "0.3.8",
|
||||||
"@iconify/json": "2.2.258",
|
"@iconify/json": "2.2.251",
|
||||||
"@sa/scripts": "workspace:*",
|
"@sa/scripts": "workspace:*",
|
||||||
"@sa/uno-preset": "workspace:*",
|
"@sa/uno-preset": "workspace:*",
|
||||||
"@soybeanjs/eslint-config": "1.4.1",
|
"@soybeanjs/eslint-config": "1.4.1",
|
||||||
"@types/node": "22.7.5",
|
"@tauri-apps/cli": "1.6.2",
|
||||||
|
"@types/node": "22.5.5",
|
||||||
"@types/nprogress": "0.2.3",
|
"@types/nprogress": "0.2.3",
|
||||||
"@unocss/eslint-config": "0.63.4",
|
"@unocss/eslint-config": "0.62.4",
|
||||||
"@unocss/preset-icons": "0.63.4",
|
"@unocss/preset-icons": "0.62.4",
|
||||||
"@unocss/preset-uno": "0.63.4",
|
"@unocss/preset-uno": "0.62.4",
|
||||||
"@unocss/transformer-directives": "0.63.4",
|
"@unocss/transformer-directives": "0.62.4",
|
||||||
"@unocss/transformer-variant-group": "0.63.4",
|
"@unocss/transformer-variant-group": "0.62.4",
|
||||||
"@unocss/vite": "0.63.4",
|
"@unocss/vite": "0.62.4",
|
||||||
"@vitejs/plugin-vue": "5.1.4",
|
"@vitejs/plugin-vue": "5.1.4",
|
||||||
"@vitejs/plugin-vue-jsx": "4.0.1",
|
"@vitejs/plugin-vue-jsx": "4.0.1",
|
||||||
"eslint": "9.12.0",
|
"eslint": "9.11.0",
|
||||||
"eslint-plugin-vue": "9.28.0",
|
"eslint-plugin-vue": "9.28.0",
|
||||||
"lint-staged": "15.2.10",
|
"lint-staged": "15.2.10",
|
||||||
"sass": "1.79.4",
|
"sass": "1.79.3",
|
||||||
"simple-git-hooks": "2.11.1",
|
"simple-git-hooks": "2.11.1",
|
||||||
"tsx": "4.19.1",
|
"tsx": "4.19.1",
|
||||||
"typescript": "5.6.3",
|
"typescript": "5.6.2",
|
||||||
"unplugin-icons": "0.19.3",
|
"unplugin-icons": "0.19.3",
|
||||||
"unplugin-vue-components": "0.27.4",
|
"unplugin-vue-components": "0.27.4",
|
||||||
"vite": "5.4.8",
|
"vite": "5.4.6",
|
||||||
"vite-plugin-progress": "0.0.7",
|
"vite-plugin-progress": "0.0.7",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-plugin-vue-devtools": "7.4.6",
|
"vite-plugin-vue-devtools": "7.4.5",
|
||||||
"vue-eslint-parser": "9.4.3",
|
"vue-eslint-parser": "9.4.3",
|
||||||
"vue-tsc": "2.1.6"
|
"vue-tsc": "2.1.6"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@sa/alova",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"exports": {
|
|
||||||
".": "./src/index.ts",
|
|
||||||
"./client": "./src/client.ts"
|
|
||||||
},
|
|
||||||
"typesVersions": {
|
|
||||||
"*": {
|
|
||||||
"*": ["./src/*"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@sa/utils": "workspace:*",
|
|
||||||
"alova": "3.0.20"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from 'alova/client';
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/** the backend error code key */
|
|
||||||
export const BACKEND_ERROR_CODE = 'BACKEND_ERROR';
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
import { createAlova } from 'alova';
|
|
||||||
import type { AlovaDefaultCacheAdapter, AlovaGenerics, AlovaGlobalCacheAdapter, AlovaRequestAdapter } from 'alova';
|
|
||||||
import VueHook from 'alova/vue';
|
|
||||||
import type { VueHookType } from 'alova/vue';
|
|
||||||
import adapterFetch from 'alova/fetch';
|
|
||||||
import { createServerTokenAuthentication } from 'alova/client';
|
|
||||||
import type { FetchRequestInit } from 'alova/fetch';
|
|
||||||
import { BACKEND_ERROR_CODE } from './constant';
|
|
||||||
import type { CustomAlovaConfig, RequestOptions } from './type';
|
|
||||||
|
|
||||||
export const createAlovaRequest = <
|
|
||||||
RequestConfig = FetchRequestInit,
|
|
||||||
ResponseType = Response,
|
|
||||||
ResponseHeader = Headers,
|
|
||||||
L1Cache extends AlovaGlobalCacheAdapter = AlovaDefaultCacheAdapter,
|
|
||||||
L2Cache extends AlovaGlobalCacheAdapter = AlovaDefaultCacheAdapter
|
|
||||||
>(
|
|
||||||
customConfig: CustomAlovaConfig<
|
|
||||||
AlovaGenerics<any, any, RequestConfig, ResponseType, ResponseHeader, L1Cache, L2Cache, any>
|
|
||||||
>,
|
|
||||||
options: RequestOptions<AlovaGenerics<any, any, RequestConfig, ResponseType, ResponseHeader, L1Cache, L2Cache, any>>
|
|
||||||
) => {
|
|
||||||
const { tokenRefresher } = options;
|
|
||||||
const { onAuthRequired, onResponseRefreshToken } = createServerTokenAuthentication<
|
|
||||||
VueHookType,
|
|
||||||
AlovaRequestAdapter<RequestConfig, ResponseType, ResponseHeader>
|
|
||||||
>({
|
|
||||||
refreshTokenOnSuccess: {
|
|
||||||
isExpired: (response, method) => tokenRefresher?.isExpired(response, method) || false,
|
|
||||||
handler: async (response, method) => tokenRefresher?.handler(response, method)
|
|
||||||
},
|
|
||||||
refreshTokenOnError: {
|
|
||||||
isExpired: (response, method) => tokenRefresher?.isExpired(response, method) || false,
|
|
||||||
handler: async (response, method) => tokenRefresher?.handler(response, method)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const instance = createAlova({
|
|
||||||
...customConfig,
|
|
||||||
timeout: customConfig.timeout ?? 10 * 1000,
|
|
||||||
requestAdapter: (customConfig.requestAdapter as any) ?? adapterFetch(),
|
|
||||||
statesHook: VueHook,
|
|
||||||
beforeRequest: onAuthRequired(options.onRequest as any),
|
|
||||||
responded: onResponseRefreshToken({
|
|
||||||
onSuccess: async (response, method) => {
|
|
||||||
// check if http status is success
|
|
||||||
let error: any = null;
|
|
||||||
let transformedData: any = null;
|
|
||||||
try {
|
|
||||||
if (await options.isBackendSuccess(response)) {
|
|
||||||
transformedData = await options.transformBackendResponse(response);
|
|
||||||
} else {
|
|
||||||
error = new Error('the backend request error');
|
|
||||||
error.code = BACKEND_ERROR_CODE;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
error = err;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
await options.onError?.(error, response, method);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return transformedData;
|
|
||||||
},
|
|
||||||
onComplete: options.onComplete,
|
|
||||||
onError: (error, method) => options.onError?.(error, null, method)
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export { BACKEND_ERROR_CODE };
|
|
||||||
export type * from './type';
|
|
||||||
export type * from 'alova';
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
import type { AlovaGenerics, AlovaOptions, AlovaRequestAdapter, Method, ResponseCompleteHandler } from 'alova';
|
|
||||||
|
|
||||||
export type CustomAlovaConfig<AG extends AlovaGenerics> = Omit<
|
|
||||||
AlovaOptions<AG>,
|
|
||||||
'statesHook' | 'beforeRequest' | 'responded' | 'requestAdapter'
|
|
||||||
> & {
|
|
||||||
/** request adapter. all request of alova will be sent by it. */
|
|
||||||
requestAdapter?: AlovaRequestAdapter<AG['RequestConfig'], AG['Response'], AG['ResponseHeader']>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface RequestOptions<AG extends AlovaGenerics> {
|
|
||||||
/**
|
|
||||||
* The hook before request
|
|
||||||
*
|
|
||||||
* For example: You can add header token in this hook
|
|
||||||
*
|
|
||||||
* @param method alova Method Instance
|
|
||||||
*/
|
|
||||||
onRequest?: AlovaOptions<AG>['beforeRequest'];
|
|
||||||
/**
|
|
||||||
* The hook to check backend response is success or not
|
|
||||||
*
|
|
||||||
* @param response alova response
|
|
||||||
*/
|
|
||||||
isBackendSuccess: (response: AG['Response']) => Promise<boolean>;
|
|
||||||
|
|
||||||
/** The config to refresh token */
|
|
||||||
tokenRefresher?: {
|
|
||||||
/** detect the token is expired */
|
|
||||||
isExpired(response: AG['Response'], Method: Method<AG>): Promise<boolean> | boolean;
|
|
||||||
/** refresh token handler */
|
|
||||||
handler(response: AG['Response'], Method: Method<AG>): Promise<void>;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** The hook after backend request complete */
|
|
||||||
onComplete?: ResponseCompleteHandler<AG>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The hook to handle error
|
|
||||||
*
|
|
||||||
* For example: You can show error message in this hook
|
|
||||||
*
|
|
||||||
* @param error
|
|
||||||
*/
|
|
||||||
onError?: (error: any, response: AG['Response'] | null, methodInstance: Method<AG>) => any | Promise<any>;
|
|
||||||
/**
|
|
||||||
* transform backend response when the responseType is json
|
|
||||||
*
|
|
||||||
* @param response alova response
|
|
||||||
*/
|
|
||||||
transformBackendResponse: (response: AG['Response']) => any;
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "ESNext",
|
|
||||||
"jsx": "preserve",
|
|
||||||
"lib": ["DOM", "ESNext"],
|
|
||||||
"baseUrl": ".",
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"types": ["node"],
|
|
||||||
"strict": true,
|
|
||||||
"strictNullChecks": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true
|
|
||||||
},
|
|
||||||
"include": ["src/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist"]
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ofetch": "1.4.1"
|
"ofetch": "1.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@soybeanjs/changelog": "0.3.24",
|
"@soybeanjs/changelog": "0.3.24",
|
||||||
"bumpp": "9.7.1",
|
"bumpp": "9.5.2",
|
||||||
"c12": "2.0.1",
|
"c12": "1.11.2",
|
||||||
"cac": "6.7.14",
|
"cac": "6.7.14",
|
||||||
"consola": "3.2.3",
|
"consola": "3.2.3",
|
||||||
"enquirer": "2.4.1",
|
"enquirer": "2.4.1",
|
||||||
"execa": "9.4.0",
|
"execa": "9.4.0",
|
||||||
"kolorist": "1.8.0",
|
"kolorist": "1.8.0",
|
||||||
"npm-check-updates": "17.1.3",
|
"npm-check-updates": "17.1.2",
|
||||||
"rimraf": "6.0.1"
|
"rimraf": "6.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1972
pnpm-lock.yaml
generated
BIN
public/logo.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
3
src-tauri/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
/target/
|
||||||
3664
src-tauri/Cargo.lock
generated
Normal file
26
src-tauri/Cargo.toml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
[package]
|
||||||
|
name = "app"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "A Tauri App"
|
||||||
|
authors = ["you"]
|
||||||
|
license = ""
|
||||||
|
repository = ""
|
||||||
|
default-run = "app"
|
||||||
|
edition = "2021"
|
||||||
|
rust-version = "1.60"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "1.5.1", features = [] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
serde_json = "1.0"
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
tauri = { version = "1.6.1", features = [] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
|
||||||
|
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
|
||||||
|
# DO NOT REMOVE!!
|
||||||
|
custom-protocol = [ "tauri/custom-protocol" ]
|
||||||
3
src-tauri/build.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
tauri_build::build()
|
||||||
|
}
|
||||||
BIN
src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
8
src-tauri/src/main.rs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
tauri::Builder::default()
|
||||||
|
.run(tauri::generate_context!())
|
||||||
|
.expect("error while running tauri application");
|
||||||
|
}
|
||||||
60
src-tauri/tauri.conf.json
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||||
|
"build": {
|
||||||
|
"beforeBuildCommand": "npm run build",
|
||||||
|
"beforeDevCommand": "npm run dev",
|
||||||
|
"devPath": "http://localhost:9527",
|
||||||
|
"distDir": "../dist"
|
||||||
|
},
|
||||||
|
"package": {
|
||||||
|
"productName": "soybean-admin",
|
||||||
|
"version": "1.0.0"
|
||||||
|
},
|
||||||
|
"tauri": {
|
||||||
|
"allowlist": {
|
||||||
|
"all": false
|
||||||
|
},
|
||||||
|
"bundle": {
|
||||||
|
"active": true,
|
||||||
|
"category": "DeveloperTool",
|
||||||
|
"copyright": "",
|
||||||
|
"deb": {
|
||||||
|
"depends": []
|
||||||
|
},
|
||||||
|
"externalBin": [],
|
||||||
|
"icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
|
||||||
|
"identifier": "cn.soybeanjs.admin",
|
||||||
|
"longDescription": "",
|
||||||
|
"macOS": {
|
||||||
|
"entitlements": null,
|
||||||
|
"exceptionDomain": "",
|
||||||
|
"frameworks": [],
|
||||||
|
"providerShortName": null,
|
||||||
|
"signingIdentity": null
|
||||||
|
},
|
||||||
|
"resources": [],
|
||||||
|
"shortDescription": "",
|
||||||
|
"targets": "all",
|
||||||
|
"windows": {
|
||||||
|
"certificateThumbprint": null,
|
||||||
|
"digestAlgorithm": "sha256",
|
||||||
|
"timestampUrl": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"csp": null
|
||||||
|
},
|
||||||
|
"updater": {
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
|
"windows": [
|
||||||
|
{
|
||||||
|
"fullscreen": false,
|
||||||
|
"height": 768,
|
||||||
|
"resizable": true,
|
||||||
|
"title": "SoybeanAdmin",
|
||||||
|
"width": 1366
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -113,7 +113,7 @@ const local: App.I18n.Schema = {
|
|||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
visible: 'Tab Visible',
|
visible: 'Tab Visible',
|
||||||
cache: 'Tag Bar Info Cache',
|
cache: 'Tab Cache',
|
||||||
height: 'Tab Height',
|
height: 'Tab Height',
|
||||||
mode: {
|
mode: {
|
||||||
title: 'Tab Mode',
|
title: 'Tab Mode',
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ const local: App.I18n.Schema = {
|
|||||||
},
|
},
|
||||||
tab: {
|
tab: {
|
||||||
visible: '显示标签栏',
|
visible: '显示标签栏',
|
||||||
cache: '标签栏信息缓存',
|
cache: '缓存标签页',
|
||||||
height: '标签栏高度',
|
height: '标签栏高度',
|
||||||
mode: {
|
mode: {
|
||||||
title: '标签栏风格',
|
title: '标签栏风格',
|
||||||
|
|||||||
8
src/typings/global.d.ts
vendored
@@ -14,6 +14,14 @@ declare global {
|
|||||||
$notification?: import('naive-ui').NotificationProviderInst;
|
$notification?: import('naive-ui').NotificationProviderInst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ViewTransition {
|
||||||
|
ready: Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Document {
|
||||||
|
startViewTransition?: (callback: () => Promise<void> | void) => ViewTransition;
|
||||||
|
}
|
||||||
|
|
||||||
/** Build time of the project */
|
/** Build time of the project */
|
||||||
export const BUILD_TIME: string;
|
export const BUILD_TIME: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
export function isPC() {
|
export function isPC() {
|
||||||
const agents = ['Android', 'iPhone', 'webOS', 'BlackBerry', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
|
const agents = ['Android', 'iPhone', 'webOS', 'BlackBerry', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
|
||||||
|
|
||||||
const isMobile = agents.some(agent => window.navigator.userAgent.includes(agent));
|
return !agents.includes(window.navigator.userAgent);
|
||||||
|
|
||||||
return !isMobile;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ async function handleSubmit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false">
|
||||||
<NFormItem path="phone">
|
<NFormItem path="phone">
|
||||||
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ async function handleAccountLogin(account: Account) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false">
|
||||||
<NFormItem path="userName">
|
<NFormItem path="userName">
|
||||||
<NInput v-model:value="model.userName" :placeholder="$t('page.login.common.userNamePlaceholder')" />
|
<NInput v-model:value="model.userName" :placeholder="$t('page.login.common.userNamePlaceholder')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ async function handleSubmit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false">
|
||||||
<NFormItem path="phone">
|
<NFormItem path="phone">
|
||||||
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ async function handleSubmit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false">
|
||||||
<NFormItem path="phone">
|
<NFormItem path="phone">
|
||||||
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
|||||||