浏览器提示错误代码:
Failed to load resource: net::ERR_CONNECTION_REFUSED
出现这个问题是core服务异常,重启core服务可解决
layUi 下拉框赋值
var loadZhongduan = function (data) { admin.req({ url: baseUrl + "shoukuanZhongduan/getList" , success: function (res) { var zhongduan = $("#zhongduan"); zhongduan.empty(); zhongduan.append("<option value=''>请选择</option>") $.each(res.data, function (n, o) { zhongduan.append("<option value='" + o.id + "'>" + o.shoujihaoma+ "</option>") }) if (data && data.zhongduanId) { zhongduan.val(data.zhongduanId); } form.render(); } }) }
关键代码是
if (data && data.zhongduanId) { zhongduan.val(data.zhongduanId); }
如果不走网关,console_web 访问 console_service 需要配置跨域
/** * 配置跨域 * @author BOOM * */ //@Configuration public class CorsConfig {
打开跨域,去掉注释