|
@@ -10,33 +10,61 @@
|
|
|
<view class="operation">
|
|
|
<uni-easyinput prefixIcon="person-filled" v-model="username" placeholder="请输入登录账号" ></uni-easyinput>
|
|
|
<uni-easyinput prefixIcon="locked-filled" v-model="password" placeholder="请输入登录密码" type="password"></uni-easyinput>
|
|
|
- <button type="primary" @click="handleLogin" :loading="loading" :disabled="loading">登录</button>
|
|
|
+ <button type="primary" :loading="loading" :disabled="loading" @click="handleLogin">登录</button>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
+
|
|
|
+ <u-top-tips ref="uTips" navbar-height="0"></u-top-tips>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {ref} from "vue";
|
|
|
+ import {ApiRequest} from "@/utils/request.js"
|
|
|
|
|
|
+ const uTips = ref()
|
|
|
const username = ref('')
|
|
|
const password = ref('')
|
|
|
const loading = ref(false)
|
|
|
|
|
|
|
|
|
function handleLogin(){
|
|
|
- loading.value = true
|
|
|
- console.log(username.value)
|
|
|
- console.log(password.value)
|
|
|
- uni.showToast({
|
|
|
- title: "登录中...",
|
|
|
- icon: "loading",
|
|
|
- mask: true
|
|
|
- })
|
|
|
- uni.switchTab({url: "/pages/handleFile/handleFile"})
|
|
|
-
|
|
|
+ if(!username.value){
|
|
|
+ uTips.value.show({
|
|
|
+ title: '请输入登录账号',
|
|
|
+ type: 'error',
|
|
|
+ duration: '2300'
|
|
|
+ })
|
|
|
+ }else if(!password.value){
|
|
|
+ uTips.value.show({
|
|
|
+ title: '请输入登录密码',
|
|
|
+ type: 'error',
|
|
|
+ duration: '2300'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // ApiRequest({
|
|
|
+ // url: "/connect/token",
|
|
|
+ // method: "POST",
|
|
|
+ // data: {
|
|
|
+ // client_id: "androidclient",
|
|
|
+ // grant_type: "password",
|
|
|
+ // scope: "openid profile email RefineAPI",
|
|
|
+ // username: username.value,
|
|
|
+ // password: password.value
|
|
|
+ // }
|
|
|
+ // }).then(res=>{
|
|
|
+ // uni.setStorageSync('GlWorkPlatform-AccessToken','')
|
|
|
+ // })
|
|
|
+
|
|
|
+ uni.setStorageSync('token','666')
|
|
|
+ loading.value = true
|
|
|
+ uni.showToast({
|
|
|
+ title: "登录中...",
|
|
|
+ icon: "loading",
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ uni.switchTab({url: "/pages/handleFile/handleFile"})
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|