market_api_916
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
VUE_APP_NAME=Ele Admin
|
||||
VUE_APP_NAME=Market
|
||||
VUE_APP_API_BASE_URL=https://v2.eleadmin.com/api
|
||||
|
||||
@@ -5,7 +5,7 @@ import { setToken } from '@/utils/token-util';
|
||||
* 登录
|
||||
*/
|
||||
export async function login(data) {
|
||||
data.tenantId = 1; // 租户id
|
||||
//data.tenantId = 1; // 租户id
|
||||
const res = await request.post('/login', data);
|
||||
if (res.data.code === 0) {
|
||||
setToken(res.data.data.access_token, data.remember);
|
||||
|
||||
@@ -5,7 +5,7 @@ import request from '@/utils/request';
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function pageLoginRecords(params) {
|
||||
const res = await request.get('/system/login-record/page', {
|
||||
const res = await request.get('/system/loginRecord/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
@@ -19,7 +19,7 @@ export async function pageLoginRecords(params) {
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function listLoginRecords(params) {
|
||||
const res = await request.get('/system/login-record', {
|
||||
const res = await request.get('/system/loginRecord', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import request from '@/utils/request';
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function pageOperationRecords(params) {
|
||||
const res = await request.get('/system/operation-record/page', {
|
||||
const res = await request.get('/system/operationRecord/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
@@ -19,7 +19,7 @@ export async function pageOperationRecords(params) {
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function listOperationRecords(params) {
|
||||
const res = await request.get('/system/operation-record', {
|
||||
const res = await request.get('/system/operationRecord', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
|
||||
@@ -83,7 +83,7 @@ export async function removeRoles(data) {
|
||||
* @param roleId 角色id
|
||||
*/
|
||||
export async function listRoleMenus(roleId) {
|
||||
const res = await request.get('/system/role-menu/' + roleId);
|
||||
const res = await request.get('/system/roleMenu/' + roleId);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ export async function listRoleMenus(roleId) {
|
||||
* @param data 菜单id集合
|
||||
*/
|
||||
export async function updateRoleMenus(roleId, data) {
|
||||
const res = await request.put('/system/role-menu/' + roleId, data);
|
||||
const res = await request.put('/system/roleMenu/' + roleId, data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// 接口地址
|
||||
export const API_BASE_URL = process.env.VUE_APP_API_BASE_URL;
|
||||
//export const API_BASE_URL = process.env.VUE_APP_API_BASE_URL;
|
||||
export const API_BASE_URL = 'http://market.dev.liche.cn/api';
|
||||
|
||||
// 项目名称
|
||||
export const PROJECT_NAME = process.env.VUE_APP_NAME;
|
||||
|
||||
+11
-14
@@ -47,6 +47,11 @@
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-input
|
||||
v-show="false"
|
||||
v-model="form.code_key"
|
||||
prefix-icon="el-icon-user"
|
||||
/>
|
||||
<div class="el-form-item">
|
||||
<el-checkbox v-model="form.remember">
|
||||
{{ $t('login.remember') }}
|
||||
@@ -123,15 +128,14 @@
|
||||
loading: false,
|
||||
// 表单数据
|
||||
form: {
|
||||
username: 'admin',
|
||||
password: 'admin',
|
||||
username: '',
|
||||
password: '',
|
||||
remember: true,
|
||||
code: ''
|
||||
code: '',
|
||||
code_key: ''
|
||||
},
|
||||
// 验证码base64数据
|
||||
captcha: '',
|
||||
// 验证码内容, 实际项目去掉
|
||||
text: ''
|
||||
captcha: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -171,10 +175,6 @@
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if (this.form.code.toLowerCase() !== this.text) {
|
||||
this.$message.error('验证码错误');
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
login(this.form)
|
||||
.then((msg) => {
|
||||
@@ -198,10 +198,7 @@
|
||||
getCaptcha()
|
||||
.then((data) => {
|
||||
this.captcha = data.base64;
|
||||
// 实际项目后端一般会返回验证码的key而不是直接返回验证码的内容, 登录用key去验证, 可以根据自己后端接口修改
|
||||
this.text = data.text;
|
||||
// 自动回填验证码, 实际项目去掉这个
|
||||
this.form.code = this.text;
|
||||
this.form.code_key = data.code_key;
|
||||
this.$refs?.form?.clearValidate();
|
||||
})
|
||||
.catch((e) => {
|
||||
|
||||
Reference in New Issue
Block a user