Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82d9531c25 | ||
|
|
ad8260b87e | ||
|
|
4b9599ef8a | ||
|
|
5ad3f87323 | ||
|
|
5b5849744b | ||
|
|
44f3d57884 |
No files matched your search
@@ -37,3 +37,5 @@ miaoShare.db
|
|||||||
|
|
||||||
# JWT SK
|
# JWT SK
|
||||||
*.key
|
*.key
|
||||||
|
|
||||||
|
visualizer.html
|
||||||
+1
-3
@@ -26,8 +26,7 @@ import config from "../miaoShareConfig.json"
|
|||||||
|
|
||||||
const settingData = useSettingStore();
|
const settingData = useSettingStore();
|
||||||
const serverPort = settingData.serverPort;
|
const serverPort = settingData.serverPort;
|
||||||
const baseUrl =
|
const baseUrl = settingData.baseUrl
|
||||||
location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
|
||||||
const tokenExpiresIn = config.tokenExpiresIn
|
const tokenExpiresIn = config.tokenExpiresIn
|
||||||
|
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ const menuOptions = ref([
|
|||||||
key: 'upload',
|
key: 'upload',
|
||||||
icon: renderIcon(uploadIcon),
|
icon: renderIcon(uploadIcon),
|
||||||
disabled: computed(() => {
|
disabled: computed(() => {
|
||||||
// console.log(settingData)
|
|
||||||
return settingData.token === null
|
return settingData.token === null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const _toClipboard = async (text) => {
|
|||||||
}
|
}
|
||||||
const setting = useSettingStore();
|
const setting = useSettingStore();
|
||||||
const serverPort = setting.serverPort;
|
const serverPort = setting.serverPort;
|
||||||
const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
const baseUrl = setting.baseUrl
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
messages: {
|
messages: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
|||||||
+44
-32
@@ -1,72 +1,84 @@
|
|||||||
import { defineStore } from "pinia";
|
import { defineStore } from 'pinia'
|
||||||
import config from "../../miaoShareConfig.json"
|
import config from '../../miaoShareConfig.json'
|
||||||
|
|
||||||
const userID = localStorage.getItem('userID');
|
console.log(location)
|
||||||
const userGroup = localStorage.getItem('userGroup');
|
|
||||||
|
const userID = localStorage.getItem('userID')
|
||||||
|
const userGroup = localStorage.getItem('userGroup')
|
||||||
|
|
||||||
const tokenExpiresIn = config.tokenExpiresIn
|
const tokenExpiresIn = config.tokenExpiresIn
|
||||||
if(localStorage.getItem('tokenExpiredTime') == null ||
|
if (
|
||||||
parseInt(localStorage.getItem('tokenExpiredTime')) < parseInt(Date.now())){
|
localStorage.getItem('tokenExpiredTime') == null ||
|
||||||
|
parseInt(localStorage.getItem('tokenExpiredTime')) < parseInt(Date.now())
|
||||||
|
) {
|
||||||
localStorage.removeItem('token')
|
localStorage.removeItem('token')
|
||||||
}
|
}
|
||||||
|
|
||||||
const token = localStorage.getItem('token');
|
const token = localStorage.getItem('token')
|
||||||
|
|
||||||
// console.log(token)
|
|
||||||
|
|
||||||
var activeFuctionLocal = localStorage.getItem('activeFuction')
|
var activeFuctionLocal = localStorage.getItem('activeFuction')
|
||||||
if (activeFuctionLocal == null){
|
if (activeFuctionLocal == null) {
|
||||||
activeFuctionLocal = 'AES128'
|
activeFuctionLocal = 'AES128'
|
||||||
localStorage.setItem('activeFuction',activeFuctionLocal)
|
localStorage.setItem('activeFuction', activeFuctionLocal)
|
||||||
}
|
}
|
||||||
// localStorage.removeItem('activeKeyMap')
|
// localStorage.removeItem('activeKeyMap')
|
||||||
var activeKeyMap = localStorage.getItem('activeKeyMap')
|
var activeKeyMap = localStorage.getItem('activeKeyMap')
|
||||||
|
|
||||||
if (activeKeyMap == null ){
|
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
|
const serverPort =
|
||||||
|
process.env.NODE_ENV === 'development' ? config.PORT : location.port
|
||||||
|
|
||||||
|
const baseUrl = 'http://110.238.117.95:17057/'
|
||||||
|
// location.protocol + '//' + location.hostname + ':' + serverPort + '/'
|
||||||
|
|
||||||
|
// const wsBaseUrl = 'ws' + '://' + location.hostname + ':' + serverPort
|
||||||
|
const wsBaseUrl = 'ws://110.238.117.95:17057/'
|
||||||
|
|
||||||
// console.log(process.env.NODE_ENV,config.DEVPORT,location.port,serverPort)
|
// 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),
|
||||||
enableGuest:config.enableGuest,
|
enableGuest: config.enableGuest,
|
||||||
serverPort,
|
serverPort,
|
||||||
token,
|
token,
|
||||||
userID,
|
userID,
|
||||||
userGroup
|
userGroup,
|
||||||
|
baseUrl,
|
||||||
|
wsBaseUrl
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
// double: state => state.count * 2
|
// double: state => state.count * 2
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
setJWT( token,keepTokenLocal ){
|
setJWT(token, keepTokenLocal) {
|
||||||
this.token = token
|
this.token = token
|
||||||
if(keepTokenLocal){
|
if (keepTokenLocal) {
|
||||||
localStorage.setItem('token',token)
|
localStorage.setItem('token', token)
|
||||||
localStorage.setItem('tokenExpiredTime',parseInt(Date.now())+parseInt(tokenExpiresIn)*3600000)
|
localStorage.setItem(
|
||||||
|
'tokenExpiredTime',
|
||||||
|
parseInt(Date.now()) + parseInt(tokenExpiresIn) * 3600000
|
||||||
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setUserID( id,keepTokenLocal ){
|
setUserID(id, keepTokenLocal) {
|
||||||
this.userID = id
|
this.userID = id
|
||||||
if(keepTokenLocal)
|
if (keepTokenLocal) localStorage.setItem('userID', id)
|
||||||
localStorage.setItem('userID',id)
|
|
||||||
},
|
},
|
||||||
setUserGroup( g,keepTokenLocal ){
|
setUserGroup(g, keepTokenLocal) {
|
||||||
this.userGroup = g
|
this.userGroup = g
|
||||||
if(keepTokenLocal)
|
if (keepTokenLocal) localStorage.setItem('userGroup', g)
|
||||||
localStorage.setItem('userGroup',g)
|
|
||||||
},
|
},
|
||||||
getToken(){
|
getToken() {
|
||||||
return localStorage.getItem('token')
|
return localStorage.getItem('token')
|
||||||
}
|
}
|
||||||
// increment() {
|
// increment() {
|
||||||
// this.count++;
|
// this.count++;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
+5
-3
@@ -105,9 +105,11 @@ const _toClipboard = async (text) => {
|
|||||||
|
|
||||||
const setting = useSettingStore();
|
const setting = useSettingStore();
|
||||||
const serverPort = setting.serverPort;
|
const serverPort = setting.serverPort;
|
||||||
const wsBaseUrl = 'ws' + "://" + location.hostname + ":" + serverPort;
|
// const wsBaseUrl = 'ws' + "://" + location.hostname + ":" + serverPort;
|
||||||
const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
const wsBaseUrl = setting.wsBaseUrl
|
||||||
const QRIconUrl = ref(location.protocol + "//" + location.hostname + ":" + serverPort + "/favicon.ico")
|
// const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
||||||
|
const baseUrl = setting.baseUrl
|
||||||
|
const QRIconUrl = ref(baseUrl + "favicon.ico")
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ const setting = useSettingStore();
|
|||||||
// 服务端端口
|
// 服务端端口
|
||||||
const serverPort = setting.serverPort;
|
const serverPort = setting.serverPort;
|
||||||
|
|
||||||
var baseUrl =
|
// const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
||||||
location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
const baseUrl = setting.baseUrl
|
||||||
// console.log(baseUrl);
|
// console.log(baseUrl);
|
||||||
|
|
||||||
// const blob2Uint8Array = function(blob) {
|
// const blob2Uint8Array = function(blob) {
|
||||||
|
|||||||
+2
-2
@@ -43,8 +43,8 @@ const serverPort = settingData.serverPort;
|
|||||||
const userIDInput = ref('')
|
const userIDInput = ref('')
|
||||||
const userPasswordInput = ref('')
|
const userPasswordInput = ref('')
|
||||||
const isLogining = ref(false)
|
const isLogining = ref(false)
|
||||||
const baseUrl =
|
// const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
||||||
location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
const baseUrl = settingData.baseUrl
|
||||||
|
|
||||||
const Token = computed(() => settingData.token)
|
const Token = computed(() => settingData.token)
|
||||||
const keepTokenLocal = ref(true)
|
const keepTokenLocal = ref(true)
|
||||||
|
|||||||
@@ -94,8 +94,9 @@ var file_Code_Map = ref([]);
|
|||||||
var uploadProcess = ref(0);
|
var uploadProcess = ref(0);
|
||||||
|
|
||||||
|
|
||||||
const baseUrl =
|
// const baseUrl = location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
||||||
location.protocol + "//" + location.hostname + ":" + serverPort + "/";
|
const baseUrl = setting.baseUrl
|
||||||
|
console.log(baseUrl)
|
||||||
|
|
||||||
|
|
||||||
// const blob2Uint8Array = function(blob) {
|
// const blob2Uint8Array = function(blob) {
|
||||||
|
|||||||
+10
-9
@@ -10,38 +10,39 @@ export default defineConfig({
|
|||||||
vue(),
|
vue(),
|
||||||
visualizer({
|
visualizer({
|
||||||
open: true,
|
open: true,
|
||||||
filename: "visualizer.html" //分析图生成的文件名
|
filename: 'visualizer.html' //分析图生成的文件名
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": fileURLToPath(new URL("./src", import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
// host:'0.0.0.0',
|
// host:'0.0.0.0',
|
||||||
port: "17058",
|
port: '17058',
|
||||||
open: true
|
open: true
|
||||||
},
|
},
|
||||||
esbuild: {
|
esbuild: {
|
||||||
drop: ["console", "debugger"]
|
drop: ['console', 'debugger']
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
minify: true,
|
minify: true,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
// 打包输出的配置
|
// 打包输出的配置
|
||||||
manualChunks: id => {
|
manualChunks: (id) => {
|
||||||
// 这个ID,就是所有文件的绝对路径
|
// 这个ID,就是所有文件的绝对路径
|
||||||
if (id.includes("node_modules")) {
|
if (id.includes('node_modules')) {
|
||||||
// 因为 node_modules 中的依赖通常是不会改变的
|
// 因为 node_modules 中的依赖通常是不会改变的
|
||||||
// 所以直接单独打包出去
|
// 所以直接单独打包出去
|
||||||
// 这个return 的值就是打包的名称
|
// 这个return 的值就是打包的名称
|
||||||
// return id.split('node_modules')[1]
|
// return id.split('node_modules')[1]
|
||||||
return "modules";
|
return 'modules'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
});
|
base: './'
|
||||||
|
})
|
||||||
Reference in new issue
Block a user