wangguoyu 10 mesiacov pred
rodič
commit
56cf112516

+ 1 - 2
config.js

@@ -1,5 +1,5 @@
 // 应用全局配置
-const configObject = {
+export default   {
   baseUrl: 'https://kf179.mtavip.com/api',
   // baseUrl: 'http://localhost:8080',
   // 应用信息
@@ -24,4 +24,3 @@ const configObject = {
     ]
   }
 }
-export default configObject

+ 2 - 7
pages.json

@@ -1,13 +1,13 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path": "pages/index/index",
+			"path": "pages/login",
 			"style": {
 				"navigationBarTitleText": "uni-app"
 			}
 		},
 		{
-			"path": "pages/login",
+			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "uni-app"
 			}
@@ -58,11 +58,6 @@
 				"selectedIconPath": "static/images/tabbar/select/kecheng-sj.png",
 				"text": "课程"
 			}, {
-				"pagePath": "pages/exam/index",
-				"iconPath": "static/images/tabbar/unselect/score-sj.png",
-				"selectedIconPath": "static/images/tabbar/select/score-sj.png",
-				"text": "成绩"
-			}, {
 				"pagePath": "pages/demo/index",
 				"iconPath": "static/images/tabbar/unselect/my-sj.png",
 				"selectedIconPath": "static/images/tabbar/unselect/my-sj.png",

+ 96 - 5
pages/login.vue

@@ -1,9 +1,100 @@
 <template>
-  <view >
-	登陆1
-  </view>
+	<view class="content">
+		<view class="login-top">
+			<img src="../static/images/login/login-bj-sj.png">
+			<text>
+				{{systemName}}
+			</text>
+		</view>
+		<view class="text-area">
+			<input type="text" v-model="username" placeholder="Username" class="input-item" />
+			<input type="password" v-model="password" placeholder="Password" class="input-item" />
+			<button @click="handleLogin">Login</button>
+		</view>
+	</view>
 </template>
-<script></script>
-<style lang="scss">
 
+<script setup>
+	import {
+		getAppConfig,
+		login,
+		kaoshiList
+	} from '@/api/login.js'
+	import {
+		ref
+	} from 'vue';
+	let systemName = ref('麦塔考试')
+	let username = ref('')
+	let password = ref('')
+	//let loginLogoImg = ref('../static/images/login/login-bj-sj.png')
+
+	const  changePassword = ()=>{
+
+	}
+	const handleLogin = () => {
+		console.log('Username:', username.value);
+		console.log('Password:', password.value);
+		let req = {
+			//lli.encode()
+			password: 'sVXqow3/+jG5kIDVGqoezXoK/Pceal1cf/kiojvUdvSU0qTjm5ikUz9CHcsu05I9whRxeep/TDVAcNl2dEqAgSUr5Ufq1FDdHr5Pn/HA5LfoZV+n5j82RE93cwcrCJw6/MwW3ZWgISzvG5qN8t9IzkRX2qMB/7SJxnh3NzoaxX4=',
+			userName: 'root'
+		}
+		login(req).then(res => {
+			let obj = JSON.stringify(res.data)
+			console.log(obj)
+			uni.setStorage({
+				key: 'Mta-Auth',
+				data: obj // 假设 this.userInputValue 是用户输入的数据
+			});
+
+			setTimeout(() => {
+				let req = {
+					'page': 1,
+					'size': 4,
+					'status': 1,
+				}
+				kaoshiList(req).then(res => {
+					console.log(res)
+				})
+			}, 5000)
+		})
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		display: flex;
+
+		.login-top {
+			height: 270px;
+			background-size: cover;
+			background-image: url("../static/images/login/login-bj-sj.png");
+			// logo
+			img {
+				width: 133px;
+				max-height: 50px;
+				margin-top: 78px;
+			}
+		}
+
+	}
+	.text-area {
+		display: flex;
+		justify-content: center;
+		.input-item {
+			margin-bottom: 20rpx;
+			height: 40rpx;
+			line-height: 40rpx;
+			padding: 0 10rpx;
+			border: 1px solid #ccc;
+			border-radius: 4rpx;
+		}
+		button {
+			margin-top: 20rpx;
+			padding: 10rpx 20rpx;
+			background-color: #409EFF;
+			color: #fff;
+			border-radius: 4rpx;
+		}
+	}
 </style>

BIN
static/images/login/login-bj-sj.png


BIN
static/images/login/login-logo-sj.png


+ 11 - 4
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,8 +1,15 @@
 {
-  "hash": "e94da314",
-  "configHash": "a7683397",
+  "hash": "88503f0e",
+  "configHash": "ea4e468c",
   "lockfileHash": "e3b0c442",
-  "browserHash": "fbec12e7",
-  "optimized": {},
+  "browserHash": "38e76d38",
+  "optimized": {
+    "ts-md5/dist/md5": {
+      "src": "../../../../../node_modules/ts-md5/dist/md5.js",
+      "file": "ts-md5_dist_md5.js",
+      "fileHash": "c0f874e9",
+      "needsInterop": true
+    }
+  },
   "chunks": {}
 }

+ 1 - 1
utils/request.js

@@ -1,5 +1,5 @@
 //import store from '@/store'
-import config from '@/config'
+import config from '../config.js'
 import { getAuth } from '@/utils/auth'
 import { Md5 }   from 'ts-md5/dist/md5';
 import errorCode from '@/utils/errorCode'