26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
if (Config.modulename === 'index' && Config.controllername === 'user' && ['login', 'register'].indexOf(Config.actionname) > -1 && $("#register-form,#login-form").length > 0 && $(".social-login").length == 0) {
|
|
$("#register-form,#login-form").append(Config.third.loginhtml || '');
|
|
}
|
|
|
|
|
|
if ((Config.modulename == 'admin' || Config.modulename =='manystore') && (Config.actionname == 'add'||Config.actionname == 'edit'||Config.actionname == 'index'||Config.actionname == 'addnew')) {
|
|
|
|
require([ 'jquery'], function ( $) {
|
|
//必填项的输入框 加上 *
|
|
$('*[data-rule="required"]').map((v,k)=>{
|
|
|
|
let rs_l = $(k).parent().children('label') || null;
|
|
let rs = $(k).parent().parent().children('label') || null;
|
|
let r_str = rs.html() || rs_l.html();
|
|
let star = `<span style="color: red">*</span>${r_str}`;
|
|
if(rs.html()){
|
|
rs.html(star);
|
|
}else if(rs_l.html()){
|
|
rs_l.html(star);
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
}
|