现在非开发环境下web端视为服务器端口与页面端口一致
This commit is contained in:
1 parent
5ca7125328
commit
133d0b7844
6 files changed
+20
-4
No files matched your search
@@ -33,6 +33,7 @@ coverage
|
|||||||
temp
|
temp
|
||||||
miaoShare.db
|
miaoShare.db
|
||||||
addUser.js
|
addUser.js
|
||||||
|
removeUser.js
|
||||||
|
|
||||||
# JWT SK
|
# JWT SK
|
||||||
*.key
|
*.key
|
||||||
@@ -7,5 +7,6 @@
|
|||||||
"guest":{
|
"guest":{
|
||||||
"cloudCapacity":2147483648
|
"cloudCapacity":2147483648
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"enableGuest":false
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
/*
|
||||||
|
仅作为临时测试使用
|
||||||
|
后续对这个进行拆分
|
||||||
|
*/
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import Database from "better-sqlite3";
|
import Database from "better-sqlite3";
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import {
|
|||||||
} from '@vicons/ionicons5'
|
} from '@vicons/ionicons5'
|
||||||
import { useSettingStore } from "@/pinia/store";
|
import { useSettingStore } from "@/pinia/store";
|
||||||
|
|
||||||
|
// console.log(process.env.NODE_ENV)
|
||||||
|
|
||||||
|
|
||||||
const settingData = useSettingStore();
|
const settingData = useSettingStore();
|
||||||
const activePage = ref('upload')
|
const activePage = ref('upload')
|
||||||
|
|||||||
+10
-2
@@ -19,12 +19,20 @@ if (activeKeyMap == null ){
|
|||||||
activeKeyMap = JSON.stringify(['A-Z','0-9'])
|
activeKeyMap = JSON.stringify(['A-Z','0-9'])
|
||||||
localStorage.setItem('activeKeyMap',activeKeyMap)
|
localStorage.setItem('activeKeyMap',activeKeyMap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 开发环境下服务器端口使用设置的端口,否则使用与页面相同的端口
|
||||||
|
const serverPort = process.env.NODE_ENV === 'development' ? config.PORT : location.port
|
||||||
|
|
||||||
|
// console.log(process.env.NODE_ENV,config.DEVPORT,location.port,serverPort)
|
||||||
export const useSettingStore = defineStore("setting", {
|
export const useSettingStore = defineStore("setting", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
activeFuction: activeFuctionLocal,
|
activeFuction: activeFuctionLocal,
|
||||||
activeKeyMap:JSON.parse(activeKeyMap),
|
activeKeyMap:JSON.parse(activeKeyMap),
|
||||||
serverPort:config.PORT,
|
enableGuest:config.enableGuest,
|
||||||
token,userID,userGroup
|
serverPort,
|
||||||
|
token,
|
||||||
|
userID,
|
||||||
|
userGroup
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
// double: state => state.count * 2
|
// double: state => state.count * 2
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
<n-checkbox size="large" label="保持登录状态" v-model:checked="keepTokenLocal" />
|
<n-checkbox size="large" label="保持登录状态" v-model:checked="keepTokenLocal" />
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<n-flex justify="end">
|
<n-flex justify="end">
|
||||||
<n-button @click="useGuestAccount">使用访客账号登录</n-button>
|
<n-button @click="useGuestAccount" v-if="settingData.enableGuest">使用访客账号登录</n-button>
|
||||||
<n-button @click="login">登录</n-button>
|
<n-button @click="login">登录</n-button>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
|
|||||||
Reference in new issue
Block a user