Commit 474be6a7 by pangchong

feat: 调整

parent 4fff4973
......@@ -11,31 +11,3 @@ export const getGifCaptcha = async () => {
loginCode.value = 'data:image/png;base64,' + uni.arrayBufferToBase64(res)
}
}
//接入amms
export const loginAmms = () => {
const ammsToken = uni.getStorageSync('access_token')
if (ammsToken) {
showLoad.value = true
uni.request({
url: `http://10.72.63.191:8080/mroapi/auth/oauth/check_token?token=${ammsToken}`,
method: 'GET',
header: {
Authorization: 'Basic YXBwOmVraW5n'
}
})
.then(function (res) {
showLoad.value = false
if (res.username) {
loginForm.username = res.username
loginForm.verifyCode = 'Mocp_DebuG_9527_8341'
loginForm.password = 'Ifar2016_0525'
handleLogin()
}
})
.catch(function (reason) {
showLoad.value = false
console.log('AMMS跳转登录出现错误', reason)
})
}
}
......@@ -41,7 +41,7 @@
<script setup>
import { debounce } from 'lodash'
import { loginCode, loginForm, rules, loginFormRef, showLoad } from './constants/index.compositions'
import { getGifCaptcha, loginAmms } from './constants/index.functionals'
import { getGifCaptcha } from './constants/index.functionals'
import { onLoad } from '@dcloudio/uni-app'
import { ref, toRaw, watch } from 'vue'
import useUserStore from 'mocp/store/user'
......@@ -76,6 +76,34 @@ const handleLogin = async () => {
uni.$mocpMessage.error(res.message)
}
}
//接入amms
const loginAmms = () => {
const ammsToken = uni.getStorageSync('access_token')
if (ammsToken) {
showLoad.value = true
uni.request({
url: `http://10.72.63.191:8080/mroapi/auth/oauth/check_token?token=${ammsToken}`,
method: 'GET',
header: {
Authorization: 'Basic YXBwOmVraW5n'
}
})
.then(function (res) {
if (res.username) {
loginForm.username = res.username
loginForm.verifyCode = 'Mocp_DebuG_9527_8341'
loginForm.password = 'Ifar2016_0525'
handleLogin()
}
})
.catch(function (reason) {
console.log('AMMS跳转登录出现错误', reason)
})
.finally(() => {
showLoad.value = false
})
}
}
</script>
<style lang="scss">
@import './constants/index.scss';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment