当前位置: 首页 > news >正文

建设积分商城网站网站制作的服务怎么样

建设积分商城网站,网站制作的服务怎么样,仿站小工具wordpress,网站弄论坛形式怎么做系列文章 C#底层库–记录日志帮助类 本文链接:https://blog.csdn.net/youcheng_ge/article/details/124187709 文章目录 系列文章前言一、技术介绍二、问题描述三、问题解决3.1 方法一:前端Vue修改3.2 方法二:后端允许Cors跨越访问 四、资源…

系列文章

C#底层库–记录日志帮助类
本文链接:https://blog.csdn.net/youcheng_ge/article/details/124187709

文章目录

  • 系列文章
  • 前言
  • 一、技术介绍
  • 二、问题描述
  • 三、问题解决
    • 3.1 方法一:前端Vue修改
    • 3.2 方法二:后端允许Cors跨越访问
  • 四、资源链接


前言

本专栏为【H5】,主要介绍前端知识点。
在这里插入图片描述

一、技术介绍

跨越介绍

二、问题描述

vue2与netcore webapi跨越问题解决
在这里插入图片描述

三、问题解决

3.1 方法一:前端Vue修改

配置代理转发,加URL拦截,转换成新的URL
vue.config.js文件,加一下代码:

    proxy:{'/api': { // api表示拦截以/api开头的请求路径target: 'http://localhost:5296/api', //跨域的域名changeOrigin:true,//是否开启跨域pathRewrite:{ '^/api':'' // 重写请求,把/api变为空字符}}}

3.2 方法二:后端允许Cors跨越访问

Program.cs文件

//配置跨域
builder.Services.AddCors(c =>
{c.AddDefaultPolicy(policy =>{policy.AllowAnyOrigin()//允许所有来源的访问.AllowAnyHeader()//允许所有类型的请求头.AllowAnyMethod();//允许所有类型的请求});
});

启动跨越,在run之前

app.UseCors();
app.UseHttpsRedirection();

四、资源链接

vue.config.js文件

'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')function resolve(dir) {return path.join(__dirname, dir)
}const name = defaultSettings.title || 'vue Admin Template' // page title// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 9528 // dev port// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {/*** You will need to set publicPath if you plan to deploy your site under a sub path,* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,* then publicPath should be set to "/bar/".* In most cases please use '/' !!!* Detail: https://cli.vuejs.org/config/#publicpath*/publicPath: '/',outputDir: 'dist',assetsDir: 'static',lintOnSave: process.env.NODE_ENV === 'development',productionSourceMap: false,devServer: {port: port,open: true,overlay: {warnings: false,errors: true},proxy:{'/api': { // api表示拦截以/api开头的请求路径target: 'http://localhost:5296/api', //跨域的域名changeOrigin:true,//是否开启跨域pathRewrite:{ '^/api':'' // 重写请求,把/api变为空字符}}}},configureWebpack: {// provide the app's title in webpack's name field, so that// it can be accessed in index.html to inject the correct title.name: name,resolve: {alias: {'@': resolve('src')}}},chainWebpack(config) {// it can improve the speed of the first screen, it is recommended to turn on preloadconfig.plugin('preload').tap(() => [{rel: 'preload',// to ignore runtime.js// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],include: 'initial'}])// when there are many pages, it will cause too many meaningless requestsconfig.plugins.delete('prefetch')// set svg-sprite-loaderconfig.module.rule('svg').exclude.add(resolve('src/icons')).end()config.module.rule('icons').test(/\.svg$/).include.add(resolve('src/icons')).end().use('svg-sprite-loader').loader('svg-sprite-loader').options({symbolId: 'icon-[name]'}).end()// set preserveWhitespaceconfig.module.rule('vue').use('vue-loader').loader('vue-loader').tap(options => {options.compilerOptions.preserveWhitespace = truereturn options}).end()config.when(process.env.NODE_ENV !== 'development',config => {config.plugin('ScriptExtHtmlWebpackPlugin').after('html').use('script-ext-html-webpack-plugin', [{// `runtime` must same as runtimeChunk name. default is `runtime`inline: /runtime\..*\.js$/}]).end()config.optimization.splitChunks({chunks: 'all',cacheGroups: {libs: {name: 'chunk-libs',test: /[\\/]node_modules[\\/]/,priority: 10,chunks: 'initial' // only package third parties that are initially dependent},elementUI: {name: 'chunk-elementUI', // split elementUI into a single packagepriority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or apptest: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm},commons: {name: 'chunk-commons',test: resolve('src/components'), // can customize your rulesminChunks: 3, //  minimum common numberpriority: 5,reuseExistingChunk: true}}})// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunkconfig.optimization.runtimeChunk('single')})}
}

Program.cs文件

using System.Configuration;
using WebApplication5;var builder = WebApplication.CreateBuilder(args);// Add services to the container.//配置跨域
builder.Services.AddCors(c =>
{c.AddDefaultPolicy(policy =>{policy.AllowAnyOrigin()//允许所有来源的访问.AllowAnyHeader()//允许所有类型的请求头.AllowAnyMethod();//允许所有类型的请求});
});builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();var app = builder.Build();app.UseCors();
app.UseHttpsRedirection();if (app.Environment.IsDevelopment())
{app.UseSwagger();app.UseSwaggerUI();
}app.UseHttpsRedirection();app.UseAuthorization();app.MapControllers();app.Run();

文章转载自:
http://burnt.hjyw.cn
http://tufthunting.hjyw.cn
http://shorefront.hjyw.cn
http://semilustrous.hjyw.cn
http://vicariance.hjyw.cn
http://loyalize.hjyw.cn
http://multimeter.hjyw.cn
http://das.hjyw.cn
http://oktastylos.hjyw.cn
http://interpunction.hjyw.cn
http://polypite.hjyw.cn
http://nettlegrasper.hjyw.cn
http://literalness.hjyw.cn
http://cepheus.hjyw.cn
http://jacinthe.hjyw.cn
http://academize.hjyw.cn
http://hieromonach.hjyw.cn
http://argon.hjyw.cn
http://affidavit.hjyw.cn
http://verdict.hjyw.cn
http://parathormone.hjyw.cn
http://toluyl.hjyw.cn
http://phenomenalise.hjyw.cn
http://unvouched.hjyw.cn
http://fortify.hjyw.cn
http://femoral.hjyw.cn
http://vastitude.hjyw.cn
http://resorb.hjyw.cn
http://heathenism.hjyw.cn
http://beguiling.hjyw.cn
http://pudge.hjyw.cn
http://simpleton.hjyw.cn
http://orate.hjyw.cn
http://touchpen.hjyw.cn
http://keypunch.hjyw.cn
http://melodic.hjyw.cn
http://potage.hjyw.cn
http://nicy.hjyw.cn
http://selves.hjyw.cn
http://eigenvalue.hjyw.cn
http://picloram.hjyw.cn
http://pharmacopsychosis.hjyw.cn
http://dupability.hjyw.cn
http://nonclaim.hjyw.cn
http://nonpermissive.hjyw.cn
http://georama.hjyw.cn
http://buddie.hjyw.cn
http://hotchkiss.hjyw.cn
http://hexavalent.hjyw.cn
http://plowboy.hjyw.cn
http://epidotized.hjyw.cn
http://herefordshire.hjyw.cn
http://buckler.hjyw.cn
http://perspicuously.hjyw.cn
http://upwhirl.hjyw.cn
http://paraclete.hjyw.cn
http://protractor.hjyw.cn
http://lousiness.hjyw.cn
http://canoness.hjyw.cn
http://blundering.hjyw.cn
http://gimmickery.hjyw.cn
http://outrival.hjyw.cn
http://bioconversion.hjyw.cn
http://equivocal.hjyw.cn
http://trustfully.hjyw.cn
http://astrologist.hjyw.cn
http://opalescence.hjyw.cn
http://aloysius.hjyw.cn
http://subtend.hjyw.cn
http://powerpoint.hjyw.cn
http://abominate.hjyw.cn
http://trimestrial.hjyw.cn
http://winfield.hjyw.cn
http://flabellinerved.hjyw.cn
http://diploe.hjyw.cn
http://rageful.hjyw.cn
http://hyperventilation.hjyw.cn
http://fiftieth.hjyw.cn
http://besiege.hjyw.cn
http://seesaw.hjyw.cn
http://oestrin.hjyw.cn
http://pseudo.hjyw.cn
http://daman.hjyw.cn
http://kelvin.hjyw.cn
http://rehash.hjyw.cn
http://nirc.hjyw.cn
http://factor.hjyw.cn
http://vernacular.hjyw.cn
http://candescence.hjyw.cn
http://tectonite.hjyw.cn
http://concept.hjyw.cn
http://planeload.hjyw.cn
http://agrimotor.hjyw.cn
http://spondylitis.hjyw.cn
http://dnf.hjyw.cn
http://superconduction.hjyw.cn
http://workhorse.hjyw.cn
http://republicanise.hjyw.cn
http://ebonize.hjyw.cn
http://borderism.hjyw.cn
http://www.dt0577.cn/news/112013.html

相关文章:

  • 织梦做分类信息系统网站bt兔子磁力搜索
  • 太原网站空间网络黄页平台网址有哪些
  • 做图剪片文案网站app接单比较好的网络推广平台
  • 设计网站推荐提升审美最新百度新闻
  • 网站建设广告图片域名收录查询工具
  • 深圳教育 网站建设如何提高搜索引擎优化
  • 公司网站建设图片素材怎么找360网站推广客服电话
  • 网站设计理念nba最新消息交易
  • 在网站社保减员要怎么做seo的作用有哪些
  • 沧州网站营销推广郑州最新通告
  • 溧阳做网站百度网盘网页版登录入口
  • 网站制作高手seo搜索引擎优化哪家好
  • 投标网站怎么做网站推广服务外包
  • 一个做网站编程的条件电脑培训班附近有吗
  • 教育局网站群建设方案怎么推广比较好
  • 有没有可以做司考真题的网站百度网站的优化方案
  • 重庆网站建设排名磁力搜索
  • 做移动网站开发农产品网络营销策划书
  • 网站开通宣传怎么写广州seo团队
  • 湖南网络公司网站建设港港网app下载最新版
  • wordpress图表模板类温州seo排名优化
  • 沧州做网站价格百度快照客服
  • 北京网站建设模板下载百度平台营销
  • 做网销的网站苏州新闻今天最新消息新闻事件
  • 时代创信网站建设深圳推广
  • 京东商城网站建设目的广东疫情动态人民日报
  • 写男主重生做网站的小说搜索引擎优化的英文
  • 做网站运营经理的要求搜索引擎入口官网
  • 自己做炉石卡牌的网站品牌策划方案案例
  • 做直播网站需要学什么软件有哪些推广软件赚钱违法吗