Commit 8777c9cc by suwenbiao

登录

parent 59e8e10e
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
ENV = 'development' ENV = 'development'
# base api # base api
# VUE_APP_BASE_API = '/dev-api'
#VUE_APP_BASE_API = 'http://192.168.3.43:8870' #VUE_APP_BASE_API = 'http://192.168.3.44:8981'
#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_REDIRECT_URL = 'http://qw.finekaa.com'
...@@ -3,8 +3,14 @@ ...@@ -3,8 +3,14 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build": "vue-cli-service build" "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": { "dependencies": {
"axios": "^1.6.0", "axios": "^1.6.0",
......
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
ENV = 'development' ENV = 'development'
# base api # base api
# VUE_APP_BASE_API = '/dev-api'
#VUE_APP_BASE_API = 'http://192.168.3.43:8870' VUE_APP_BASE_API = 'http://192.168.3.44:8981'
#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_REDIRECT_URL = 'http://qw.finekaa.com'
...@@ -3,7 +3,16 @@ import request from './request.js' ...@@ -3,7 +3,16 @@ import request from './request.js'
//账号密码登录 //账号密码登录
function login(data) { 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' import axios from 'axios'
// const baseUrl = 'http://oc-am-api.finezb.com'; const baseUrl = "http://192.168.3.44:8981"
const baseUrl = process.env.VUE_APP_BASE_URL;
// const baseUrl = 'http://192.168.3.156:8873';
const request = (url, method, data) => { const request = (url, method, data) => {
console.log(url, method, data);
var header = { var header = {
"Token": sessionStorage.getItem('u_token'), "Token": sessionStorage.getItem('u_token'),
"Access-control-Allow-Origin":"*"
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (method === 'GET') { if (method === 'GET') {
...@@ -26,6 +26,7 @@ const request = (url, method, data) => { ...@@ -26,6 +26,7 @@ const request = (url, method, data) => {
reject(err); //失败 reject(err); //失败
}); });
} else if (method === 'POST') { } else if (method === 'POST') {
console.log(555);
axios({ axios({
headers: header, headers: header,
method: method, method: method,
......
...@@ -43,10 +43,9 @@ ...@@ -43,10 +43,9 @@
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
// import { validUsername } from '@/utils/validate' // import { validUsername } from '@/utils/validate'
// import { Message } from 'element-ui' import api from '../api/index.js'
export default { export default {
name: 'Login', name: 'Login',
...@@ -96,54 +95,34 @@ export default { ...@@ -96,54 +95,34 @@ export default {
// this.scaleNum = (this.screenWidth / 1920) // this.scaleNum = (this.screenWidth / 1920)
// console.log(this.scaleNum) // console.log(this.scaleNum)
// }, // },
// methods: { methods: {
// showPwd() { showPwd() {
// if (this.passwordType === 'password') { if (this.passwordType === 'password') {
// this.passwordType = '' this.passwordType = ''
// } else { } else {
// this.passwordType = 'password' this.passwordType = 'password'
// } }
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.password.focus() this.$refs.password.focus()
// }) })
// }, },
// handleLogin() { handleLogin() {
// console.log(document.domain) var loginfrom = {
// this.loginForm.subDomain = document.domain + '.' login:"shi.jiuyan@163.com",
// // this.loginForm.subDomain = 'ut60txvc.' password:'654321'
// this.$refs.loginForm.validate(valid => { }
// if (valid) { api.login(loginfrom).then(res=>{
// this.loading = true console.log(res);
// this.$store.dispatch('user/login', this.loginForm).then(res => { })
// if (res.code === 200) { },
// sessionStorage.setItem('channelName', res.channelName) handleRegister() {
// this.$router.push({ path: '/' }) this.$router.push({ path: '/register' })
// 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' })
// }
/* async register() { /* async register() {
await this.$store.dispatch('user/logout') await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`) this.$router.push(`/login?redirect=${this.$route.fullPath}`)
}*/ }*/
// } }
} }
</script> </script>
<style lang="scss"> <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