feat: 数据大屏自动登录

This commit is contained in:
Vinjor 2024-08-12 16:59:03 +08:00
parent 79230e002c
commit 2330652047
9 changed files with 186 additions and 24 deletions

View File

@ -0,0 +1,63 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
<option name="HTML_QUOTE_STYLE" value="Single" />
<option name="HTML_ENFORCE_QUOTES" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<VueCodeStyleSettings>
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
</VueCodeStyleSettings>
<codeStyleSettings language="HTML">
<option name="SOFT_MARGINS" value="120" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="120" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="120" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Vue">
<option name="SOFT_MARGINS" value="120" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

25
.idea/watcherTasks.xml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions">
<TaskOptions isEnabled="true">
<option name="arguments" value="$FileName$:$FileNameWithoutExtension$.css" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="scss" />
<option name="immediateSync" value="true" />
<option name="name" value="SCSS" />
<option name="output" value="$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map" />
<option name="outputFilters">
<array />
</option>
<option name="outputFromStdout" value="false" />
<option name="program" value="sass" />
<option name="runOnExternalChanges" value="true" />
<option name="scopeName" value="Project Files" />
<option name="trackOnlyRoot" value="true" />
<option name="workingDir" value="$FileDir$" />
<envs />
</TaskOptions>
</component>
</project>

12
.stylelintrc.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = {
rules: {
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['deep']
}
],
}
};

View File

@ -71,7 +71,7 @@
"mockjs": "^1.1.0",
"plop": "^3.0.5",
"prettier": "^2.6.2",
"sass": "^1.49.11",
"sass": "1.77.6",
"sass-loader": "^12.6.0",
"typescript": "4.6.3",
"vite": "2.9.9",

View File

@ -125,7 +125,7 @@ importers:
version: 0.11.0
'@vitejs/plugin-vue':
specifier: ^1.10.2
version: 1.10.2(vite@2.9.9(sass@1.77.8))
version: 1.10.2(vite@2.9.9(sass@1.77.6))
'@vitejs/plugin-vue-jsx':
specifier: ^1.3.9
version: 1.3.10
@ -175,26 +175,26 @@ importers:
specifier: ^2.6.2
version: 2.8.8
sass:
specifier: ^1.49.11
version: 1.77.8
specifier: 1.77.6
version: 1.77.6
sass-loader:
specifier: ^12.6.0
version: 12.6.0(sass@1.77.8)(webpack@5.93.0)
version: 12.6.0(sass@1.77.6)(webpack@5.93.0)
typescript:
specifier: 4.6.3
version: 4.6.3
vite:
specifier: 2.9.9
version: 2.9.9(sass@1.77.8)
version: 2.9.9(sass@1.77.6)
vite-plugin-compression:
specifier: ^0.5.1
version: 0.5.1(vite@2.9.9(sass@1.77.8))
version: 0.5.1(vite@2.9.9(sass@1.77.6))
vite-plugin-importer:
specifier: ^0.2.5
version: 0.2.5
vite-plugin-mock:
specifier: ^2.9.6
version: 2.9.8(mockjs@1.1.0)(vite@2.9.9(sass@1.77.8))
version: 2.9.8(mockjs@1.1.0)(vite@2.9.9(sass@1.77.6))
vite-plugin-monaco-editor:
specifier: ^1.1.0
version: 1.1.0(monaco-editor@0.33.0)
@ -2872,8 +2872,8 @@ packages:
sass-embedded:
optional: true
sass@1.77.8:
resolution: {integrity: sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==}
sass@1.77.6:
resolution: {integrity: sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==}
engines: {node: '>=14.0.0'}
hasBin: true
@ -3812,7 +3812,7 @@ snapshots:
'@types/node': 20.5.1
chalk: 4.1.2
cosmiconfig: 8.3.6(typescript@5.5.4)
cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.5.4))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.4))(typescript@5.5.4)
cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@4.6.3))(ts-node@10.9.2(@types/node@16.18.104)(typescript@4.6.3))(typescript@5.5.4)
lodash.isplainobject: 4.0.6
lodash.merge: 4.6.2
lodash.uniq: 4.5.0
@ -4167,9 +4167,9 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@vitejs/plugin-vue@1.10.2(vite@2.9.9(sass@1.77.8))':
'@vitejs/plugin-vue@1.10.2(vite@2.9.9(sass@1.77.6))':
dependencies:
vite: 2.9.9(sass@1.77.8)
vite: 2.9.9(sass@1.77.6)
'@volar/code-gen@0.28.10':
dependencies:
@ -4777,7 +4777,7 @@ snapshots:
convert-source-map@2.0.0: {}
cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.5.4))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.5.4))(typescript@5.5.4):
cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@4.6.3))(ts-node@10.9.2(@types/node@16.18.104)(typescript@4.6.3))(typescript@5.5.4):
dependencies:
'@types/node': 20.5.1
cosmiconfig: 8.3.6(typescript@5.5.4)
@ -6526,15 +6526,15 @@ snapshots:
safer-buffer@2.1.2: {}
sass-loader@12.6.0(sass@1.77.8)(webpack@5.93.0):
sass-loader@12.6.0(sass@1.77.6)(webpack@5.93.0):
dependencies:
klona: 2.0.6
neo-async: 2.6.2
webpack: 5.93.0
optionalDependencies:
sass: 1.77.8
sass: 1.77.6
sass@1.77.8:
sass@1.77.6:
dependencies:
chokidar: 3.6.0
immutable: 4.3.7
@ -6910,12 +6910,12 @@ snapshots:
evtd: 0.2.4
vue: 3.4.36(typescript@4.6.3)
vite-plugin-compression@0.5.1(vite@2.9.9(sass@1.77.8)):
vite-plugin-compression@0.5.1(vite@2.9.9(sass@1.77.6)):
dependencies:
chalk: 4.1.2
debug: 4.3.6
fs-extra: 10.1.0
vite: 2.9.9(sass@1.77.8)
vite: 2.9.9(sass@1.77.6)
transitivePeerDependencies:
- supports-color
@ -6927,7 +6927,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
vite-plugin-mock@2.9.8(mockjs@1.1.0)(vite@2.9.9(sass@1.77.8)):
vite-plugin-mock@2.9.8(mockjs@1.1.0)(vite@2.9.9(sass@1.77.6)):
dependencies:
'@types/mockjs': 1.0.10
chalk: 4.1.2
@ -6938,7 +6938,7 @@ snapshots:
fast-glob: 3.3.2
mockjs: 1.1.0
path-to-regexp: 6.2.2
vite: 2.9.9(sass@1.77.8)
vite: 2.9.9(sass@1.77.6)
transitivePeerDependencies:
- supports-color
@ -6946,7 +6946,7 @@ snapshots:
dependencies:
monaco-editor: 0.33.0
vite@2.9.9(sass@1.77.8):
vite@2.9.9(sass@1.77.6):
dependencies:
esbuild: 0.14.54
postcss: 8.4.41
@ -6954,7 +6954,7 @@ snapshots:
rollup: 2.79.1
optionalDependencies:
fsevents: 2.3.3
sass: 1.77.8
sass: 1.77.6
void-elements@3.1.0: {}

