diff --git a/wwwroot/user/login.ui b/wwwroot/user/login.ui index d442512..abbb230 100644 --- a/wwwroot/user/login.ui +++ b/wwwroot/user/login.ui @@ -105,7 +105,7 @@ "event": "click", "actiontype": "script", "target": "self", - "script": "var form=bricks.getWidgetById('phone_form',bricks.app);if(!form){alert('form not found');return;}var vals=form._getValue();var cell=vals.cell_no;if(!cell){alert('请输入手机号');return;}this.options.label='发送中...';fetch(bricks.app.baseUrl+'/rbac/gen_sms_code.dspy?_webbricks_=1&cellphone='+encodeURIComponent(cell)).then(function(r){return r.json()}).then(function(d){var btn=bricks.getWidgetById('gen_code_btn',bricks.app);if(d.status==='ok'){form.setValue({codeid:d.data.key});if(btn){btn.options.label='已发送'}}else{alert(d.data.message);if(btn){btn.options.label='发送验证码'}}}).catch(function(e){alert('发送失败:'+e);var btn=bricks.getWidgetById('gen_code_btn',bricks.app);if(btn){btn.options.label='发送验证码'}})" + "script": "var form=bricks.getWidgetById('phone_form',bricks.app);if(!form){alert('form not found');return;}var vals=form._getValue();var cell=vals.cell_no;if(!cell){alert('请输入手机号');return;}var btn=bricks.getWidgetById('gen_code_btn',bricks.app);if(btn&&btn.text_w){btn.text_w.set_text('发送中...')}fetch(bricks.app.baseUrl+'/rbac/gen_sms_code.dspy?_webbricks_=1&cellphone='+encodeURIComponent(cell)).then(function(r){return r.json()}).then(function(d){if(d.status==='ok'){form.setValue({codeid:d.data.key});if(btn&&btn.text_w){btn.text_w.set_text('已发送('+cell+')')}}else{alert(d.data.message);if(btn&&btn.text_w){btn.text_w.set_text('发送验证码')}}}).catch(function(e){alert('发送失败:'+e);if(btn&&btn.text_w){btn.text_w.set_text('发送验证码')}})" } ] }