jiangyy 4 years ago
parent
commit
82d33703cd
  1. 2
      .env.development
  2. 4
      src/components/verifition/api/verifition-api.js
  3. 14
      src/views/account/login.vue
  4. 2
      src/views/account/login/index.vue

2
.env.development

@ -1,7 +1,7 @@
# 页面标题
VUE_APP_TITLE = 问卷调查测试环境
# 接口请求地址,会设置到 axios 的 baseURL 参数上
# VUE_APP_API_ROOT = /tduck-api
VUE_APP_API_ROOT_TDUCK = /tduck-api
VUE_APP_API_ROOT = http://192.168.1.140/api
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
VUE_APP_DEBUG_TOOL =

4
src/components/verifition/api/verifition-api.js

@ -7,7 +7,7 @@ import request from '@/api/index.js' // 调用项目封装的axios
// 获取验证图片 以及token
export function reqGet(data) {
return request({
url: '/captcha/get',
url: `${process.env.VUE_APP_API_ROOT_TDUCK}/captcha/get`,
method: 'post',
data
})
@ -16,7 +16,7 @@ export function reqGet(data) {
// 滑动或者点选验证
export function reqCheck(data) {
return request({
url: '/captcha/check',
url: `${process.env.VUE_APP_API_ROOT_TDUCK}/captcha/check`,
method: 'post',
data
})

14
src/views/account/login.vue

@ -323,7 +323,7 @@ export default {
//
getLoginWxQrCode() {
this.wxQrCodeLoading = true
this.$api.get('/login/wx/qrcode').then(res => {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/login/wx/qrcode`).then(res => {
this.wxLoginQrCode = res.data.qrCodeUrl
this.wxLoginId = res.data.loginId
})
@ -335,7 +335,7 @@ export default {
// qq
getQQLoginAuthorizeUrl() {
let reUrl = getCurrentDomain() + '/redirect/qqlogin'
this.$api.get('/login/qq/authorize/url', {params: {redirectUri: reUrl}}).then(res => {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/login/qq/authorize/url`, {params: {redirectUri: reUrl}}).then(res => {
this.qqLoginAuthorizeUrl = res.data
})
},
@ -344,7 +344,7 @@ export default {
location.href = url
},
getLoginWxQrCodeResult() {
this.$api.get('/login/wx/qrcode/result', {params: {loginId: this.wxLoginId}}).then(res => {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/login/wx/qrcode/result`, {params: {loginId: this.wxLoginId}}).then(res => {
if (res.data) {
this.loginSuccessHandle(res.data)
}
@ -354,7 +354,7 @@ export default {
this.$refs['emailRegForm'].validateField('email', err => {
if (!err) {
this.emailValidateCodeBtn = true
this.$api.get(`/register/email/code?email=${this.accountForm.email}`).then(() => {
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/register/email/code?email=${this.accountForm.email}`).then(() => {
this.msgSuccess('验证码发送成功,5分钟内有效')
this.emailValidateCodeBtn = true
let count = 60
@ -395,7 +395,7 @@ export default {
phoneRegHandle() {
this.$refs['phoneRegForm'].validate(valid => {
if (valid) {
this.$api.post('/tduck-api/register/phone', this.accountForm).then(() => {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/register/phone`, this.accountForm).then(() => {
this.registerSuccessHandle()
})
} else {
@ -406,7 +406,7 @@ export default {
emailRegHandle() {
this.$refs['emailRegForm'].validate(valid => {
if (valid) {
this.$api.post('/tduck-api/register/email', this.accountForm).then(() => {
this.$api.post(`${process.env.VUE_APP_API_ROOT_TDUCK}/register/email`, this.accountForm).then(() => {
this.registerSuccessHandle()
})
} else {
@ -444,7 +444,7 @@ export default {
loginHandle() {
this.$api.request({
url: '/tduck-api/login/account',
url: `${process.env.VUE_APP_API_ROOT_TDUCK}/login/account`,
method: 'post',
data: this.accountForm
}).then(res => {

2
src/views/account/login/index.vue

@ -208,7 +208,7 @@ export default {
this.$refs['accountLoginForm'].validate(valid => {
if (valid) {
this.$api.request({
url: 'http://192.168.1.140/api/tduck-api/login/account',
url: `${process.env.VUE_APP_API_ROOT_TDUCK}/login/account`,
// url: '/login/account',
method: 'post',

Loading…
Cancel
Save