View File

@ -137,6 +137,7 @@
import { reactive, ref, onMounted } from 'vue'
import shuffle from 'lodash/shuffle'
import { carouselInterval } from '@/settings/designSetting'
import { useRoute } from 'vue-router';
import { useSystemStore } from '@/store/modules/systemStore/systemStore'
import { SystemStoreUserInfoEnum, SystemStoreEnum } from '@/store/modules/systemStore/systemStore.d'
import { GoThemeSelect } from '@/components/GoThemeSelect'
@ -146,7 +147,7 @@ import { LayoutFooter } from '@/layout/components/LayoutFooter'
import { PageEnum } from '@/enums/pageEnum'
import { StorageEnum } from '@/enums/storageEnum'
import { icon } from '@/plugins'
import { routerTurnByName } from '@/utils'
import { fetchRouteParams, fetchRouteParamsLocation, routerTurnByName } from '@/utils'
import {getTenantIdByNameApi, getUserProfileApi, loginApi} from '@/api/path'
import { Verify } from '@/components/Verifition'
@ -167,6 +168,13 @@ const systemStore = useSystemStore()
const t = window['$t']
// URL
const urlParams = new URLSearchParams(window.location.search);
const params_token = urlParams.get('token');
const params_tenantId = urlParams.get('tenantId');
console.log("token",params_token)
console.log("tenantId",params_tenantId)
const formInline = reactive({
tenantName: '芋道源码',
username: 'admin',
@ -221,6 +229,35 @@ const shuffleHandle = () => {
bgList.value = shuffle(bgList.value)
}, carouselInterval)
}
//
const loginAuto = async() => {
if(null!=params_token && null!=params_tenantId){
systemStore.setItem(SystemStoreEnum.TENANT_INFO, {
tenantId: Number(params_tenantId)
})
const tokenValue = params_token
const tokenName = 'Authorization'
systemStore.setItem(SystemStoreEnum.USER_INFO, {
[SystemStoreUserInfoEnum.USER_TOKEN]: tokenValue,
[SystemStoreUserInfoEnum.TOKEN_NAME]: tokenName
})
//
const profileRes = await getUserProfileApi()
const id = profileRes?.data?.id
const username = profileRes?.data?.nickname
const nickname = profileRes?.data?.nickname
// pinia
systemStore.setItem(SystemStoreEnum.USER_INFO, {
[SystemStoreUserInfoEnum.USER_TOKEN]: tokenValue,
[SystemStoreUserInfoEnum.TOKEN_NAME]: tokenName,
[SystemStoreUserInfoEnum.USER_ID]: id,
[SystemStoreUserInfoEnum.USER_NAME]: username,
[SystemStoreUserInfoEnum.NICK_NAME]: nickname,
})
routerTurnByName(PageEnum.BASE_HOME_NAME, true)
}
}
//
const verify = ref()
@ -316,6 +353,8 @@ onMounted(() => {
}, 100)
shuffleHandle()
//
loginAuto()
})
</script>