Skip to content

Commit

Permalink
Revert "feat: 登录密码加密"
Browse files Browse the repository at this point in the history
This reverts commit 5bd178f.
  • Loading branch information
XieYongHong committed Jul 14, 2023
1 parent 5bd178f commit f7a29fc
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 82 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"jetlinks-store": "^0.0.3",
"jetlinks-ui-components": "^1.0.21",
"js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2",
"less": "^4.1.3",
"less-loader": "^11.1.0",
"lodash-es": "^4.17.21",
Expand Down
7 changes: 0 additions & 7 deletions src/api/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 initApplication = (clientId: string | number) => server.get<{name: string}>(`/application/${clientId}/info`)


/**
* 登录加密信息
* @returns
*/
export const authLoginConfig = () => server.get(`/authorize/login/configs`)
24 changes: 5 additions & 19 deletions src/components/Metadata/ConfigParam/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,18 @@
</template>
<template #content>
<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">
<!-- <template v-if='item.type?.type === "string"'>
<j-form-item v-for="item in config.properties" :name="name.concat([item.property])" :label="item.name">
<template v-if='item.type?.type === "string"'>
<j-input v-model:value='value[item.property]' size="small" :placeholder="`请输入${item.name}`"/>
</template>
<template v-else-if='item.type?.type === "int"'>
<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 }) => ({
<j-select v-else v-model:value="value[item.property]" :options="item.type?.elements?.map((e: { 'text': string, 'value': string }) => ({
label: e.text,
value: e.value,
}))" 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,
}))
"
/>
}))" size="small" :placeholder="`请输入${item.name}`"></j-select>
</j-form-item>
</div>
</template>
{{ config.name || '存储配置' }}
{{ config.name || 存储配置 }}
<AIcon type="EditOutlined" class="item-icon" />
</j-popover>
</j-button>
Expand Down
6 changes: 0 additions & 6 deletions src/components/ValueItem/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<div class="value-item-warp">
<j-select
v-if="typeMap.get(itemType) === 'select'"
:mode="mode"
v-model:value="myValue"
:options="options"
allowClear
Expand Down Expand Up @@ -140,11 +139,6 @@ const props = defineProps({
type: Array as PropType<DefaultOptionType[]>,
default: () => [],
},
// 多选框
mode: {
type: String as PropType<'multiple' | 'tags' | 'combobox' | ''>,
default: ''
}
});
// type Props = {
// itemData?: Object;
Expand Down
7 changes: 0 additions & 7 deletions src/utils/encrypt.ts

This file was deleted.

37 changes: 2 additions & 35 deletions src/views/user/Login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,13 @@ import {
getInitSet,
systemVersion,
bindInfo,
settingDetail, userDetail,
authLoginConfig
settingDetail, userDetail
} from '@/api/login'
import { useUserInfo } from '@/store/userInfo';
import { useSystem } from '@/store/system'
import { LocalStore } from '@/utils/comm';
import { BASE_API_PATH, TOKEN_KEY, Version_Code } from '@/utils/variable';
import { SystemConst } from '@/utils/consts';
import {encrypt} from '@/utils/encrypt'
const store = useUserInfo();
const systemStore = useSystem();
Expand All @@ -201,12 +199,6 @@ const form = reactive({
verifyKey: '',
});
const RsaConfig = reactive<any>({
enabled:false, //是否加密
publicKey:'', //rsa公钥,使用此公钥对密码进行加密
id:'' //密钥ID
})
const rules = {
username: [
{
Expand Down Expand Up @@ -257,14 +249,7 @@ iconMap.set('third-party', getImage('/apply/provider5.png'));
const onFinish = async () => {
try {
loading.value = true;
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);
const res: any = await authLogin(form);
loading.value = false;
if (res.success) {
LocalStore.set(TOKEN_KEY, res?.result.token);
Expand Down Expand Up @@ -298,7 +283,6 @@ const onFinish = async () => {
form.verifyCode = '';
getCode();
loading.value = false;
getRsa()
}
};
Expand Down Expand Up @@ -333,18 +317,6 @@ const getOpen = () => {
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(() => {
return systemStore.configInfo['front'] || {}
})
Expand Down Expand Up @@ -380,11 +352,6 @@ watch(
getOpen();
getCode();
screenRotation(screenWidth.value, screenHeight.value);
onMounted(()=>{
getRsa()
})
</script>

<style scoped lang="less">
Expand Down
3 changes: 1 addition & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ export default defineConfig(({ mode}) => {
[env.VITE_APP_BASE_API]: {
// target: 'http://192.168.32.226:8844',
// 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', // 本地开发环境
ws: 'ws://192.168.33.46:8844',
changeOrigin: true,
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3862,11 +3862,6 @@ jsbn@~0.1.0:
resolved "https://registry.jetlinks.cn/jsbn/-/jsbn-0.1.1.tgz"
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:
version "2.5.2"
resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz"
Expand Down

0 comments on commit f7a29fc

Please sign in to comment.