From 9a7e10064a9a84d5f58882793c983ce2159a14ba Mon Sep 17 00:00:00 2001 From: yanzai Date: Fri, 13 Dec 2024 10:25:30 +0800 Subject: [PATCH] =?UTF-8?q?admin=E9=A6=96=E9=A1=B5=20=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/Admin/LoginController.php | 32 +++++++++++++++++++ el-admin/.env.production | 4 +-- el-admin/package-lock.json | 6 ++++ el-admin/package.json | 1 + el-admin/src/views/Login.vue | 30 +++++++++++++++-- .../src/views/MedicalCenter/Dashboard.vue | 8 ++++- 6 files changed, 75 insertions(+), 6 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/LoginController.php b/Laravel/app/Http/Controllers/API/Admin/LoginController.php index 89ff60b..f496f21 100644 --- a/Laravel/app/Http/Controllers/API/Admin/LoginController.php +++ b/Laravel/app/Http/Controllers/API/Admin/LoginController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\API\Admin; use App\Http\Controllers\Controller; use App\Services\Login\LoginService; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Crypt; use Yz; use App\Lib\HSM; use App\Lib\XTSign; @@ -17,6 +18,37 @@ class LoginController extends Controller //$login= new LoginService(); return Yz::echo($login->Login(['username'=>$username,'password'=>$password])); } + function de_hunxiao($str) + { + $decodedString = base64_decode($str); + + // 第二步:移除固定的前缀和后缀 + $strippedString = str_replace('a5331_', '', $decodedString); + $strippedString = str_replace('_a454d', '', $strippedString); + + // 第三步:反转字符串以恢复原始顺序 + $reversedString = strrev($strippedString); + + // 第四步:字符替换(包括字母和数字) + $charMap = [ + 'z' => 'a', 'y' => 'b', 'x' => 'c', 'w' => 'd', 'v' => 'e', + 'u' => 'f', 't' => 'g', 's' => 'h', 'r' => 'i', 'q' => 'j', + 'p' => 'k', 'o' => 'l', 'n' => 'm', 'm' => 'n', 'l' => 'o', + 'k' => 'p', 'j' => 'q', 'i' => 'r', 'h' => 's', 'g' => 't', + 'f' => 'u', 'e' => 'v', 'd' => 'w', 'c' => 'x', 'b' => 'y', + 'a' => 'z', + '@' => '0', '!' => '1', '#' => '2', '$' => '3', '%' => '4', + '^' => '5', '&' => '6', '*' => '7', '(' => '8', ')' => '9' + ]; + $originalString = ''; + for ($i = 0; $i < strlen($reversedString); $i++) { + $char = $reversedString[$i]; + $originalString .= isset($charMap[$char]) ? $charMap[$char] : $char; + } + + // 输出解码后的字符串 + return $originalString; + } public function test(){ //加密解密测试 // dd( HSM::HsmDecrypt("9bef05d29d91d1058b742261638b8d1c")); diff --git a/el-admin/.env.production b/el-admin/.env.production index a8603bf..d476a58 100644 --- a/el-admin/.env.production +++ b/el-admin/.env.production @@ -1,6 +1,6 @@ ENV = 'production' -VITE_APP_API_6666 = 'http://192.168.50.123:33583/common/la/public/api/' -VITE_APP_FILE_6666 = 'http://192.168.50.123:33583/common/la/public' +VITE_APP_API_6666666 = 'http://192.168.50.123:33583/common/la/public/api/' +VITE_APP_FILE_66666666 = 'http://192.168.50.123:33583/common/la/public' VITE_APP_API = 'http://172.31.68.39:33583/common/la/public/api/' VITE_APP_FILE = 'http://172.31.68.39:33583/common/la/public' \ No newline at end of file diff --git a/el-admin/package-lock.json b/el-admin/package-lock.json index c2d3307..a77e69e 100644 --- a/el-admin/package-lock.json +++ b/el-admin/package-lock.json @@ -11,6 +11,7 @@ "@element-plus/icons-vue": "^2.1.0", "@vueuse/core": "^10.4.1", "axios": "^1.5.1", + "crypto-js": "^4.2.0", "echarts": "^5.4.3", "element-plus": "^2.3.14", "pinia": "^2.1.6", @@ -1083,6 +1084,11 @@ "node": ">= 8" } }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", diff --git a/el-admin/package.json b/el-admin/package.json index a35e531..2fec1f3 100644 --- a/el-admin/package.json +++ b/el-admin/package.json @@ -13,6 +13,7 @@ "@element-plus/icons-vue": "^2.1.0", "@vueuse/core": "^10.4.1", "axios": "^1.5.1", + "crypto-js": "^4.2.0", "echarts": "^5.4.3", "element-plus": "^2.3.14", "pinia": "^2.1.6", diff --git a/el-admin/src/views/Login.vue b/el-admin/src/views/Login.vue index a914b28..de15c27 100644 --- a/el-admin/src/views/Login.vue +++ b/el-admin/src/views/Login.vue @@ -108,7 +108,7 @@ import { useDark } from "@vueuse/core"; - +import CryptoJS from 'crypto-js'; const erweima_loading=ref(false) const UseErweima=ref(false) //是否使用二维码 @@ -118,12 +118,36 @@ let username = ref('') let pwd = ref('') - + const hunxiao=(str)=>{ + let originalString =str + var charMap = { + 'a': 'z', 'b': 'y', 'c': 'x', 'd': 'w', 'e': 'v', + 'f': 'u', 'g': 't', 'h': 's', 'i': 'r', 'j': 'q', + 'k': 'p', 'l': 'o', 'm': 'n', 'n': 'm', 'o': 'l', + 'p': 'k', 'q': 'j', 'r': 'i', 's': 'h', 't': 'g', + 'u': 'f', 'v': 'e', 'w': 'd', 'x': 'c', 'y': 'b', + 'z': 'a', + '0': '@', '1': '!', '2': '#', '3': '$', '4': '%', + '5': '^', '6': '&', '7': '*', '8': '(', '9': ')' + }; + var mappedString = originalString.split('').map(char => charMap[char] || char).join(''); + + // 第二步:反转字符串 + var reversedString = mappedString.split('').reverse().join(''); + + // 第三步:添加固定前缀和后缀 + var prefixedSuffixString = 'a5331_' + reversedString + '_a454d'; + + // 第四步:使用 btoa 函数执行 Base64 编码 + var encodedString = btoa(prefixedSuffixString); + return encodedString; + } let login = () => { //登录 if (username.value == '' || pwd.value == '') return ElMessage.error('用户名和密码不能为空') + let data = { //传参 username: username.value, - password: pwd.value, + password:pwd.value , } //调用登录接口 Login(data).then(res => { diff --git a/el-admin/src/views/MedicalCenter/Dashboard.vue b/el-admin/src/views/MedicalCenter/Dashboard.vue index 5498b2e..3b9ef65 100644 --- a/el-admin/src/views/MedicalCenter/Dashboard.vue +++ b/el-admin/src/views/MedicalCenter/Dashboard.vue @@ -139,7 +139,13 @@ let month_list=[]; let count_list=[]; resdata.list.forEach((v,i)=>{ - month_list.push(v.month.substr(6,8)+'月') + let month = v.month.slice(5); // 截取从索引5开始到末尾的字符串 + + // 去掉前导零 + if (month.startsWith('0')) { + month = month.slice(1); + } + month_list.push(month+'月') count_list.push(v.count) }) var JiGouCountByMonth = echarts.init(document.getElementById('JiGouCountByMonth'));