现在非开发环境下web端视为服务器端口与页面端口一致
This commit is contained in:
1 parent
5ca7125328
commit
133d0b7844
6 files changed
+20
-4
No files matched your search
@@ -20,6 +20,8 @@ import {
|
||||
} from '@vicons/ionicons5'
|
||||
import { useSettingStore } from "@/pinia/store";
|
||||
|
||||
// console.log(process.env.NODE_ENV)
|
||||
|
||||
|
||||
const settingData = useSettingStore();
|
||||
const activePage = ref('upload')
|
||||
|
||||
+10
-2
@@ -19,12 +19,20 @@ if (activeKeyMap == null ){
|
||||
activeKeyMap = JSON.stringify(['A-Z','0-9'])
|
||||
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", {
|
||||
state: () => ({
|
||||
activeFuction: activeFuctionLocal,
|
||||
activeKeyMap:JSON.parse(activeKeyMap),
|
||||
serverPort:config.PORT,
|
||||
token,userID,userGroup
|
||||
enableGuest:config.enableGuest,
|
||||
serverPort,
|
||||
token,
|
||||
userID,
|
||||
userGroup
|
||||
}),
|
||||
getters: {
|
||||
// double: state => state.count * 2
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
<n-checkbox size="large" label="保持登录状态" v-model:checked="keepTokenLocal" />
|
||||
</n-flex>
|
||||
<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-flex>
|
||||
</n-flex>
|
||||
|
||||
Reference in new issue
Block a user