parent
5bd178f909
commit
f7a29fcbb4
|
@ -27,7 +27,6 @@
|
||||||
"jetlinks-store": "^0.0.3",
|
"jetlinks-store": "^0.0.3",
|
||||||
"jetlinks-ui-components": "^1.0.21",
|
"jetlinks-ui-components": "^1.0.21",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"jsencrypt": "^3.3.2",
|
|
||||||
"less": "^4.1.3",
|
"less": "^4.1.3",
|
||||||
"less-loader": "^11.1.0",
|
"less-loader": "^11.1.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
|
|
|
@ -61,10 +61,3 @@ export const loginout_api = () => server.get<any>('/user-token/reset')
|
||||||
export const getOAuth2 = (params: any) => server.get<any>('/oauth2/authorize', params)
|
export const getOAuth2 = (params: any) => server.get<any>('/oauth2/authorize', params)
|
||||||
|
|
||||||
export const initApplication = (clientId: string | number) => server.get<{name: string}>(`/application/${clientId}/info`)
|
export const initApplication = (clientId: string | number) => server.get<{name: string}>(`/application/${clientId}/info`)
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录加密信息
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
export const authLoginConfig = () => server.get(`/authorize/login/configs`)
|
|
|
@ -8,32 +8,18 @@
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div style="max-width: 400px;" class="ant-form-vertical">
|
<div style="max-width: 400px;" class="ant-form-vertical">
|
||||||
<j-form-item v-for="item in config.properties" :key="item.property" :name="name.concat([item.property])" :label="item.name">
|
<j-form-item v-for="item in config.properties" :name="name.concat([item.property])" :label="item.name">
|
||||||
<!-- <template v-if='item.type?.type === "string"'>
|
<template v-if='item.type?.type === "string"'>
|
||||||
<j-input v-model:value='value[item.property]' size="small" :placeholder="`请输入${item.name}`"/>
|
<j-input v-model:value='value[item.property]' size="small" :placeholder="`请输入${item.name}`"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if='item.type?.type === "int"'>
|
<j-select v-else v-model:value="value[item.property]" :options="item.type?.elements?.map((e: { 'text': string, 'value': string }) => ({
|
||||||
<j-input-number style="width: 100%;" v-model:value='value[item.property]' size="small" :placeholder="`请输入${item.name}`"/>
|
|
||||||
</template>
|
|
||||||
<j-select v-else :mode="item.type?.multi ? 'multiple' : ''" v-model:value="value[item.property]" :options="item.type?.elements?.map((e: { 'text': string, 'value': string }) => ({
|
|
||||||
label: e.text,
|
label: e.text,
|
||||||
value: e.value,
|
value: e.value,
|
||||||
}))" size="small" :placeholder="`请输入${item.name}`"></j-select> -->
|
}))" size="small" :placeholder="`请输入${item.name}`"></j-select>
|
||||||
<ValueItem
|
|
||||||
v-model:modelValue="value[item.property]"
|
|
||||||
:itemType="item.type?.type"
|
|
||||||
:mode="item?.type?.multi ? 'multiple' : ''"
|
|
||||||
:options="
|
|
||||||
item.type?.elements?.map(e => ({
|
|
||||||
label: e.text,
|
|
||||||
value: e.value,
|
|
||||||
}))
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</j-form-item>
|
</j-form-item>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
{{ config.name || '存储配置' }}
|
{{ config.name || 存储配置 }}
|
||||||
<AIcon type="EditOutlined" class="item-icon" />
|
<AIcon type="EditOutlined" class="item-icon" />
|
||||||
</j-popover>
|
</j-popover>
|
||||||
</j-button>
|
</j-button>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
<div class="value-item-warp">
|
<div class="value-item-warp">
|
||||||
<j-select
|
<j-select
|
||||||
v-if="typeMap.get(itemType) === 'select'"
|
v-if="typeMap.get(itemType) === 'select'"
|
||||||
:mode="mode"
|
|
||||||
v-model:value="myValue"
|
v-model:value="myValue"
|
||||||
:options="options"
|
:options="options"
|
||||||
allowClear
|
allowClear
|
||||||
|
@ -140,11 +139,6 @@ const props = defineProps({
|
||||||
type: Array as PropType<DefaultOptionType[]>,
|
type: Array as PropType<DefaultOptionType[]>,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
// 多选框
|
|
||||||
mode: {
|
|
||||||
type: String as PropType<'multiple' | 'tags' | 'combobox' | ''>,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
// type Props = {
|
// type Props = {
|
||||||
// itemData?: Object;
|
// itemData?: Object;
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
import JSEncrypt from "jsencrypt";
|
|
||||||
|
|
||||||
export const encrypt =(txt:string,publicKey:string)=>{
|
|
||||||
const encryptor = new JSEncrypt()
|
|
||||||
encryptor.setPublicKey(publicKey)
|
|
||||||
return encryptor.encrypt(txt)
|
|
||||||
}
|
|
|
@ -169,15 +169,13 @@ import {
|
||||||
getInitSet,
|
getInitSet,
|
||||||
systemVersion,
|
systemVersion,
|
||||||
bindInfo,
|
bindInfo,
|
||||||
settingDetail, userDetail,
|
settingDetail, userDetail
|
||||||
authLoginConfig
|
|
||||||
} from '@/api/login'
|
} from '@/api/login'
|
||||||
import { useUserInfo } from '@/store/userInfo';
|
import { useUserInfo } from '@/store/userInfo';
|
||||||
import { useSystem } from '@/store/system'
|
import { useSystem } from '@/store/system'
|
||||||
import { LocalStore } from '@/utils/comm';
|
import { LocalStore } from '@/utils/comm';
|
||||||
import { BASE_API_PATH, TOKEN_KEY, Version_Code } from '@/utils/variable';
|
import { BASE_API_PATH, TOKEN_KEY, Version_Code } from '@/utils/variable';
|
||||||
import { SystemConst } from '@/utils/consts';
|
import { SystemConst } from '@/utils/consts';
|
||||||
import {encrypt} from '@/utils/encrypt'
|
|
||||||
|
|
||||||
const store = useUserInfo();
|
const store = useUserInfo();
|
||||||
const systemStore = useSystem();
|
const systemStore = useSystem();
|
||||||
|
@ -201,12 +199,6 @@ const form = reactive({
|
||||||
verifyKey: '',
|
verifyKey: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const RsaConfig = reactive<any>({
|
|
||||||
enabled:false, //是否加密
|
|
||||||
publicKey:'', //rsa公钥,使用此公钥对密码进行加密
|
|
||||||
id:'' //密钥ID
|
|
||||||
})
|
|
||||||
|
|
||||||
const rules = {
|
const rules = {
|
||||||
username: [
|
username: [
|
||||||
{
|
{
|
||||||
|
@ -257,14 +249,7 @@ iconMap.set('third-party', getImage('/apply/provider5.png'));
|
||||||
const onFinish = async () => {
|
const onFinish = async () => {
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
const res: any = await authLogin(form);
|
||||||
const data = {
|
|
||||||
...form,
|
|
||||||
password:RsaConfig.enabled?encrypt(form.password,RsaConfig.publicKey):form.password,
|
|
||||||
encryptId:RsaConfig.enabled?RsaConfig.id:undefined
|
|
||||||
}
|
|
||||||
|
|
||||||
const res: any = await authLogin(data);
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
LocalStore.set(TOKEN_KEY, res?.result.token);
|
LocalStore.set(TOKEN_KEY, res?.result.token);
|
||||||
|
@ -298,7 +283,6 @@ const onFinish = async () => {
|
||||||
form.verifyCode = '';
|
form.verifyCode = '';
|
||||||
getCode();
|
getCode();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
getRsa()
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -333,18 +317,6 @@ const getOpen = () => {
|
||||||
systemStore.getFront()
|
systemStore.getFront()
|
||||||
};
|
};
|
||||||
|
|
||||||
//获取加密信息
|
|
||||||
const getRsa =async () =>{
|
|
||||||
const res:any = await authLoginConfig()
|
|
||||||
if(res.status === 200){
|
|
||||||
if(res.result?.encrypt){
|
|
||||||
RsaConfig.enabled = res.result?.encrypt.enabled
|
|
||||||
RsaConfig.publicKey = res.result?.encrypt.publicKey
|
|
||||||
RsaConfig.id = res.result?.encrypt.id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const basis = computed(() => {
|
const basis = computed(() => {
|
||||||
return systemStore.configInfo['front'] || {}
|
return systemStore.configInfo['front'] || {}
|
||||||
})
|
})
|
||||||
|
@ -380,11 +352,6 @@ watch(
|
||||||
getOpen();
|
getOpen();
|
||||||
getCode();
|
getCode();
|
||||||
screenRotation(screenWidth.value, screenHeight.value);
|
screenRotation(screenWidth.value, screenHeight.value);
|
||||||
|
|
||||||
onMounted(()=>{
|
|
||||||
getRsa()
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|
|
@ -94,8 +94,7 @@ export default defineConfig(({ mode}) => {
|
||||||
[env.VITE_APP_BASE_API]: {
|
[env.VITE_APP_BASE_API]: {
|
||||||
// target: 'http://192.168.32.226:8844',
|
// target: 'http://192.168.32.226:8844',
|
||||||
// target: 'http://192.168.32.244:8881',
|
// target: 'http://192.168.32.244:8881',
|
||||||
target: 'http://192.168.32.163:8844', //张季本地
|
target: 'http://120.77.179.54:8844', // 120测试
|
||||||
// target: 'http://120.77.179.54:8844', // 120测试
|
|
||||||
// target: 'http://192.168.33.46:8844', // 本地开发环境
|
// target: 'http://192.168.33.46:8844', // 本地开发环境
|
||||||
ws: 'ws://192.168.33.46:8844',
|
ws: 'ws://192.168.33.46:8844',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
|
|
@ -3862,11 +3862,6 @@ jsbn@~0.1.0:
|
||||||
resolved "https://registry.jetlinks.cn/jsbn/-/jsbn-0.1.1.tgz"
|
resolved "https://registry.jetlinks.cn/jsbn/-/jsbn-0.1.1.tgz"
|
||||||
integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==
|
integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==
|
||||||
|
|
||||||
jsencrypt@^3.3.2:
|
|
||||||
version "3.3.2"
|
|
||||||
resolved "http://registry.jetlinks.cn/jsencrypt/-/jsencrypt-3.3.2.tgz#b0f1a2278810c7ba1cb8957af11195354622df7c"
|
|
||||||
integrity sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A==
|
|
||||||
|
|
||||||
jsesc@^2.5.1:
|
jsesc@^2.5.1:
|
||||||
version "2.5.2"
|
version "2.5.2"
|
||||||
resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz"
|
resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz"
|
||||||
|
|
Loading…
Reference in New Issue