|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-form size="large" class="login-content-form" :model="state.ruleForm" :rules="state.rules">
|
|
<el-form size="large" class="login-content-form" :model="state.ruleForm" :rules="state.rules">
|
|
|
<el-form-item class="login-animation1" prop="name">
|
|
<el-form-item class="login-animation1" prop="name">
|
|
|
- <el-input text :placeholder="$t('message.account.accountPlaceholder1')"
|
|
|
|
|
|
|
+ <el-input text placeholder="请输入手机号、邮箱登录"
|
|
|
v-model="state.ruleForm.name" clearable autocomplete="off">
|
|
v-model="state.ruleForm.name" clearable autocomplete="off">
|
|
|
<template #prefix>
|
|
<template #prefix>
|
|
|
<el-icon class="el-input__icon">
|
|
<el-icon class="el-input__icon">
|
|
@@ -12,7 +12,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item class="login-animation2" prop="pwd">
|
|
<el-form-item class="login-animation2" prop="pwd">
|
|
|
<el-input
|
|
<el-input
|
|
|
- :type="state.isShowPassword ? 'text' : 'password'"
|
|
|
|
|
|
|
+ type="password"
|
|
|
:placeholder="$t('message.account.accountPlaceholder2')"
|
|
:placeholder="$t('message.account.accountPlaceholder2')"
|
|
|
v-model="state.ruleForm.pwd"
|
|
v-model="state.ruleForm.pwd"
|
|
|
autocomplete="off"
|
|
autocomplete="off"
|
|
@@ -22,39 +22,16 @@
|
|
|
<ele-Unlock/>
|
|
<ele-Unlock/>
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #suffix>
|
|
|
|
|
|
|
+<!-- <template #suffix>
|
|
|
<i
|
|
<i
|
|
|
class="iconfont el-input__icon login-content-password"
|
|
class="iconfont el-input__icon login-content-password"
|
|
|
:class="state.isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
|
|
:class="state.isShowPassword ? 'icon-yincangmima' : 'icon-xianshimima'"
|
|
|
@click="state.isShowPassword = !state.isShowPassword"
|
|
@click="state.isShowPassword = !state.isShowPassword"
|
|
|
>
|
|
>
|
|
|
</i>
|
|
</i>
|
|
|
- </template>
|
|
|
|
|
|
|
+ </template>-->
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item class="login-animation3" prop="code">
|
|
|
|
|
- <el-col :span="15">
|
|
|
|
|
- <el-input
|
|
|
|
|
- text
|
|
|
|
|
- maxlength="4"
|
|
|
|
|
- :placeholder="$t('message.account.accountPlaceholder3')"
|
|
|
|
|
- v-model="state.ruleForm.code"
|
|
|
|
|
- clearable
|
|
|
|
|
- autocomplete="off"
|
|
|
|
|
- >
|
|
|
|
|
- <template #prefix>
|
|
|
|
|
- <el-icon class="el-input__icon">
|
|
|
|
|
- <ele-Position/>
|
|
|
|
|
- </el-icon>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-input>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="1"></el-col>
|
|
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <img @click="reloadVerifyCode" :src="state.verifySrc"/>
|
|
|
|
|
- <!-- <el-button class="login-content-code" v-waves>1234</el-button>-->
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
<el-form-item class="login-animation4">
|
|
<el-form-item class="login-animation4">
|
|
|
<el-button type="primary" class="login-content-submit" round v-waves @click="onSignIn" :loading="state.loading.signIn">
|
|
<el-button type="primary" class="login-content-submit" round v-waves @click="onSignIn" :loading="state.loading.signIn">
|
|
|
<span>{{ $t('message.account.accountBtnText') }}</span>
|
|
<span>{{ $t('message.account.accountBtnText') }}</span>
|
|
@@ -115,17 +92,11 @@ const currentTime = computed(() => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- reloadVerifyCode();
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const reloadVerifyCode = () => {
|
|
|
|
|
- $get("/user/loginVerifyCodeSign").then((res: any) => {
|
|
|
|
|
- state.ruleForm.sign = res;
|
|
|
|
|
- state.verifySrc = import.meta.env.VITE_API_URL + "user/loginVerifyCode?sign=" + res + "&r=" + Math.random();
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
const handleForgetPassword = () => {
|
|
const handleForgetPassword = () => {
|
|
|
|
|
+ // Message.alert(`请联系管理员400-1234567`)
|
|
|
//forgetPasswordRef.open();
|
|
//forgetPasswordRef.open();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -143,7 +114,7 @@ const initData = () => {
|
|
|
Session.set("dicts", res);
|
|
Session.set("dicts", res);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- $get("/user/profile").then((obj: any) => {
|
|
|
|
|
|
|
+ $get("/admin-user/profile").then((obj: any) => {
|
|
|
if (obj) {
|
|
if (obj) {
|
|
|
let {user, permissionList} = obj;
|
|
let {user, permissionList} = obj;
|
|
|
let userInfo = {...user, permList: permissionList}
|
|
let userInfo = {...user, permList: permissionList}
|
|
@@ -162,14 +133,13 @@ const initData = () => {
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
ElMessage.error("登录状态失效,请重新登录管理控制台");
|
|
ElMessage.error("登录状态失效,请重新登录管理控制台");
|
|
|
Session.clear();
|
|
Session.clear();
|
|
|
- reloadVerifyCode();
|
|
|
|
|
state.loading.signIn = false;
|
|
state.loading.signIn = false;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const refreshLogin = () => {
|
|
const refreshLogin = () => {
|
|
|
setInterval(() => {
|
|
setInterval(() => {
|
|
|
- $get(`user/refresh`);
|
|
|
|
|
|
|
+ $get(`admin-user/refresh`);
|
|
|
}, 1600 * 1000)
|
|
}, 1600 * 1000)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -177,10 +147,11 @@ const refreshLogin = () => {
|
|
|
const onSignIn = async () => {
|
|
const onSignIn = async () => {
|
|
|
state.loading.signIn = true;
|
|
state.loading.signIn = true;
|
|
|
let temp = {
|
|
let temp = {
|
|
|
- userName:state.ruleForm.name,
|
|
|
|
|
- pwd:encryptData(state.ruleForm.pwd)
|
|
|
|
|
|
|
+ mobilePhone:state.ruleForm.name,
|
|
|
|
|
+ password:encryptData(state.ruleForm.pwd)
|
|
|
}
|
|
}
|
|
|
- $body(`/user/login?sign=${state.ruleForm.sign}&code=${state.ruleForm.code}`, temp).then((res: any) => {
|
|
|
|
|
|
|
+ $body(`/admin-user/login`, temp).then((res: any) => {
|
|
|
|
|
+ let {id,satoken} = res;
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
if (res.token) {
|
|
if (res.token) {
|
|
|
// 存储 token 到浏览器缓存
|
|
// 存储 token 到浏览器缓存
|
|
@@ -210,7 +181,6 @@ const onSignIn = async () => {
|
|
|
}).catch(e => {
|
|
}).catch(e => {
|
|
|
state.loading.signIn = false;
|
|
state.loading.signIn = false;
|
|
|
console.error(e)
|
|
console.error(e)
|
|
|
- reloadVerifyCode();
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|