无设备处理
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
// 登录
|
|
||||||
export interface LoginData {
|
|
||||||
username: string
|
|
||||||
password?: string
|
|
||||||
imageCode?: string
|
|
||||||
grant_type: string
|
|
||||||
verifyCode?: number
|
|
||||||
refresh_token?: string
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,9 @@ export async function pwdSm3(pwd: any, loginName?: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//登录获取token
|
//登录获取token
|
||||||
export function login(params: LoginData) {
|
export async function login(params: any) {
|
||||||
|
params.password = await pwdSm3(params.password, params.username)
|
||||||
|
params.username = encrypt(params.username)
|
||||||
return request({
|
return request({
|
||||||
url: '/pqs-auth/oauth/token',
|
url: '/pqs-auth/oauth/token',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -86,10 +88,9 @@ export function edit(data: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function passwordConfirm(pwd: string, loginName: string = '') {
|
export async function passwordConfirm(pwd: string) {
|
||||||
console.log(pwd, loginName)
|
|
||||||
return request({
|
return request({
|
||||||
url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd, loginName)),
|
url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd)),
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -126,7 +127,7 @@ export async function updateFirstPassword(params: any) {
|
|||||||
url: '/user-boot/user/updateFirstPassword',
|
url: '/user-boot/user/updateFirstPassword',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: {
|
data: {
|
||||||
name: params.name,
|
name: encrypt(params.name),
|
||||||
password: await pwdSm3(params.password, params.name)
|
password: await pwdSm3(params.password, params.name)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -51,12 +51,16 @@ getDeviceTree().then(res => {
|
|||||||
})
|
})
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
if (arr.length) {
|
||||||
treRef.value.treeRef.setCurrentKey(arr[0].id)
|
treRef.value.treeRef.setCurrentKey(arr[0].id)
|
||||||
// 注册父组件事件
|
// 注册父组件事件
|
||||||
emit('init', {
|
emit('init', {
|
||||||
level: 2,
|
level: 2,
|
||||||
...arr[0]
|
...arr[0]
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
emit('init')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const handleCheckChange = (data: any, checked: any, indeterminate: any) => {
|
const handleCheckChange = (data: any, checked: any, indeterminate: any) => {
|
||||||
|
|||||||
@@ -37,12 +37,16 @@ getLineTree().then(res => {
|
|||||||
})
|
})
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
if (arr.length) {
|
||||||
treRef.value.treeRef.setCurrentKey(arr[0].id)
|
treRef.value.treeRef.setCurrentKey(arr[0].id)
|
||||||
// 注册父组件事件
|
// 注册父组件事件
|
||||||
emit('init', {
|
emit('init', {
|
||||||
level: 2,
|
level: 2,
|
||||||
...arr[0]
|
...arr[0]
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
emit('init')
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog class='cn-operate-dialog' v-model='dialogVisible' :title='title'>
|
<el-dialog class="cn-operate-dialog" v-model="dialogVisible" :title="title">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline='false' :model='form' label-width='120px' :rules='rules' ref='formRef'>
|
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||||
<el-form-item label='校验密码:' prop='password'>
|
<el-form-item label="校验密码:" prop="password">
|
||||||
<el-input v-model='form.password' type='password' placeholder='请输入校验密码' show-password />
|
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='新密码:' prop='newPwd' style='margin-top: 20px'>
|
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
||||||
<el-input v-model='form.newPwd' type='password' placeholder='请输入新密码' show-password />
|
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='确认密码:' prop='confirmPwd' style='margin-top: 20px'>
|
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
||||||
<el-input v-model='form.confirmPwd' type='password' placeholder='请输入确认密码' show-password />
|
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class='dialog-footer'>
|
<span class="dialog-footer">
|
||||||
<el-button @click='dialogVisible = false'>取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type='primary' @click='submit'>确认</el-button>
|
<el-button type="primary" @click="submit">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang='ts' setup>
|
<script lang="ts" setup>
|
||||||
import { ref, inject } from 'vue'
|
import { ref, inject } from 'vue'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
@@ -85,12 +85,14 @@ const rules = {
|
|||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
form.password = ''
|
||||||
|
form.newPwd = ''
|
||||||
|
form.confirmPwd = ''
|
||||||
}
|
}
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
passwordConfirm(form.password)
|
passwordConfirm(form.password).then(res => {
|
||||||
.then(res => {
|
|
||||||
updatePassword({
|
updatePassword({
|
||||||
id: adminInfo.$state.userIndex,
|
id: adminInfo.$state.userIndex,
|
||||||
newPassword: form.newPwd
|
newPassword: form.newPwd
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='default-main'>
|
<div class="default-main">
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label='用户状态'>
|
<el-form-item label="用户状态">
|
||||||
<el-select v-model='tableStore.table.params.searchState' placeholder='选择用户状态'>
|
<el-select v-model="tableStore.table.params.searchState" placeholder="选择用户状态">
|
||||||
<el-option
|
<el-option
|
||||||
v-for='(item, index) in userState'
|
v-for="(item, index) in userState"
|
||||||
:label='item.label'
|
:label="item.label"
|
||||||
:key='index'
|
:key="index"
|
||||||
:value='item.value'
|
:value="item.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='用户类型:'>
|
<el-form-item label="用户类型:">
|
||||||
<el-select v-model='tableStore.table.params.casualUser' placeholder='选择用户类型'>
|
<el-select v-model="tableStore.table.params.casualUser" placeholder="选择用户类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for='(item, index) in casualUser'
|
v-for="(item, index) in casualUser"
|
||||||
:label='item.label'
|
:label="item.label"
|
||||||
:key='index'
|
:key="index"
|
||||||
:value='item.value'
|
:value="item.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='关键词:'>
|
<el-form-item label="关键词:">
|
||||||
<el-input
|
<el-input
|
||||||
style='width: 240px'
|
style="width: 240px"
|
||||||
v-model='tableStore.table.params.searchValue'
|
v-model="tableStore.table.params.searchValue"
|
||||||
clearable
|
clearable
|
||||||
placeholder='仅根据用户名/登录名'
|
placeholder="仅根据用户名/登录名"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
<el-button :icon="Plus" type="primary" @click="addUser">添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref='tableRef' />
|
<Table ref="tableRef" />
|
||||||
<PopupEdit ref='popupEditRef'></PopupEdit>
|
<PopupEdit ref="popupEditRef"></PopupEdit>
|
||||||
<PopupPwd ref='popupPwdRef'></PopupPwd>
|
<PopupPwd ref="popupPwdRef"></PopupPwd>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import { ref, onMounted, provide } from 'vue'
|
import { ref, onMounted, provide } from 'vue'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||||
@@ -119,7 +119,15 @@ const tableStore = new TableStore({
|
|||||||
return row.state !== 1
|
return row.state !== 1
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
popupPwdRef.value.open(row.id, row.loginName)
|
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
inputType: 'password'
|
||||||
|
}).then(({ value }) => {
|
||||||
|
passwordConfirm(value).then(res => {
|
||||||
|
popupPwdRef.value.open(row.id)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -154,8 +162,7 @@ const tableStore = new TableStore({
|
|||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
inputType: 'password'
|
inputType: 'password'
|
||||||
})
|
}).then(({ value }) => {
|
||||||
.then(({ value }) => {
|
|
||||||
passwordConfirm(value).then(res => {
|
passwordConfirm(value).then(res => {
|
||||||
deluser({
|
deluser({
|
||||||
id: row.id
|
id: row.id
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
<el-dialog class="cn-operate-dialog" v-model="dialogVisible" title="修改密码">
|
<el-dialog class="cn-operate-dialog" v-model="dialogVisible" title="修改密码">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||||
<el-form-item label="校验密码" prop="password">
|
|
||||||
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="新密码" prop="newPwd">
|
<el-form-item label="新密码" prop="newPwd">
|
||||||
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -29,26 +26,17 @@ import TableStore from '@/utils/tableStore'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { validatePwd } from '@/utils/common'
|
import { validatePwd } from '@/utils/common'
|
||||||
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
||||||
|
import { debug } from 'console'
|
||||||
|
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const tableStore = inject('tableStore') as TableStore
|
const tableStore = inject('tableStore') as TableStore
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
password: '',
|
|
||||||
newPwd: '',
|
newPwd: '',
|
||||||
confirmPwd: '',
|
confirmPwd: '',
|
||||||
loginName: ''
|
loginName: ''
|
||||||
})
|
})
|
||||||
const rules = {
|
const rules = {
|
||||||
password: [
|
|
||||||
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
min: 6,
|
|
||||||
max: 16,
|
|
||||||
message: '长度在 6 到 16 个字符',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
newPwd: [
|
newPwd: [
|
||||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||||
{
|
{
|
||||||
@@ -87,7 +75,6 @@ const title = ref('新增菜单')
|
|||||||
const open = (id: string, loginName: string) => {
|
const open = (id: string, loginName: string) => {
|
||||||
form.id = id
|
form.id = id
|
||||||
form.loginName = loginName
|
form.loginName = loginName
|
||||||
form.password = ''
|
|
||||||
form.newPwd = ''
|
form.newPwd = ''
|
||||||
form.confirmPwd = ''
|
form.confirmPwd = ''
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@@ -95,7 +82,6 @@ const open = (id: string,loginName: string) => {
|
|||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
formRef.value.validate((valid: boolean) => {
|
formRef.value.validate((valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
passwordConfirm(form.password, form.loginName).then((res: any) => {
|
|
||||||
updatePassword({
|
updatePassword({
|
||||||
id: form.id,
|
id: form.id,
|
||||||
newPassword: form.newPwd
|
newPassword: form.newPwd
|
||||||
@@ -103,7 +89,6 @@ const submit = async () => {
|
|||||||
ElMessage.success('密码修改成功')
|
ElMessage.success('密码修改成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main analyze-apf" :style="{ height: pageHeight.height }" v-loading="loading">
|
<div class="default-main analyze-apf" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||||
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
||||||
<div class="analyze-apf-right">
|
<div class="analyze-apf-right" v-if="formInline.devId">
|
||||||
<el-form :inline="true">
|
<el-form :inline="true">
|
||||||
<el-form-item label="统计指标:">
|
<el-form-item label="统计指标:">
|
||||||
<el-select v-model="formInline.statisticalId" filterable placeholder="请选择">
|
<el-select v-model="formInline.statisticalId" filterable placeholder="请选择">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<el-button type="primary" @click="search" icon="el-icon-Search">查询</el-button>
|
<el-button type="primary" @click="search" icon="el-icon-Search">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div style="display: flex;align-items: center;">
|
<div style="display: flex; align-items: center">
|
||||||
<Icon name="el-icon-InfoFilled" style="color: #ff9912"></Icon>
|
<Icon name="el-icon-InfoFilled" style="color: #ff9912"></Icon>
|
||||||
总输出电流阈值和总输出电流比较
|
总输出电流阈值和总输出电流比较
|
||||||
</div>
|
</div>
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
<MyEchart :options="echartsData" style="flex: 1" />
|
<MyEchart :options="echartsData" style="flex: 1" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<el-empty v-else description="请选择设备" class="analyze-apf-right" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<div class="analyze-dvr" v-show="view" :style="{ height: pageHeight.height }" v-loading="loading">
|
<div class="analyze-dvr" v-show="view" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||||
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
<DeviceTree @node-click="nodeClick" @init="nodeClick"></DeviceTree>
|
||||||
<div class="analyze-dvr-right">
|
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
|
||||||
<Table v-if="view" ref="tableRef"></Table>
|
<Table v-if="view" ref="tableRef"></Table>
|
||||||
</div>
|
</div>
|
||||||
|
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
|
||||||
</div>
|
</div>
|
||||||
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
<div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|||||||
@@ -130,6 +130,7 @@
|
|||||||
></el-pagination>
|
></el-pagination>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
<el-empty v-else description="请选择设备" class="device-control-right" />
|
||||||
<Popup ref="popupRef" />
|
<Popup ref="popupRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -188,6 +189,10 @@ const handleSizeChange = (val: number) => {
|
|||||||
handleClick()
|
handleClick()
|
||||||
}
|
}
|
||||||
const nodeClick = (e: anyObj) => {
|
const nodeClick = (e: anyObj) => {
|
||||||
|
if (!e) {
|
||||||
|
loading.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
if (e.level == 3) {
|
if (e.level == 3) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getDeviceData(e.pid, 'history', e.id).then((res: any) => {
|
getDeviceData(e.pid, 'history', e.id).then((res: any) => {
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
<el-empty v-else description="请选择设备" class="device-manage-right" />
|
||||||
<MangePopup ref="mangePopup" />
|
<MangePopup ref="mangePopup" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -85,6 +86,10 @@ const tableData = ref([])
|
|||||||
const tableHeight = mainHeight(215).height
|
const tableHeight = mainHeight(215).height
|
||||||
const mangePopup = ref()
|
const mangePopup = ref()
|
||||||
const nodeClick = (e: anyObj) => {
|
const nodeClick = (e: anyObj) => {
|
||||||
|
if (!e) {
|
||||||
|
loading.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
if (e.level == 2) {
|
if (e.level == 2) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
getDeviceData(e.id, 'rt').then((res: any) => {
|
getDeviceData(e.id, 'rt').then((res: any) => {
|
||||||
|
|||||||
@@ -66,8 +66,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onBeforeUnmount, reactive, ref, nextTick } from 'vue'
|
import { onMounted, onBeforeUnmount, reactive, ref, nextTick } from 'vue'
|
||||||
import * as pageBubble from '@/utils/pageBubble'
|
import * as pageBubble from '@/utils/pageBubble'
|
||||||
import { sm3Digest } from '@/assets/commjs/sm3.js'
|
|
||||||
import { sm2, encrypt } from '@/assets/commjs/sm2.js'
|
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { gongkey, login } from '@/api/user-boot/user'
|
import { gongkey, login } from '@/api/user-boot/user'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
@@ -76,6 +74,7 @@ import { useRouter } from 'vue-router'
|
|||||||
import { ADMIN_INFO } from '@/stores/constant/cacheKey'
|
import { ADMIN_INFO } from '@/stores/constant/cacheKey'
|
||||||
import { Local } from '@/utils/storage'
|
import { Local } from '@/utils/storage'
|
||||||
import PopupUpdatePwd from './popupUpdatePwd.vue'
|
import PopupUpdatePwd from './popupUpdatePwd.vue'
|
||||||
|
import { encrypt } from '@/assets/commjs/sm2.js';
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
let timer: number
|
let timer: number
|
||||||
@@ -131,19 +130,14 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||||||
await formEl.validate((valid, fields) => {
|
await formEl.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
state.submitLoading = true
|
state.submitLoading = true
|
||||||
const loginName = encrypt(form.username)
|
|
||||||
gongkey({ loginName }).then(res => {
|
|
||||||
window.localStorage.setItem('publicKey', res.data)
|
|
||||||
let jiamipassword = sm2(sm3Digest(form.password) + '|' + form.password, res.data, 0)
|
|
||||||
login({
|
login({
|
||||||
username: loginName,
|
username: form.username,
|
||||||
password: jiamipassword,
|
password: form.password,
|
||||||
grant_type: 'captcha',
|
grant_type: 'captcha',
|
||||||
imageCode: '',
|
imageCode: '',
|
||||||
verifyCode: 0
|
verifyCode: 0
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
res.data.loginName = loginName
|
|
||||||
userInfo.dataFill(res.data)
|
userInfo.dataFill(res.data)
|
||||||
state.submitLoading = false
|
state.submitLoading = false
|
||||||
router.push({
|
router.push({
|
||||||
@@ -151,11 +145,10 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
if (err.code === 'A0101') {
|
if (err.code === 'A0101' && err.message === '登录认证,密码失效,请重置') {
|
||||||
popupUpdatePwdRef.value.open(loginName)
|
popupUpdatePwdRef.value.open(form.username)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
state.submitLoading = false
|
state.submitLoading = false
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import { validatePwd } from '@/utils/common'
|
|||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const router = useRouter()
|
|
||||||
const adminInfo = useAdminInfo()
|
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const title = ref('修改默认密码')
|
const title = ref('修改默认密码')
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
|
|||||||
Reference in New Issue
Block a user