This commit is contained in:
14651
2025-08-13 09:19:28 +08:00
parent cbb8dc2ba6
commit 3743c72a54
22 changed files with 1472 additions and 43 deletions

View File

@@ -1,3 +1,4 @@
<!-- Login.vue -->
<template>
<view class="container">
<view class="logo">
@@ -11,14 +12,14 @@
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
</view>
</view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
</view>
<view class="xieyi text-center">
<text class="text-grey1">柳州市网信办 柳州职业技术学院</text>
</view>
</view>
</view>
@@ -39,22 +40,22 @@
showPassword: false
};
},
methods: {
login() {
let sdata= {
let sdata = {
username: this.username,
password: this.password
};
doLogin(sdata).then(res=>{
doLogin(sdata).then(res => {
if (res.code == 200) {
uni.setStorageSync('token', res.token);
uni.setStorageSync('token', res.token);
uni.showToast({
title: "登录成功",
icon: "success"
});
getInfo().then(res=>{
uni.setStorageSync("roles",res.roles[0])
getInfo().then(res => {
uni.setStorageSync("roles", res.roles[0])
})
uni.switchTab({
url: "/pages/index/index"
@@ -65,19 +66,19 @@
uni.showToast({
title: res.msg,
icon: "error"
})
} else{
} else {
console.log('11');
}
})
},
togglePassword() {
this.showPassword = !this.showPassword;
},
}
}
};
</script>