Commit 8777c9cc by suwenbiao

登录

parent 59e8e10e
......@@ -2,13 +2,6 @@
ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
#VUE_APP_BASE_API = 'http://192.168.3.43:8870'
#VUE_APP_BASE_API = 'https://test-channelapi.finezb.com/'
VUE_APP_BASE_API = 'http://oc-channel-api.finekaa.com'
#VUE_APP_LIVE_PLAYER='http://static.oclive.cn/live.player_commons_4.4.js'
VUE_APP_LIVE_PLAYER='http://static.oclive.cn/live.player_commons_5.2.js'
#VUE_APP_LIVE_PLAYER='https://webjs-lib.finezb.com/live.player_commons_4.2.js'
#VUE_APP_BASE_API = 'http://192.168.3.44:8981'
VUE_APP_REDIRECT_URL = 'http://qw.finekaa.com'
......@@ -3,8 +3,14 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"test:ci": "npm run lint && npm run test:unit"
},
"dependencies": {
"axios": "^1.6.0",
......
......@@ -2,13 +2,6 @@
ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
#VUE_APP_BASE_API = 'http://192.168.3.43:8870'
#VUE_APP_BASE_API = 'https://test-channelapi.finezb.com/'
VUE_APP_BASE_API = 'http://oc-channel-api.finekaa.com'
#VUE_APP_LIVE_PLAYER='http://static.oclive.cn/live.player_commons_4.4.js'
VUE_APP_LIVE_PLAYER='http://static.oclive.cn/live.player_commons_5.2.js'
#VUE_APP_LIVE_PLAYER='https://webjs-lib.finezb.com/live.player_commons_4.2.js'
VUE_APP_BASE_API = 'http://192.168.3.44:8981'
VUE_APP_REDIRECT_URL = 'http://qw.finekaa.com'
......@@ -3,7 +3,16 @@ import request from './request.js'
//账号密码登录
function login(data) {
return request('/assistive/login', "GET", data)
// return request('/auth/login', "POST", data)
const form = new FormData()
for (const key in data) {
form.append(key, data[key])
}
return request(
'/auth/login',
'POST',
form
)
}
......
import axios from 'axios'
// const baseUrl = 'http://oc-am-api.finezb.com';
const baseUrl = process.env.VUE_APP_BASE_URL;
// const baseUrl = 'http://192.168.3.156:8873';
const baseUrl = "http://192.168.3.44:8981"
const request = (url, method, data) => {
console.log(url, method, data);
var header = {
"Token": sessionStorage.getItem('u_token'),
"Access-control-Allow-Origin":"*"
}
return new Promise((resolve, reject) => {
if (method === 'GET') {
......@@ -26,6 +26,7 @@ const request = (url, method, data) => {
reject(err); //失败
});
} else if (method === 'POST') {
console.log(555);
axios({
headers: header,
method: method,
......
......@@ -43,10 +43,9 @@
</el-form>
</div>
</template>
<script>
// import { validUsername } from '@/utils/validate'
// import { Message } from 'element-ui'
import api from '../api/index.js'
export default {
name: 'Login',
......@@ -96,54 +95,34 @@ export default {
// this.scaleNum = (this.screenWidth / 1920)
// console.log(this.scaleNum)
// },
// methods: {
// showPwd() {
// if (this.passwordType === 'password') {
// this.passwordType = ''
// } else {
// this.passwordType = 'password'
// }
// this.$nextTick(() => {
// this.$refs.password.focus()
// })
// },
// handleLogin() {
// console.log(document.domain)
// this.loginForm.subDomain = document.domain + '.'
// // this.loginForm.subDomain = 'ut60txvc.'
// this.$refs.loginForm.validate(valid => {
// if (valid) {
// this.loading = true
// this.$store.dispatch('user/login', this.loginForm).then(res => {
// if (res.code === 200) {
// sessionStorage.setItem('channelName', res.channelName)
// this.$router.push({ path: '/' })
// this.loading = false
// } else {
// Message({
// message: res.message || 'Error',
// type: 'error',
// duration: 5 * 1000
// })
// this.loading = false
// }
// }).catch(() => {
// this.loading = false
// })
// } else {
// console.log('error submit!!')
// return false
// }
// })
// },
// handleRegister() {
// this.$router.push({ path: '/register' })
// }
methods: {
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus()
})
},
handleLogin() {
var loginfrom = {
login:"shi.jiuyan@163.com",
password:'654321'
}
api.login(loginfrom).then(res=>{
console.log(res);
})
},
handleRegister() {
this.$router.push({ path: '/register' })
}
/* async register() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
}*/
// }
}
}
</script>
<style lang="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