commit d0561b75b7aef483c889411154ce58737f8fae63
Author: lichong <18518571399@163.com>
Date: Fri Sep 13 00:39:09 2024 +0800
454
diff --git a/front/.editorconfig b/front/.editorconfig
new file mode 100644
index 0000000..3dce414
--- /dev/null
+++ b/front/.editorconfig
@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
\ No newline at end of file
diff --git a/front/.gitignore b/front/.gitignore
new file mode 100644
index 0000000..d920a1f
--- /dev/null
+++ b/front/.gitignore
@@ -0,0 +1,5 @@
+node_modules
+dist
+out
+*.log*
+package-lock.json
diff --git a/front/.npmrc b/front/.npmrc
new file mode 100644
index 0000000..fdc1a98
--- /dev/null
+++ b/front/.npmrc
@@ -0,0 +1 @@
+ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
diff --git a/front/.prettierignore b/front/.prettierignore
new file mode 100644
index 0000000..9c6b791
--- /dev/null
+++ b/front/.prettierignore
@@ -0,0 +1,6 @@
+out
+dist
+pnpm-lock.yaml
+LICENSE.md
+tsconfig.json
+tsconfig.*.json
diff --git a/front/.prettierrc b/front/.prettierrc
new file mode 100644
index 0000000..f3050e8
--- /dev/null
+++ b/front/.prettierrc
@@ -0,0 +1,6 @@
+{
+ "singleQuote": true,
+ "semi": false,
+ "printWidth": 100,
+ "trailingComma": "none"
+}
diff --git a/front/README.md b/front/README.md
new file mode 100644
index 0000000..169e509
--- /dev/null
+++ b/front/README.md
@@ -0,0 +1,34 @@
+# my-app
+
+An Electron application with Vue
+
+## Recommended IDE Setup
+
+- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
+
+## Project Setup
+
+### Install(node 16.20.1)
+
+```bash
+$ npm install
+```
+
+### Development
+
+```bash
+$ npm run dev
+```
+
+### Build
+
+```bash
+# For windows
+$ npm run build:win
+
+# For macOS
+$ npm run build:mac
+
+# For Linux
+$ npm run build:linux
+```
diff --git a/front/build/entitlements.mac.plist b/front/build/entitlements.mac.plist
new file mode 100644
index 0000000..38c887b
--- /dev/null
+++ b/front/build/entitlements.mac.plist
@@ -0,0 +1,12 @@
+
+
+
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
+ com.apple.security.cs.allow-dyld-environment-variables
+
+
+
diff --git a/front/build/icon.icns b/front/build/icon.icns
new file mode 100644
index 0000000..63d4bb7
Binary files /dev/null and b/front/build/icon.icns differ
diff --git a/front/build/icon.ico b/front/build/icon.ico
new file mode 100644
index 0000000..6441ff6
Binary files /dev/null and b/front/build/icon.ico differ
diff --git a/front/build/notarize.js b/front/build/notarize.js
new file mode 100644
index 0000000..116e5e0
--- /dev/null
+++ b/front/build/notarize.js
@@ -0,0 +1,36 @@
+const { notarize } = require('electron-notarize')
+
+module.exports = async (context) => {
+ if (process.platform !== 'darwin') return
+
+ console.log('aftersign hook triggered, start to notarize app.')
+
+ if (!process.env.CI) {
+ console.log(`skipping notarizing, not in CI.`)
+ return
+ }
+
+ if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) {
+ console.warn('skipping notarizing, APPLE_ID and APPLE_ID_PASS env variables must be set.')
+ return
+ }
+
+ const appId = 'com.electron.app'
+
+ const { appOutDir } = context
+
+ const appName = context.packager.appInfo.productFilename
+
+ try {
+ await notarize({
+ appBundleId: appId,
+ appPath: `${appOutDir}/${appName}.app`,
+ appleId: process.env.APPLE_ID,
+ appleIdPassword: process.env.APPLEIDPASS
+ })
+ } catch (error) {
+ console.error(error)
+ }
+
+ console.log(`done notarizing ${appId}.`)
+}
diff --git a/front/electron-builder.yml b/front/electron-builder.yml
new file mode 100644
index 0000000..49ac237
--- /dev/null
+++ b/front/electron-builder.yml
@@ -0,0 +1,43 @@
+appId: com.electron.lichong
+productName: 桌面应用
+directories:
+ buildResources: build
+files:
+ - '!**/.vscode/*'
+ - '!src/*'
+ - '!electron.vite.config.{js,ts,mjs,cjs}'
+ - '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
+asarUnpack:
+ - '**/*.{node,dll}'
+afterSign: build/notarize.js
+win:
+ executableName: lichong-app
+nsis:
+ oneClick: false
+ artifactName: ${name}-${version}-setup.${ext}
+ allowToChangeInstallationDirectory: true
+ shortcutName: ${productName}
+ uninstallDisplayName: ${productName}
+ createDesktopShortcut: always
+mac:
+ entitlementsInherit: build/entitlements.mac.plist
+ extendInfo:
+ - NSCameraUsageDescription: Application requests access to the device's camera.
+ - NSMicrophoneUsageDescription: Application requests access to the device's microphone.
+ - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
+ - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
+dmg:
+ artifactName: ${name}-${version}.${ext}
+linux:
+ target:
+ - AppImage
+ - snap
+ - deb
+ maintainer: electronjs.org
+ category: Utility
+appImage:
+ artifactName: ${name}-${version}.${ext}
+npmRebuild: false
+publish:
+ provider: generic
+ url: https://example.com/auto-updates
diff --git a/front/electron.vite.config.js b/front/electron.vite.config.js
new file mode 100644
index 0000000..152a70d
--- /dev/null
+++ b/front/electron.vite.config.js
@@ -0,0 +1,28 @@
+import { resolve } from 'path'
+import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
+import vue from '@vitejs/plugin-vue'
+
+export default defineConfig({
+ main: {
+ plugins: [externalizeDepsPlugin()]
+ },
+ preload: {
+ plugins: [externalizeDepsPlugin()],
+ build: {
+ rollupOptions: {
+ input: {
+ dl: resolve(__dirname, 'src/preload/dl.js'),
+ index: resolve(__dirname, 'src/preload/index.js')
+ }
+ }
+ }
+ },
+ renderer: {
+ resolve: {
+ alias: {
+ '@renderer': resolve('src/renderer/src')
+ }
+ },
+ plugins: [vue()]
+ }
+})
diff --git a/front/jsconfig.json b/front/jsconfig.json
new file mode 100644
index 0000000..b50f09d
--- /dev/null
+++ b/front/jsconfig.json
@@ -0,0 +1,6 @@
+{
+ "exclude": [
+ "node_modules",
+ "public"
+ ]
+}
\ No newline at end of file
diff --git a/front/package.json b/front/package.json
new file mode 100644
index 0000000..2ec0c32
--- /dev/null
+++ b/front/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "electron",
+ "version": "1.0.0",
+ "description": "An Electron application with Vue",
+ "main": "./out/main/index.js",
+ "author": "lichong",
+ "homepage": "https://www.electronjs.org",
+ "scripts": {
+ "npmi": "npm i",
+ "dev": "electron-vite dev",
+ "build": "electron-vite build",
+ "build:win": "npm run build && electron-builder --win --config",
+ "build:mac": "npm run build && electron-builder --mac --config",
+ "build:linux": "npm run build && electron-builder --linux --config"
+ },
+ "dependencies": {
+ "@electron-toolkit/preload": "^1.0.2",
+ "@electron-toolkit/utils": "^1.0.2",
+ "dayjs": "^1.11.11",
+ "dexie": "^4.0.8",
+ "element-plus": "^2.7.1",
+ "js-sha256": "^0.11.0",
+ "lodash": "^4.17.21",
+ "node-machine-id": "^1.1.12",
+ "xlsx": "^0.18.5"
+ },
+ "devDependencies": {
+ "@rushstack/eslint-patch": "^1.2.0",
+ "@vitejs/plugin-vue": "^3.1.2",
+ "@vue/eslint-config-prettier": "^7.0.0",
+ "electron": "^20.3.2",
+ "electron-builder": "^23.6.0",
+ "electron-notarize": "^1.2.1",
+ "electron-vite": "^1.0.11",
+ "less": "^4.1.3",
+ "prettier": "^2.7.1",
+ "vite": "^3.1.8",
+ "vue": "^3.2.41"
+ }
+}
diff --git a/front/public/icon/icon.jpg b/front/public/icon/icon.jpg
new file mode 100644
index 0000000..4ed6253
Binary files /dev/null and b/front/public/icon/icon.jpg differ
diff --git a/front/src/main/index.js b/front/src/main/index.js
new file mode 100644
index 0000000..1ce7680
--- /dev/null
+++ b/front/src/main/index.js
@@ -0,0 +1,73 @@
+import { app, shell, BrowserWindow, nativeImage, ipcMain } from 'electron'
+import * as path from 'path'
+import { electronApp, optimizer, is } from '@electron-toolkit/utils'
+import { machineIdSync } from 'node-machine-id';
+
+// logo
+const logoIcon = nativeImage.createFromPath(path.join(__dirname, '../../public/icon/icon.jpg'))
+console.log(process.versions.node)
+// 主窗口
+let mainWindow
+function createWindow() {
+ mainWindow = new BrowserWindow({
+ minWidth: 1366,
+ minHeight: 763,
+ show: false,
+ autoHideMenuBar: true,
+ icon: logoIcon,
+ webPreferences: {
+ preload: path.resolve(__dirname, '../preload/index.js'),
+ sandbox: false
+ }
+ })
+ mainWindow.on('ready-to-show', () => {
+ mainWindow.show()
+ // mainWindow.webContents.openDevTools()
+ })
+ mainWindow.webContents.setWindowOpenHandler((details) => {
+ shell.openExternal(details.url)
+ return { action: 'deny' }
+ })
+ // mainWindow.loadURL('http://localhost:5173/')
+
+ mainWindow.on('close', () => {
+ app.exit()
+ })
+ if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
+ mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
+ } else {
+ mainWindow.loadFile(path.join(__dirname, '../renderer/index.html'))
+ }
+}
+app.whenReady().then(() => {
+ electronApp.setAppUserModelId('com.electron')
+ // Default open or close DevTools by F12 in development
+ // and ignore CommandOrControl + R in production.
+ // see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
+ app.on('browser-window-created', (_, window) => {
+ optimizer.watchWindowShortcuts(window)
+ })
+
+ createWindow()
+
+ app.on('activate', function () {
+ // On macOS it's common to re-create a window in the app when the
+ // dock icon is clicked and there are no other windows open.
+ if (BrowserWindow.getAllWindows().length === 0) createWindow()
+ })
+ ipcMain.on('deviceIdentify', () => {
+ let res = machineIdSync()
+ mainWindow.webContents.send(`deviceResult`, res)
+ })
+})
+app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');
+// Quit when all windows are closed, except on macOS. There, it's common
+// for applications and their menu bar to stay active until the user quits
+// explicitly with Cmd + Q.
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})
+// In this file you can include the rest of your app"s specific main process
+// code. You can also put them in separate files and require them here.
diff --git a/front/src/preload/dl.js b/front/src/preload/dl.js
new file mode 100644
index 0000000..2604961
--- /dev/null
+++ b/front/src/preload/dl.js
@@ -0,0 +1,21 @@
+import { contextBridge, clipboard } from 'electron'
+import { electronAPI } from '@electron-toolkit/preload'
+
+// Custom APIs for renderer
+const api = {}
+
+// Use `contextBridge` APIs to expose Electron APIs to
+// renderer only if context isolation is enabled, otherwise
+// just add to the DOM global.
+if (process.contextIsolated) {
+ try {
+ contextBridge.exposeInMainWorld('electron', electronAPI)
+ contextBridge.exposeInMainWorld('api', api)
+ contextBridge.exposeInMainWorld('elecClipboard', clipboard)
+ } catch (error) {
+ console.error(error)
+ }
+} else {
+ window.electron = electronAPI
+ window.api = api
+}
diff --git a/front/src/preload/index.js b/front/src/preload/index.js
new file mode 100644
index 0000000..2604961
--- /dev/null
+++ b/front/src/preload/index.js
@@ -0,0 +1,21 @@
+import { contextBridge, clipboard } from 'electron'
+import { electronAPI } from '@electron-toolkit/preload'
+
+// Custom APIs for renderer
+const api = {}
+
+// Use `contextBridge` APIs to expose Electron APIs to
+// renderer only if context isolation is enabled, otherwise
+// just add to the DOM global.
+if (process.contextIsolated) {
+ try {
+ contextBridge.exposeInMainWorld('electron', electronAPI)
+ contextBridge.exposeInMainWorld('api', api)
+ contextBridge.exposeInMainWorld('elecClipboard', clipboard)
+ } catch (error) {
+ console.error(error)
+ }
+} else {
+ window.electron = electronAPI
+ window.api = api
+}
diff --git a/front/src/renderer/index.html b/front/src/renderer/index.html
new file mode 100644
index 0000000..c28b3bb
--- /dev/null
+++ b/front/src/renderer/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+ 数据统计
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/front/src/renderer/src/App.vue b/front/src/renderer/src/App.vue
new file mode 100644
index 0000000..7a679b3
--- /dev/null
+++ b/front/src/renderer/src/App.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 复制注册码
+
+
+ 生成注册码
+
+
+
+
+
+
+ 激活
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/front/src/renderer/src/assets/css/base.css b/front/src/renderer/src/assets/css/base.css
new file mode 100644
index 0000000..f31f35e
--- /dev/null
+++ b/front/src/renderer/src/assets/css/base.css
@@ -0,0 +1,5 @@
+html,
+body {
+ margin: 0;
+ padding: 0;
+}
\ No newline at end of file
diff --git a/front/src/renderer/src/assets/js/db.js b/front/src/renderer/src/assets/js/db.js
new file mode 100644
index 0000000..29fc665
--- /dev/null
+++ b/front/src/renderer/src/assets/js/db.js
@@ -0,0 +1,10 @@
+import Dexie from 'dexie';
+
+export const myDatabase = new Dexie('myDatabase');
+
+// 定义数据库版本
+myDatabase.version(1).stores({
+ changci: '++id, changciid, xuhao, &time, first, second, third, note, create_at, update_at',
+ dailishang: '++id, dailishangid, xuhao, name, phone, dailifei, note, create_at, update_at',
+ jihuoshijian: '++id, jihuoma, isVip, zhucema, startTime, endTime,create_at, update_at'
+});
\ No newline at end of file
diff --git a/front/src/renderer/src/assets/json/changci.json b/front/src/renderer/src/assets/json/changci.json
new file mode 100644
index 0000000..ec5ee40
--- /dev/null
+++ b/front/src/renderer/src/assets/json/changci.json
@@ -0,0 +1,58 @@
+[
+ {
+ "label": "序号",
+ "prop": "xuhao",
+ "type": "text",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "时间",
+ "prop": "time",
+ "type": "date",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "第一个数",
+ "prop": "first",
+ "type": "number",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "第二个数",
+ "prop": "second",
+ "type": "number",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "第三个数",
+ "prop": "third",
+ "type": "number",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "备注",
+ "prop": "note",
+ "type": "text",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "创建时间",
+ "prop": "create_at",
+ "type": "date",
+ "tableShow": false,
+ "formShow": true
+ },
+ {
+ "label": "更新时间",
+ "prop": "update_at",
+ "type": "date",
+ "tableShow": false,
+ "formShow": true
+ }
+]
\ No newline at end of file
diff --git a/front/src/renderer/src/assets/json/dailishang.json b/front/src/renderer/src/assets/json/dailishang.json
new file mode 100644
index 0000000..bc37ded
--- /dev/null
+++ b/front/src/renderer/src/assets/json/dailishang.json
@@ -0,0 +1,53 @@
+[
+ {
+ "label": "序号",
+ "prop": "xuhao",
+ "type": "text",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "姓名",
+ "prop": "name",
+ "type": "text",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "联系方式",
+ "prop": "phone",
+ "type": "text",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "代理费(%)",
+ "prop": "dailifei",
+ "type": "number",
+ "min": 0,
+ "max": 100,
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "备注",
+ "prop": "note",
+ "type": "text",
+ "tableShow": true,
+ "formShow": true
+ },
+ {
+ "label": "创建时间",
+ "prop": "create_at",
+ "type": "date",
+ "tableShow": false,
+ "formShow": true
+ },
+ {
+ "label": "更新时间",
+ "prop": "update_at",
+ "type": "date",
+ "tableShow": false,
+ "formShow": true
+ }
+]
\ No newline at end of file
diff --git a/front/src/renderer/src/components/formcomponent.vue b/front/src/renderer/src/components/formcomponent.vue
new file mode 100644
index 0000000..52be25d
--- /dev/null
+++ b/front/src/renderer/src/components/formcomponent.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/front/src/renderer/src/components/tablecomponent.vue b/front/src/renderer/src/components/tablecomponent.vue
new file mode 100644
index 0000000..f59b6bb
--- /dev/null
+++ b/front/src/renderer/src/components/tablecomponent.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+
+
+
+ {{ scope.row[headerItem.prop] }}
+
+
+ {{ scope.row[headerItem.prop] }}
+
+
+ {{ scope.row[headerItem.prop] }}
+
+ {{ scope.row[headerItem.prop] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/front/src/renderer/src/main.js b/front/src/renderer/src/main.js
new file mode 100644
index 0000000..47e2ac1
--- /dev/null
+++ b/front/src/renderer/src/main.js
@@ -0,0 +1,25 @@
+// main.ts
+import { createApp } from 'vue'
+import ElementPlus from 'element-plus'
+import zhCn from 'element-plus/es/locale/lang/zh-cn'
+import 'element-plus/dist/index.css'
+import App from './App.vue'
+import './assets/css/base.css'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+
+const app = createApp(App)
+// window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = true
+for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+ app.component(key, component)
+}
+app.use(ElementPlus, {
+ locale: zhCn,
+})
+app.mount('#app')
+
+document.addEventListener('keydown', (event) => {
+ const { ctrlKey, shiftKey, key } = event
+ if ((ctrlKey && shiftKey && key === 'I') || key === 'F12') {
+ return event.preventDefault()
+ }
+})
diff --git a/front/src/renderer/src/views/changci.vue b/front/src/renderer/src/views/changci.vue
new file mode 100644
index 0000000..ba775dc
--- /dev/null
+++ b/front/src/renderer/src/views/changci.vue
@@ -0,0 +1,345 @@
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+ 清空
+
+
+
+
+
+ 导出
+
+
+
+
+
+ 刷新
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
+
+
+
diff --git a/front/src/renderer/src/views/dailishang.vue b/front/src/renderer/src/views/dailishang.vue
new file mode 100644
index 0000000..3e032be
--- /dev/null
+++ b/front/src/renderer/src/views/dailishang.vue
@@ -0,0 +1,330 @@
+
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+ 删除
+
+
+
+
+
+ 清空
+
+
+
+
+
+ 导出
+
+
+
+
+
+ 刷新
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
+
+
+
+
diff --git a/jihuoqi/.editorconfig b/jihuoqi/.editorconfig
new file mode 100644
index 0000000..3dce414
--- /dev/null
+++ b/jihuoqi/.editorconfig
@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
\ No newline at end of file
diff --git a/jihuoqi/.gitignore b/jihuoqi/.gitignore
new file mode 100644
index 0000000..d920a1f
--- /dev/null
+++ b/jihuoqi/.gitignore
@@ -0,0 +1,5 @@
+node_modules
+dist
+out
+*.log*
+package-lock.json
diff --git a/jihuoqi/.npmrc b/jihuoqi/.npmrc
new file mode 100644
index 0000000..fdc1a98
--- /dev/null
+++ b/jihuoqi/.npmrc
@@ -0,0 +1 @@
+ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
diff --git a/jihuoqi/.prettierignore b/jihuoqi/.prettierignore
new file mode 100644
index 0000000..9c6b791
--- /dev/null
+++ b/jihuoqi/.prettierignore
@@ -0,0 +1,6 @@
+out
+dist
+pnpm-lock.yaml
+LICENSE.md
+tsconfig.json
+tsconfig.*.json
diff --git a/jihuoqi/.prettierrc b/jihuoqi/.prettierrc
new file mode 100644
index 0000000..f3050e8
--- /dev/null
+++ b/jihuoqi/.prettierrc
@@ -0,0 +1,6 @@
+{
+ "singleQuote": true,
+ "semi": false,
+ "printWidth": 100,
+ "trailingComma": "none"
+}
diff --git a/jihuoqi/README.md b/jihuoqi/README.md
new file mode 100644
index 0000000..169e509
--- /dev/null
+++ b/jihuoqi/README.md
@@ -0,0 +1,34 @@
+# my-app
+
+An Electron application with Vue
+
+## Recommended IDE Setup
+
+- [VSCode](https://code.visualstudio.com/) + [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) + [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
+
+## Project Setup
+
+### Install(node 16.20.1)
+
+```bash
+$ npm install
+```
+
+### Development
+
+```bash
+$ npm run dev
+```
+
+### Build
+
+```bash
+# For windows
+$ npm run build:win
+
+# For macOS
+$ npm run build:mac
+
+# For Linux
+$ npm run build:linux
+```
diff --git a/jihuoqi/build/entitlements.mac.plist b/jihuoqi/build/entitlements.mac.plist
new file mode 100644
index 0000000..38c887b
--- /dev/null
+++ b/jihuoqi/build/entitlements.mac.plist
@@ -0,0 +1,12 @@
+
+
+
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
+ com.apple.security.cs.allow-dyld-environment-variables
+
+
+
diff --git a/jihuoqi/build/icon.icns b/jihuoqi/build/icon.icns
new file mode 100644
index 0000000..63d4bb7
Binary files /dev/null and b/jihuoqi/build/icon.icns differ
diff --git a/jihuoqi/build/icon.ico b/jihuoqi/build/icon.ico
new file mode 100644
index 0000000..6441ff6
Binary files /dev/null and b/jihuoqi/build/icon.ico differ
diff --git a/jihuoqi/build/notarize.js b/jihuoqi/build/notarize.js
new file mode 100644
index 0000000..aa281c5
--- /dev/null
+++ b/jihuoqi/build/notarize.js
@@ -0,0 +1,36 @@
+const { notarize } = require('electron-notarize')
+
+module.exports = async (context) => {
+ if (process.platform !== 'darwin') return
+
+ console.log('aftersign hook triggered, start to notarize app.')
+
+ if (!process.env.CI) {
+ console.log(`skipping notarizing, not in CI.`)
+ return
+ }
+
+ if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) {
+ console.warn('skipping notarizing, APPLE_ID and APPLE_ID_PASS env variables must be set.')
+ return
+ }
+
+ const appId = 'com.electron.jihuoqi'
+
+ const { appOutDir } = context
+
+ const appName = context.packager.appInfo.productFilename
+
+ try {
+ await notarize({
+ appBundleId: appId,
+ appPath: `${appOutDir}/${appName}.app`,
+ appleId: process.env.APPLE_ID,
+ appleIdPassword: process.env.APPLEIDPASS
+ })
+ } catch (error) {
+ console.error(error)
+ }
+
+ console.log(`done notarizing ${appId}.`)
+}
diff --git a/jihuoqi/electron-builder.yml b/jihuoqi/electron-builder.yml
new file mode 100644
index 0000000..c704e87
--- /dev/null
+++ b/jihuoqi/electron-builder.yml
@@ -0,0 +1,43 @@
+appId: com.electron.jihuoqi
+productName: 激活器
+directories:
+ buildResources: build
+files:
+ - '!**/.vscode/*'
+ - '!src/*'
+ - '!electron.vite.config.{js,ts,mjs,cjs}'
+ - '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
+asarUnpack:
+ - '**/*.{node,dll}'
+afterSign: build/notarize.js
+win:
+ executableName: jihuoqi-app
+nsis:
+ oneClick: false
+ artifactName: ${name}-${version}-setup.${ext}
+ allowToChangeInstallationDirectory: true
+ shortcutName: ${productName}
+ uninstallDisplayName: ${productName}
+ createDesktopShortcut: always
+mac:
+ entitlementsInherit: build/entitlements.mac.plist
+ extendInfo:
+ - NSCameraUsageDescription: Application requests access to the device's camera.
+ - NSMicrophoneUsageDescription: Application requests access to the device's microphone.
+ - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
+ - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
+dmg:
+ artifactName: ${name}-${version}.${ext}
+linux:
+ target:
+ - AppImage
+ - snap
+ - deb
+ maintainer: electronjs.org
+ category: Utility
+appImage:
+ artifactName: ${name}-${version}.${ext}
+npmRebuild: false
+publish:
+ provider: generic
+ url: https://example.com/auto-updates
diff --git a/jihuoqi/electron.vite.config.js b/jihuoqi/electron.vite.config.js
new file mode 100644
index 0000000..152a70d
--- /dev/null
+++ b/jihuoqi/electron.vite.config.js
@@ -0,0 +1,28 @@
+import { resolve } from 'path'
+import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
+import vue from '@vitejs/plugin-vue'
+
+export default defineConfig({
+ main: {
+ plugins: [externalizeDepsPlugin()]
+ },
+ preload: {
+ plugins: [externalizeDepsPlugin()],
+ build: {
+ rollupOptions: {
+ input: {
+ dl: resolve(__dirname, 'src/preload/dl.js'),
+ index: resolve(__dirname, 'src/preload/index.js')
+ }
+ }
+ }
+ },
+ renderer: {
+ resolve: {
+ alias: {
+ '@renderer': resolve('src/renderer/src')
+ }
+ },
+ plugins: [vue()]
+ }
+})
diff --git a/jihuoqi/jsconfig.json b/jihuoqi/jsconfig.json
new file mode 100644
index 0000000..b50f09d
--- /dev/null
+++ b/jihuoqi/jsconfig.json
@@ -0,0 +1,6 @@
+{
+ "exclude": [
+ "node_modules",
+ "public"
+ ]
+}
\ No newline at end of file
diff --git a/jihuoqi/package.json b/jihuoqi/package.json
new file mode 100644
index 0000000..1d81a84
--- /dev/null
+++ b/jihuoqi/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "jihuoqi",
+ "version": "1.0.0",
+ "description": "An Electron application with Vue",
+ "main": "./out/main/index.js",
+ "author": "lichong",
+ "homepage": "https://www.electronjs.org",
+ "scripts": {
+ "npmi": "npm i",
+ "dev": "electron-vite dev",
+ "build": "electron-vite build",
+ "build:win": "npm run build && electron-builder --win --config",
+ "build:mac": "npm run build && electron-builder --mac --config",
+ "build:linux": "npm run build && electron-builder --linux --config"
+ },
+ "dependencies": {
+ "@electron-toolkit/preload": "^1.0.2",
+ "@electron-toolkit/utils": "^1.0.2",
+ "dayjs": "^1.11.11",
+ "element-plus": "^2.7.1",
+ "js-sha256": "^0.11.0"
+ },
+ "devDependencies": {
+ "@rushstack/eslint-patch": "^1.2.0",
+ "@vitejs/plugin-vue": "^3.1.2",
+ "@vue/eslint-config-prettier": "^7.0.0",
+ "electron": "^20.3.2",
+ "electron-builder": "^23.6.0",
+ "electron-notarize": "^1.2.1",
+ "electron-vite": "^1.0.11",
+ "less": "^4.1.3",
+ "prettier": "^2.7.1",
+ "vite": "^3.1.8",
+ "vue": "^3.2.41"
+ }
+}
\ No newline at end of file
diff --git a/jihuoqi/public/icon/icon.jpg b/jihuoqi/public/icon/icon.jpg
new file mode 100644
index 0000000..4ed6253
Binary files /dev/null and b/jihuoqi/public/icon/icon.jpg differ
diff --git a/jihuoqi/src/main/index.js b/jihuoqi/src/main/index.js
new file mode 100644
index 0000000..5249c62
--- /dev/null
+++ b/jihuoqi/src/main/index.js
@@ -0,0 +1,72 @@
+import { app, shell, BrowserWindow, nativeImage } from 'electron'
+import * as path from 'path'
+import { electronApp, optimizer, is } from '@electron-toolkit/utils'
+
+// logo
+const logoIcon = nativeImage.createFromPath(path.join(__dirname, '../../public/icon/icon.jpg'))
+console.log(process.versions.node)
+// 主窗口
+let mainWindow
+function createWindow() {
+ mainWindow = new BrowserWindow({
+ minWidth: 960,
+ width: 960,
+ maxWidth: 960,
+ minHeight: 800,
+ height: 800,
+ maxHeight: 800,
+ // frame: false,
+ autoHideMenuBar: true,
+ icon: logoIcon,
+ webPreferences: {
+ preload: path.resolve(__dirname, '../preload/index.js'),
+ sandbox: false
+ }
+ })
+ mainWindow.on('ready-to-show', () => {
+ mainWindow.show()
+ // mainWindow.webContents.openDevTools()
+ })
+ mainWindow.webContents.setWindowOpenHandler((details) => {
+ shell.openExternal(details.url)
+ return { action: 'deny' }
+ })
+ // mainWindow.loadURL('http://localhost:5173/')
+
+ mainWindow.on('close', () => {
+ app.exit()
+ })
+ if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
+ mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
+ } else {
+ mainWindow.loadFile(path.join(__dirname, '../renderer/index.html'))
+ }
+}
+app.whenReady().then(() => {
+ electronApp.setAppUserModelId('com.electron')
+ // Default open or close DevTools by F12 in development
+ // and ignore CommandOrControl + R in production.
+ // see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
+ app.on('browser-window-created', (_, window) => {
+ optimizer.watchWindowShortcuts(window)
+ })
+
+ createWindow()
+
+ app.on('activate', function () {
+ // On macOS it's common to re-create a window in the app when the
+ // dock icon is clicked and there are no other windows open.
+ if (BrowserWindow.getAllWindows().length === 0) createWindow()
+ })
+})
+app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');
+// Quit when all windows are closed, except on macOS. There, it's common
+// for applications and their menu bar to stay active until the user quits
+// explicitly with Cmd + Q.
+app.on('window-all-closed', () => {
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})
+// In this file you can include the rest of your app"s specific main process
+// code. You can also put them in separate files and require them here.
diff --git a/jihuoqi/src/preload/dl.js b/jihuoqi/src/preload/dl.js
new file mode 100644
index 0000000..2604961
--- /dev/null
+++ b/jihuoqi/src/preload/dl.js
@@ -0,0 +1,21 @@
+import { contextBridge, clipboard } from 'electron'
+import { electronAPI } from '@electron-toolkit/preload'
+
+// Custom APIs for renderer
+const api = {}
+
+// Use `contextBridge` APIs to expose Electron APIs to
+// renderer only if context isolation is enabled, otherwise
+// just add to the DOM global.
+if (process.contextIsolated) {
+ try {
+ contextBridge.exposeInMainWorld('electron', electronAPI)
+ contextBridge.exposeInMainWorld('api', api)
+ contextBridge.exposeInMainWorld('elecClipboard', clipboard)
+ } catch (error) {
+ console.error(error)
+ }
+} else {
+ window.electron = electronAPI
+ window.api = api
+}
diff --git a/jihuoqi/src/preload/index.js b/jihuoqi/src/preload/index.js
new file mode 100644
index 0000000..2604961
--- /dev/null
+++ b/jihuoqi/src/preload/index.js
@@ -0,0 +1,21 @@
+import { contextBridge, clipboard } from 'electron'
+import { electronAPI } from '@electron-toolkit/preload'
+
+// Custom APIs for renderer
+const api = {}
+
+// Use `contextBridge` APIs to expose Electron APIs to
+// renderer only if context isolation is enabled, otherwise
+// just add to the DOM global.
+if (process.contextIsolated) {
+ try {
+ contextBridge.exposeInMainWorld('electron', electronAPI)
+ contextBridge.exposeInMainWorld('api', api)
+ contextBridge.exposeInMainWorld('elecClipboard', clipboard)
+ } catch (error) {
+ console.error(error)
+ }
+} else {
+ window.electron = electronAPI
+ window.api = api
+}
diff --git a/jihuoqi/src/renderer/index.html b/jihuoqi/src/renderer/index.html
new file mode 100644
index 0000000..b9fadc6
--- /dev/null
+++ b/jihuoqi/src/renderer/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+ 激活器
+
+
+
+
+
+
+
+
+
+
diff --git a/jihuoqi/src/renderer/src/App.vue b/jihuoqi/src/renderer/src/App.vue
new file mode 100644
index 0000000..80087a7
--- /dev/null
+++ b/jihuoqi/src/renderer/src/App.vue
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ jihuoma }}
+
+ 生成激活码
+ 复制激活码
+
+
+
+ 体验已过期,请联系管理员。
+
+
+
+
+
diff --git a/jihuoqi/src/renderer/src/assets/css/base.css b/jihuoqi/src/renderer/src/assets/css/base.css
new file mode 100644
index 0000000..f31f35e
--- /dev/null
+++ b/jihuoqi/src/renderer/src/assets/css/base.css
@@ -0,0 +1,5 @@
+html,
+body {
+ margin: 0;
+ padding: 0;
+}
\ No newline at end of file
diff --git a/jihuoqi/src/renderer/src/main.js b/jihuoqi/src/renderer/src/main.js
new file mode 100644
index 0000000..47e2ac1
--- /dev/null
+++ b/jihuoqi/src/renderer/src/main.js
@@ -0,0 +1,25 @@
+// main.ts
+import { createApp } from 'vue'
+import ElementPlus from 'element-plus'
+import zhCn from 'element-plus/es/locale/lang/zh-cn'
+import 'element-plus/dist/index.css'
+import App from './App.vue'
+import './assets/css/base.css'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+
+const app = createApp(App)
+// window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = true
+for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+ app.component(key, component)
+}
+app.use(ElementPlus, {
+ locale: zhCn,
+})
+app.mount('#app')
+
+document.addEventListener('keydown', (event) => {
+ const { ctrlKey, shiftKey, key } = event
+ if ((ctrlKey && shiftKey && key === 'I') || key === 'F12') {
+ return event.preventDefault()
+ }
+})