weizong song 2 weeks ago
parent 14d4ea21c9
commit 7cfb609630

@ -37,8 +37,8 @@ export function getAuthMenu(token) {
export function getMsg(param) { export function getMsg(param) {
return request({ return request({
url: '/api/admin/auth/send-sms', url: '/api/admin/auth/send-sms',
method: 'get', method: 'post',
params:param, data: param,
isLoading: false isLoading: false
}) })
} }
@ -46,8 +46,8 @@ export function getMsg(param) {
export function loginMsg(param) { export function loginMsg(param) {
return request({ return request({
url: '/api/admin/auth/sms-login', url: '/api/admin/auth/sms-login',
method: 'get', method: 'post',
params:param, data: param,
isLoading: false isLoading: false
}) })
} }

@ -76,14 +76,16 @@ const actions = {
loginMsg({ loginMsg({
commit commit
}, userInfo) { }, userInfo) {
const { const {
mobile, mobile,
code code,
challenge_id
} = userInfo } = userInfo
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
loginMsg({ loginMsg({
mobile: mobile, mobile: mobile,
code: code code: code,
challenge_id: challenge_id
}).then(response => { }).then(response => {
console.log(response) console.log(response)
const { const {

@ -96,9 +96,12 @@
hasSend: false, hasSend: false,
count: 60, count: 60,
sendTimer: null, sendTimer: null,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: '',
mobile: '',
code: '',
challenge_id: ''
}, },
loginRules: { loginRules: {
username: [{ username: [{
@ -168,7 +171,8 @@
getMsg({ getMsg({
mobile: this.loginForm.mobile mobile: this.loginForm.mobile
}).then(res => { }).then(res => {
this.base.showMessage("发送成功",'success') this.base.showMessage("发送成功",'success')
this.loginForm.challenge_id = res.challenge_id
// this.$Message.success('') // this.$Message.success('')
// 60s // 60s
this.hasSend = true this.hasSend = true
@ -194,6 +198,10 @@
this.base.showMessage("请输入验证码",'error') this.base.showMessage("请输入验证码",'error')
return return
} }
if (this.base.isNull(this.loginForm.challenge_id)) {
this.base.showMessage("请先获取验证码",'error')
return
}
this.loading = true this.loading = true
let that = this let that = this
this.$store.dispatch('user/loginMsg', this.loginForm).then(() => { this.$store.dispatch('user/loginMsg', this.loginForm).then(() => {

@ -32,7 +32,7 @@ module.exports = {
// outputDir: '/Users/mac/Documents/朗业/2024/s-苏州科技商学院/wx.sstbc.com/public/admin', // outputDir: '/Users/mac/Documents/朗业/2024/s-苏州科技商学院/wx.sstbc.com/public/admin',
// 测试 // 测试
// outputDir: '/Users/mac/Documents/朗业/2025/s-苏州科技商学院/wx.sstbc.com/public/admin', // outputDir: '/Users/mac/Documents/朗业/2025/s-苏州科技商学院/wx.sstbc.com/public/admin',
outputDir: '/Users/mac/Documents/朗业/2026/s-苏州科技商学院/code/wx.sstbc.com/public/admin', outputDir: '../backend/public/admin',
assetsDir: 'static', assetsDir: 'static',
css: { css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项 loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save