mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: 针对的并非框架
This commit is contained in:
parent
80d2218aa6
commit
6371d79d33
2
.env.framework
Normal file
2
.env.framework
Normal file
@ -0,0 +1,2 @@
|
||||
VITE_BUILD_TYPE = Production
|
||||
VITE_BUILD_PLATFORM = Framwork
|
@ -1,2 +0,0 @@
|
||||
VITE_BUILD_TYPE = Production
|
||||
VITE_BUILD_PLATFORM = LiteLoader
|
@ -4,7 +4,7 @@
|
||||
"type": "module",
|
||||
"version": "1.8.3",
|
||||
"scripts": {
|
||||
"build:liteloader": "vite build --mode liteloader",
|
||||
"build:framework": "vite build --mode framework",
|
||||
"build:shell": "vite build --mode shell",
|
||||
"build:webui": "cd ./src/webui && vite build",
|
||||
"lint": "eslint --fix src/**/*.{js,ts}",
|
||||
|
@ -46,6 +46,12 @@
|
||||
return false;
|
||||
}
|
||||
async function InitPage() {
|
||||
//查找URL参数是否有token
|
||||
let url = new URL(window.location.href);
|
||||
let token = url.searchParams.get("token");
|
||||
if (token) {
|
||||
localStorage.setItem('auth', token);
|
||||
}
|
||||
let authData = localStorage.getItem('auth');
|
||||
let isLogined = await CheckWebUiLogined(authData);
|
||||
if (authData && isLogined) {
|
||||
|
@ -28,7 +28,7 @@ if (process.env.NAPCAT_BUILDSYS == 'linux') {
|
||||
} else {
|
||||
startScripts = ['./script/BootWay05.bat', './script/BootWay05.utf8.bat', './script/dbghelp.dll', './script/BootWay05.ps1', './script/napcat.sh', './script/napcat.ps1', './script/napcat.bat', './script/napcat-utf8.bat', './script/napcat-utf8.ps1', './script/napcat-log.ps1', './script/napcat-9912.ps1', './script/napcat-9912-utf8.ps1', './script/napcat-9912.bat', './script/napcat-9912-utf8.bat'];
|
||||
}
|
||||
const LLBaseConfigPlugin: PluginOption[] = [
|
||||
const FrameworkBaseConfigPlugin: PluginOption[] = [
|
||||
// PreprocessorDirectives(),
|
||||
babel({
|
||||
filter: /.*\.(ts|js)$/,
|
||||
@ -46,9 +46,9 @@ const LLBaseConfigPlugin: PluginOption[] = [
|
||||
cp({
|
||||
targets: [
|
||||
{ src: './manifest.json', dest: 'dist' },
|
||||
{ src: './src/liteloader/napcat.cjs', dest: 'dist' },
|
||||
{ src: './src/liteloader/preload.cjs', dest: 'dist' },
|
||||
{ src: './src/liteloader/renderer.js', dest: 'dist' },
|
||||
{ src: './src/framework/napcat.cjs', dest: 'dist' },
|
||||
{ src: './src/framework/preload.cjs', dest: 'dist' },
|
||||
{ src: './src/framework/renderer.js', dest: 'dist' },
|
||||
{ src: './package.json', dest: 'dist' },
|
||||
{ src: './logo.png', dest: 'dist' },
|
||||
//...external.map(genCpModule)
|
||||
@ -112,7 +112,7 @@ const ShellBaseConfig = () => defineConfig({
|
||||
},
|
||||
});
|
||||
|
||||
const LLBaseConfig = () => defineConfig({
|
||||
const FrameworkBaseConfig = () => defineConfig({
|
||||
resolve: {
|
||||
conditions: ['node', 'default'],
|
||||
alias: {
|
||||
@ -126,7 +126,7 @@ const LLBaseConfig = () => defineConfig({
|
||||
target: 'esnext',
|
||||
minify: false,
|
||||
lib: {
|
||||
entry: "src/liteloader/napcat.ts",
|
||||
entry: "src/framework/napcat.ts",
|
||||
formats: ['es'],
|
||||
fileName: () => 'napcat.mjs',
|
||||
},
|
||||
@ -144,8 +144,8 @@ export default defineConfig(({ mode }): UserConfig => {
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
...LLBaseConfig(),
|
||||
plugins: [...LLBaseConfigPlugin],
|
||||
...FrameworkBaseConfig(),
|
||||
plugins: [...FrameworkBaseConfigPlugin],
|
||||
};
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user