up login MD5 encrypt

This commit is contained in:
sc 2021-07-20 11:06:03 +08:00
parent 34335676d4
commit 5e58639a0d
3 changed files with 16 additions and 8 deletions

View File

@ -23,15 +23,15 @@ const api = {
login: { login: {
url: `${config.API_URL}/login`, url: `${config.API_URL}/login`,
name: "登录获取用户菜单和权限,全部权限", name: "登录获取用户菜单和权限,全部权限",
get: async function(){ get: async function(params={}){
return await http.get(this.url); return await http.get(this.url, params);
} }
}, },
login_demo: { login_demo: {
url: `${config.API_URL}/login_user`, url: `${config.API_URL}/login_user`,
name: "登录获取用户菜单和权限,部分权限", name: "登录获取用户菜单和权限,部分权限",
get: async function(){ get: async function(params={}){
return await http.get(this.url); return await http.get(this.url, params);
} }
}, },
list: { list: {

View File

@ -1,8 +1,8 @@
/* /*
* @Descripttion: 工具集 * @Descripttion: 工具集
* @version: 1.0 * @version: 1.1
* @LastEditors: sakuya * @LastEditors: sakuya
* @LastEditTime: 20216月28日19:13:13 * @LastEditTime: 20217月20日10:58:41
*/ */
import CryptoJS from 'crypto-js'; import CryptoJS from 'crypto-js';

View File

@ -170,7 +170,11 @@
}, },
login: async function() { login: async function() {
this.islogin = true; this.islogin = true;
var userInfo = await this.$API.user.login.get(); var data = {
user: this.$TOOL.crypto.MD5(this.ruleForm.user),
password: this.$TOOL.crypto.MD5(this.ruleForm.password)
}
var userInfo = await this.$API.user.login.get(data);
this.$TOOL.data.set("user", userInfo.data); this.$TOOL.data.set("user", userInfo.data);
this.$router.replace({ this.$router.replace({
path: '/' path: '/'
@ -180,7 +184,11 @@
}, },
login_demo: async function() { login_demo: async function() {
this.islogin = true; this.islogin = true;
var userInfo = await this.$API.user.login_demo.get(); var data = {
user: this.$TOOL.crypto.MD5(this.ruleForm.user),
password: this.$TOOL.crypto.MD5(this.ruleForm.password)
}
var userInfo = await this.$API.user.login_demo.get(data);
this.$TOOL.data.set("user", userInfo.data); this.$TOOL.data.set("user", userInfo.data);
this.$router.replace({ this.$router.replace({
path: '/' path: '/'