Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

vue封装的请求接口url添加动态参数

export const Details = apiNodeAction({
    method: 'GET',
    url: '/order/:id'
});

如上id是需要拼接到接口/order/后面的
下面是apiNodeAction的代码 怎么进行配置才能支持以上需求

class ApiNodeAction extends ApiBaseAction {
    constructor() {
        super();
        this.$baseUrl = NODEAPI + '/v2';
        this.$defaultHeaders = (params = {}) => {
            return {
                'Vary-Client': '111',
                'Authorization':'222'
                'Sign':'3333'
            }
        }
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...