This commit is contained in:
yannqing 2024-01-19 02:08:29 +08:00
parent ba97ff11fc
commit 4e7fed412b
2 changed files with 13 additions and 14 deletions

View File

@ -12,7 +12,7 @@
</svg> </svg>
用户名 用户名
</label> </label>
<input type="email" id="email" v-model="data.userNum" class="mt-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required> <input type="email" id="email" v-model="data.user" class="mt-2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" required>
</div> </div>
<div class="mb-5"> <div class="mb-5">
<label for="password" class="flex items-center space-x-4 mb-2 text-sm font-medium text-gray-900 dark:text-white"> <label for="password" class="flex items-center space-x-4 mb-2 text-sm font-medium text-gray-900 dark:text-white">
@ -57,30 +57,31 @@ import axios from 'axios';
import getCurrentTimestamp from '../public/methods.js'; import getCurrentTimestamp from '../public/methods.js';
const data = { const data = {
userNum: '', user: '',
password: '' password: ''
} }
function loginUser(){ function loginUser(){
axios({ axios({
url: "api/user/login", url: "http://nbxt.oa.x-lf.cn/auth/login",
method: "post", method: "get",
data: { data: data,
"userNum": data.userNum,
"password": data.password
},
headers: { headers: {
'content-type': 'application/json;charset=utf-8', 'content-type': 'application/json;charset=utf-8',
'Timestamp':getCurrentTimestamp() 'Timestamp': getCurrentTimestamp()
}, },
}).then((res) => { }).then((res) => {
console.log(res)
if (res.data.code === 200) { if (res.data.code === 200) {
//++ //++
} else { } else {
// //
} }
}); });
console.log("data.userNum:"+data.user)
console.log("data.password:"+data.password)
} }
</script> </script>

View File

@ -14,9 +14,7 @@ export default defineConfig({
server: { server: {
proxy: { proxy: {
"/api": { "/api": {
target: "https://jsl-oa.x-lf.com", // 后端服务器的地址 target: "http://nbxt.oa.x-lf.cn", // 后端服务器的地址
// target: "http://localhost:8080", // 后端服务器的地址
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""), // 将请求路径中的 '/api' 前缀移除 rewrite: (path) => path.replace(/^\/api/, ""), // 将请求路径中的 '/api' 前缀移除
}, },
}, },