@@ -393,5 +393,24 @@ export default { | |||||
loseEfficacy: 'lose efficacy', | loseEfficacy: 'lose efficacy', | ||||
restore: 'restore', | restore: 'restore', | ||||
cancel: 'cancel' | cancel: 'cancel' | ||||
}, | |||||
editPass: { | |||||
username: 'user name', | |||||
pass: 'password', | |||||
checkPass: 'Confirm Password' | |||||
}, | |||||
apiManage: { | |||||
add: 'add', | |||||
time: 'Duration (s)', | |||||
viewKey: 'View Key', | |||||
editAccount: 'Modify login account', | |||||
eddAccount: 'Add login account', | |||||
setTime: 'Set duration', | |||||
associationTemp: 'Association template', | |||||
loginAccount: 'Login account', | |||||
username: 'user name', | |||||
name: 'name', | |||||
pass: 'password', | |||||
phone: 'phone', | |||||
} | } | ||||
}; | }; |
@@ -392,5 +392,24 @@ export default { | |||||
loseEfficacy: '失效', | loseEfficacy: '失效', | ||||
restore: '恢复', | restore: '恢复', | ||||
cancel: '作废' | cancel: '作废' | ||||
}, | |||||
editPass: { | |||||
username: '用户名', | |||||
pass: '密码', | |||||
checkPass: '确认密码' | |||||
}, | |||||
apiManage: { | |||||
add: '新增', | |||||
time: '时长(秒)', | |||||
viewKey: '查看密钥', | |||||
editAccount: '修改登录账号', | |||||
eddAccount: '新增登录账号', | |||||
setTime: '设置时长', | |||||
associationTemp: '关联模版', | |||||
loginAccount: '登录账号', | |||||
username: '用户名', | |||||
name: '名称', | |||||
pass: '密码', | |||||
phone: '手机号', | |||||
} | } | ||||
}; | }; |
@@ -1,7 +1,7 @@ | |||||
<template> | <template> | ||||
<div class="page justify-around"> | <div class="page justify-around"> | ||||
<div class="addbtn"> | <div class="addbtn"> | ||||
<el-button type="primary" @click="dialogVisible = true"><el-icon><i-ep-plus /></el-icon> 新增</el-button> | |||||
<el-button type="primary" @click="dialogVisible = true"><el-icon><i-ep-plus /></el-icon> {{$t('apiManage.add')}}</el-button> | |||||
</div> | </div> | ||||
<el-table | <el-table | ||||
@@ -53,7 +53,7 @@ | |||||
</el-table-column> | </el-table-column> | ||||
<el-table-column | <el-table-column | ||||
prop="createTime" | prop="createTime" | ||||
label="时长(秒)" | |||||
:label="$t('apiManage.time')" | |||||
align="center" | align="center" | ||||
> | > | ||||
<template #default="scope"> | <template #default="scope"> | ||||
@@ -73,10 +73,10 @@ | |||||
type="primary" | type="primary" | ||||
size="small" | size="small" | ||||
@click="showDetail(scope.row.id)" | @click="showDetail(scope.row.id)" | ||||
>查看密钥</el-button> | |||||
<el-button link type="primary" size="small" @click="loginAccount(scope.row)">{{ scope.row.mallUserInfo ? '修改登录账号' : '新增登录账号'}}</el-button> | |||||
<el-button link type="primary" size="small" @click="setTime(scope.row.id)">设置时长</el-button> | |||||
<el-button link type="primary" size="small" @click="associationTemp(scope.row.id)">关联模版</el-button> | |||||
>{{$t('apiManage.viewKey')}}</el-button> | |||||
<el-button link type="primary" size="small" @click="loginAccount(scope.row)">{{ scope.row.mallUserInfo ? $t('apiManage.editAccount') : $t('apiManage.eddAccount')}}</el-button> | |||||
<el-button link type="primary" size="small" @click="setTime(scope.row.id)">{{$t('apiManage.setTime')}}</el-button> | |||||
<el-button link type="primary" size="small" @click="associationTemp(scope.row.id)">{{$t('apiManage.associationTemp')}}</el-button> | |||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
</el-table> | </el-table> | ||||
@@ -153,20 +153,20 @@ | |||||
</el-dialog> | </el-dialog> | ||||
<!-- 登录账号 --> | <!-- 登录账号 --> | ||||
<el-dialog v-model="accountDialogVisible" v-if="accountDialogVisible" title="登录账号" width="35%" :before-close="handleClose" > | |||||
<el-dialog v-model="accountDialogVisible" v-if="accountDialogVisible" :title="$t('apiManage.loginAccount')" width="35%" :before-close="handleClose" > | |||||
<el-form ref="ruleForm2" label-position="left" label-width="120px" :model="formData2" :rules="rules2"> | <el-form ref="ruleForm2" label-position="left" label-width="120px" :model="formData2" :rules="rules2"> | ||||
<el-form-item label="用户名" prop="username"> | |||||
<el-form-item :label="$t('apiManage.username')" prop="username"> | |||||
<el-input :disabled="mallUserInfoFlag" v-model="formData2.username" :placeholder="$t('businessMangage.nameInputText')" /> | <el-input :disabled="mallUserInfoFlag" v-model="formData2.username" :placeholder="$t('businessMangage.nameInputText')" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="名称" prop="name" > | |||||
<el-form-item :label="$t('apiManage.name')" prop="name" > | |||||
<el-input v-model="formData2.name" :placeholder="$t('businessMangage.addressInputText')" /> | <el-input v-model="formData2.name" :placeholder="$t('businessMangage.addressInputText')" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="密码" prop="password"> | |||||
<el-form-item :label="$t('apiManage.pass')" prop="password"> | |||||
<el-input v-model="formData2.password" :placeholder="$t('businessMangage.codeInputText')" /> | <el-input v-model="formData2.password" :placeholder="$t('businessMangage.codeInputText')" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="手机号" prop="phone"> | |||||
<el-form-item :label="$t('apiManage.phone')" prop="phone"> | |||||
<el-input v-model="formData2.phone" :placeholder="$t('businessMangage.codeInputText')" /> | <el-input v-model="formData2.phone" :placeholder="$t('businessMangage.codeInputText')" /> | ||||
</el-form-item> | </el-form-item> | ||||
</el-form> | </el-form> | ||||
@@ -181,7 +181,7 @@ | |||||
</span> | </span> | ||||
</template> | </template> | ||||
</el-dialog> | </el-dialog> | ||||
<el-dialog v-model="modelDialogVisible" v-if="modelDialogVisible" title="关联模版" width="60%" :before-close="handleClose" > | |||||
<el-dialog v-model="modelDialogVisible" v-if="modelDialogVisible" :title="$t('apiManage.associationTemp')" width="60%" :before-close="handleClose" > | |||||
<model :serviceId="serviceId" @close="handleClose"></model> | <model :serviceId="serviceId" @close="handleClose"></model> | ||||
</el-dialog> | </el-dialog> | ||||
@@ -2,7 +2,7 @@ | |||||
* @Autor: Chutingting | * @Autor: Chutingting | ||||
* @Date: 2023-11-05 19:03:11 | * @Date: 2023-11-05 19:03:11 | ||||
* @LastEditors: Chutingting | * @LastEditors: Chutingting | ||||
* @LastEditTime: 2023-11-08 16:45:31 | |||||
* @LastEditTime: 2023-11-22 16:53:19 | |||||
* @Description: 修改密码 | * @Description: 修改密码 | ||||
--> | --> | ||||
<template> | <template> | ||||
@@ -15,13 +15,13 @@ | |||||
label-width="120px" | label-width="120px" | ||||
class="editPass" | class="editPass" | ||||
> | > | ||||
<el-form-item label="用户名" prop="pass"> | |||||
<el-form-item :label="$t('editPass.username')" prop="pass"> | |||||
<el-input v-model="ruleForm.userName" disabled autocomplete="off" /> | <el-input v-model="ruleForm.userName" disabled autocomplete="off" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="密码" prop="pass"> | |||||
<el-form-item :label="$t('editPass.pass')" prop="pass"> | |||||
<el-input v-model="ruleForm.pass" type="password" autocomplete="off" /> | <el-input v-model="ruleForm.pass" type="password" autocomplete="off" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="确认密码" prop="checkPass"> | |||||
<el-form-item :label="$t('editPass.checkPass')" prop="checkPass"> | |||||
<el-input | <el-input | ||||
v-model="ruleForm.checkPass" | v-model="ruleForm.checkPass" | ||||
type="password" | type="password" | ||||
@@ -43,6 +43,11 @@ import { updatepwd } from "@/apis/editPass.js"; | |||||
import { logoutApi } from '@/apis/login.js' | import { logoutApi } from '@/apis/login.js' | ||||
import { userInfoModules } from "@/store/modules/userInfo"; | import { userInfoModules } from "@/store/modules/userInfo"; | ||||
import { useRoute, useRouter } from "vue-router"; | import { useRoute, useRouter } from "vue-router"; | ||||
import { useI18n } from "vue-i18n"; | |||||
const { locale } = useI18n(); | |||||
const lanChange = ref(locale); | |||||
const userInfoPinia = userInfoModules(); | const userInfoPinia = userInfoModules(); | ||||
const router = useRouter(); | const router = useRouter(); | ||||
const emit = defineEmits(["close"]); | const emit = defineEmits(["close"]); | ||||
@@ -51,7 +56,7 @@ const ruleFormRef = ref<FormInstance>() | |||||
const validatePass = (rule: any, value: any, callback: any) => { | const validatePass = (rule: any, value: any, callback: any) => { | ||||
if (value === '') { | if (value === '') { | ||||
callback(new Error('请输入密码')) | |||||
callback(new Error(lanChange.value == "zh-cn" ? '请输入密码' : 'Please enter the password')) | |||||
} else { | } else { | ||||
if (ruleForm.checkPass !== '') { | if (ruleForm.checkPass !== '') { | ||||
if (!ruleFormRef.value) return | if (!ruleFormRef.value) return | ||||
@@ -62,9 +67,9 @@ const validatePass = (rule: any, value: any, callback: any) => { | |||||
} | } | ||||
const validatePass2 = (rule: any, value: any, callback: any) => { | const validatePass2 = (rule: any, value: any, callback: any) => { | ||||
if (value === '') { | if (value === '') { | ||||
callback(new Error('请重新输入密码')) | |||||
callback(new Error(lanChange.value == "zh-cn" ? '请重新输入密码' : 'Please re-enter the password')) | |||||
} else if (value !== ruleForm.pass) { | } else if (value !== ruleForm.pass) { | ||||
callback(new Error("两次密码不一致")) | |||||
callback(new Error(lanChange.value == "zh-cn" ? "两次密码不一致" : 'The two passwords do not match')) | |||||
} else { | } else { | ||||
callback() | callback() | ||||
} | } | ||||
@@ -92,7 +97,7 @@ const submitForm = (formEl: FormInstance | undefined) => { | |||||
try { | try { | ||||
const res = await updatepwd(data); | const res = await updatepwd(data); | ||||
if (res.code == 200) { | if (res.code == 200) { | ||||
ElMessage.success("修改成功!"); | |||||
ElMessage.success( lanChange.value == "zh-cn" ? "修改成功!" : 'Modified successfully!'); | |||||
logoutApi().then(d => { | logoutApi().then(d => { | ||||
userInfoPinia.loginOut(); | userInfoPinia.loginOut(); | ||||
router.push(`/login`); | router.push(`/login`); | ||||